1(function(context){'use strict';var win=context,doc=win.document;var global_instance_name='cbinstance';function contentLoaded(win,fn){var done=!1,top=!0,doc=win.document,root=doc.documentElement,add=doc.addEventListener?'addEventListener':'attachEvent',rem=doc.addEventListener?'removeEventListener':'detachEvent',pre=doc.addEventListener?'':'on',init=function(e){if(e.type=='readystatechange'&&doc.readyState!='complete')return;(e.type=='load'?win:doc)[rem](pre+e.type,init,!1);if(!done&&(done=!0))fn.call(win,e.type||e)},poll=function(){try{root.doScroll('left')}catch(e){setTimeout(poll,50);return} 2init('poll')};if(doc.readyState=='complete')fn.call(win,'lazy');else{if(doc.createEventObject&&root.doScroll){try{top=!win.frameElement}catch(e){} 3if(top)poll()} 4doc[add](pre+'DOMContentLoaded',init,!1);doc[add](pre+'readystatechange',init,!1);win[add](pre+'load',init,!1)}} 5var Cookies={get:function(key){return decodeURIComponent(doc.cookie.replace(new RegExp('(?:(?:^|.*;)\\s*'+encodeURIComponent(key).replace(/[-.+*]/g,'\\$&')+'\\s*\\=\\s*([^;]*).*$)|^.*$'),'$1'))||null},set:function(key,val,end,path,domain,secure){if(!key||/^(?:expires|max-age|path|domain|secure)$/i.test(key)){return!1} 6var expires='';if(end){switch(end.constructor){case Number:expires=end===Infinity?'; expires=Fri, 31 Dec 9999 23:59:59 GMT':'; max-age='+end;break;case String:expires='; expires='+end;break;case Date:expires='; expires='+end.toUTCString();break}} 7doc.cookie=encodeURIComponent(key)+'='+encodeURIComponent(val)+expires+(domain?'; domain='+domain:'')+(path?'; path='+path:'')+(secure?'; secure':'');return!0},has:function(key){return(new RegExp('(?:^|;\\s*)'+encodeURIComponent(key).replace(/[-.+*]/g,'\\$&')+'\\s*\\=')).test(doc.cookie)},remove:function(key,path,domain){if(!key||!this.has(key)){return!1} 8doc.cookie=encodeURIComponent(key)+'=; expires=Thu, 01 Jan 1970 00:00:00 GMT'+(domain?'; domain='+domain:'')+(path?'; path='+path:'');return!0}};var Utils={merge:function(){var obj={},i=0,al=arguments.length,key;if(0===al){return obj} 9for(;i<al;i++){for(key in arguments[i]){if(Object.prototype.hasOwnProperty.call(arguments[i],key)){obj[key]=arguments[i][key]}}} 10return obj},str2bool:function(str){str=String(str);switch(str.toLowerCase()){case 'false':case 'no':case '0':case '':return!1;default:return!0}},fade_in:function(el){if(el.style.opacity<1){el.style.opacity=(parseFloat(el.style.opacity)+0.05).toFixed(2);win.setTimeout(function(){Utils.fade_in(el)},50)}},fade_out:function(el,duration_ms){if(typeof(el)!=="undefined"){el.style.opacity=1;var seconds=duration_ms/1000;el.style.transition="opacity "+seconds+"s ease";el.style.opacity=0;setTimeout(function(){el.parentNode.removeChild(el)},duration_ms)}},get_data_attribs:function(script){var data={};if(Object.prototype.hasOwnProperty.call(script,'dataset')){data=script.dataset}else{var attribs=script.attributes;var key;for(key in attribs){if(Object.prototype.hasOwnProperty.call(attribs,key)){var attr=attribs[key];if(/^data-/.test(attr.name)){var camelized=Utils.camelize(attr.name.substr(5));var isFunction=(camelized.lastIndexOf('on',0)===0);data[camelized]=isFunction?eval(attr.value):attr.value}}}} 11return data},normalize_keys:function(options_object){var camelized={};for(var key in options_object){if(Object.prototype.hasOwnProperty.call(options_object,key)){var camelized_key=Utils.camelize(key);camelized[camelized_key]=options_object[camelized_key]?options_object[camelized_key]:options_object[key]}} 12return camelized},camelize:function(str){var separator='-',match=str.indexOf(separator);while(match!==-1){var last=(match===(str.length-1)),next=last?'':str[match+1],upnext=next.toUpperCase(),sep_substr=last?separator:separator+next;str=str.replace(sep_substr,upnext);match=str.indexOf(separator)} 13return str},find_script_by_id:function(id){var scripts=doc.getElementsByTagName('script');for(var i=0,l=scripts.length;i<l;i++){if(id===scripts[i].id){return scripts[i]}} 14return null},is_numeric:function(val){return(parseFloat(val)==val)},};var script_el_invoker=Utils.find_script_by_id('cookiebanner');var Cookiebanner=context.Cookiebanner=function(opts){this.init(opts)};
14Cookiebanner.prototype={cookiejar:Cookies,init:function(opts){this.inserted=!1;this.closed=!1;var default_text='We use cookies to enhance your experience. '+'By continuing to visit this site you agree to our use of cookies.';var default_link='Learn more';this.default_options={cookie:'cookiebanner-accepted',closeText:'✖',closeStyle:'float:right;padding-left:5px;',closePrecedes:!0,cookiePath:'/',cookieDomain:null,cookieSecure:!1,debug:!1,expires:Infinity,zindex:255,mask:!1,maskOpacity:0.5,maskBackground:'#000',height:'auto',minHeight:'21px',bg:'#000',fg:'#ddd',link:'#aaa',position:'bottom',padding:'5px 16px',message:default_text,linkmsg:default_link,moreinfo:'http://aboutcookies.org',moreinfoTarget:'_blank',moreinfoRel:'noopener noreferrer',moreinfoDecoration:'none',moreinfoFontWeight:'normal',moreinfoFontSize:null,moreinfoClass:null,effect:null,fontSize:'14px',fontFamily:'arial, sans-serif',instance:global_instance_name,textAlign:'center',acceptOnScroll:!1,acceptOnClick:!1,acceptOnTimeout:null,acceptOnFirstVisit:!1,onInserted:null,onClosed:null,delayBeforeClose:null,fadeOutDurationMs:2000};this.options=this.default_options;this.script_el=script_el_invoker;if(this.script_el){var data_options=Utils.get_data_attribs(this.script_el);this.options=Utils.merge(this.options,data_options)} 15if(opts){opts=Utils.normalize_keys(opts);this.options=Utils.merge(this.options,opts)} 16global_instance_name=this.options.instance;this.options.zindex=parseInt(this.options.zindex,10);this.options.mask=Utils.str2bool(this.options.mask);this.options.closePrecedes=Utils.str2bool(this.options.closePrecedes);if('string'===typeof this.options.expires){if('function'===typeof context[this.options.expires]){this.options.expires=context[this.options.expires]}else{if(Utils.is_numeric(this.options.expires)){this.options.expires=Number(parseFloat(this.options.expires))}}} 17if('function'===typeof this.options.expires){this.options.expires=this.options.expires()} 18if(this.script_el){this.run()}},log:function(){if('undefined'!==typeof console){console.log.apply(console,arguments)}/* eslint-enable no-console */},run:function(){if(!this.agreed()){var self=this;contentLoaded(win,function(){self.insert()})}},build_viewport_mask:function(){var mask=null;if(!0===this.options.mask){var mask_opacity=this.options.maskOpacity;var bg=this.options.maskBackground;var mask_markup='<div id="cookiebanner-mask" style="'+'position:fixed;top:0;left:0;width:100%;height:100%;'+'background:'+bg+';zoom:1;filter:alpha(opacity='+(mask_opacity*100)+');opacity:'+mask_opacity+';'+'z-index:'+this.options.zindex+';"></div>';var el=doc.createElement('div');el.innerHTML=mask_markup;mask=el.firstChild} 19return mask},agree:function(){this.cookiejar.set(this.options.cookie,1,this.options.expires,this.options.cookiePath,(this.options.cookieDomain!==''?this.options.cookieDomain:''),(this.options.cookieSecure?!0:!1));return!0},agreed:function(){return this.cookiejar.has(this.options.cookie)},close:function(){if('fade'===this.options.effect){Utils.fade_out(this.element,this.options.fadeOutDurationMs);this.closed=!0}else{if(this.inserted){if(!this.closed){if(this.element){this.element.parentNode.removeChild(this.element)} 20if(this.element_mask){this.element_mask.parentNode.removeChild(this.element_mask)} 21this.closed=!0} 22this.closed=!0;var handler=this.options.onClosed;if(handler&&typeof handler==='function'){handler(this)}}} 23return this.closed},agree_and_close:function(){if(!this.options.debug){this.agree()} 24if(this.options.delayBeforeClose&&!isNaN(parseFloat(this.options.delayBeforeClose))&&isFinite(this.options.delayBeforeClose)){var self_=this;setTimeout(function(){self_.close()},this.options.delayBeforeClose)}else{return this.close()}},cleanup:function(){this.close();return this.unload()},unload:function(){if(this.script_el){this.script_el.parentNode.removeChild(this.script_el)} 25context[global_instance_name]=undefined;return!0},insert:function(){this.element_mask=this.build_viewport_mask();var zidx=this.options.zindex;if(this.element_mask){zidx+=1} 26var el=doc.createElement('div');el.className='cookiebanner';el.style.position='fixed';el.style.left=0;el.style.right=0;el.style.height=this.options.height;el.style.minHeight=this.options.minHeight;el.style.zIndex=zidx;el.style.background=this.options.bg;el.style.color=this.options.fg;el.style.lineHeight=el.style.minHeight;el.style.padding=this.options.padding;el.style.fontFamily=this.options.fontFamily;el.style.fontSize=this.options.fontSize;el.style.textAlign=this.options.textAlign;if('top'===this.options.position){el.style.top=0}else{el.style.bottom=0} 27var closeHtml='<div class="cookiebanner-close" style="'+this.options.closeStyle+'">'+this.options.closeText+'</div>';var cssClass='';if(this.options.moreinfoClass!==null){cssClass=' class="'+this.options.moreinfoClass+'" '} 28var messageHtml='<span>
28'+this.options.message+(this.options.linkmsg?' <a'+cssClass+'>'+this.options.linkmsg+'</a>':'')+'</span>';if(this.options.closePrecedes){el.innerHTML=closeHtml+messageHtml}else{el.innerHTML=messageHtml+closeHtml} 29this.element=el;var el_a;if(this.options.moreinfoClass!==null){el_a=el.getElementsByClassName(this.options.moreinfoClass)[0]}else{el_a=el.getElementsByTagName('a')[0]} 30if(el_a){el_a.href=this.options.moreinfo;el_a.target=this.options.moreinfoTarget;if(this.options.moreinfoRel&&''!==this.options.moreinfoRel){el_a.rel=this.options.moreinfoRel} 31el_a.style.textDecoration=this.options.moreinfoDecoration;el_a.style.color=this.options.link;el_a.style.fontWeight=this.options.moreinfoFontWeight;if(''!==this.options.moreinfoFontSize){el_a.style.fontSize=this.options.moreinfoFontSize}} 32var el_x=el.getElementsByTagName('div')[0];el_x.style.cursor='pointer';function on(el,ev,fn){var add=el.addEventListener?'addEventListener':'attachEvent',pre=el.addEventListener?'':'on';el[add](pre+ev,fn,!1)} 33var self=this;on(el_x,'click',function(){self.agree_and_close()});if(this.element_mask){on(this.element_mask,'click',function(){self.agree_and_close()});doc.body.appendChild(this.element_mask)} 34if(this.options.acceptOnScroll){on(window,'scroll',function(){self.agree_and_close()})} 35if(this.options.acceptOnClick){on(window,'click',function(){self.agree_and_close()})} 36if(this.options.acceptOnTimeout){if(!isNaN(parseFloat(this.options.acceptOnTimeout))&&isFinite(this.options.acceptOnTimeout)){setTimeout(function(){self.agree_and_close()},this.options.acceptOnTimeout)}} 37if(this.options.acceptOnFirstVisit){self.agree()} 38doc.body.appendChild(this.element);this.inserted=!0;var handler=this.options.onInserted;if(handler&&typeof handler==='function'){handler(this)} 39if('fade'===this.options.effect){this.element.style.opacity=0;Utils.fade_in(this.element)}else{this.element.style.opacity=1}}};if(script_el_invoker){if(!context[global_instance_name]){context[global_instance_name]=new Cookiebanner()}}})(window);
vendor: 179,408 bytes, line 39
39!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).leaflet={})}(this,function(t){"use strict";function l(t){for(var e,i,n=1,o=arguments.length;n<o;n++)for(e in i=arguments[n])t[e]=i[e];return t}var R=Object.create||function(t){return N.prototype=t,new N};function N(){}function a(t,e){var i,n=Array.prototype.slice;return t.bind?t.bind.apply(t,n.call(arguments,1)):(i=n.call(arguments,2),function(){return t.apply(e,i.length?i.concat(n.call(arguments)):arguments)})}var D=0;function h(t){return"_leaflet_id"in t||(t._leaflet_id=++D),t._leaflet_id}function j(t,e,i){var n,o,s=function(){n=!1,o&&(r.apply(i,o),o=!1)},r=function(){n?o=arguments:(t.apply(i,arguments),setTimeout(s,e),n=!0)};return r}function H(t,e,i){var n=e[1],e=e[0],o=n-e;return t===n&&i?t:((t-e)%o+o)%o+e}function u(){return!1}function i(t,e){return!1===e?t:(e=Math.pow(10,void 0===e?6:e),Math.round(t*e)/e)}function W(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function F(t){return W(t).split(/\s+/)}function c(t,e){for(var i in Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?R(t.options):{}),e)t.options[i]=e[i];return t.options}function U(t,e,i){var n,o=[];for(n in t)o.push(encodeURIComponent(i?n.toUpperCase():n)+"="+encodeURIComponent(t[n]));return(e&&-1!==e.indexOf("?")?"&":"?")+o.join("&")}var V=/\{ *([\w_ -]+) *\}/g;function q(t,i){return t.replace(V,function(t,e){e=i[e];if(void 0===e)throw new Error("No value provided for variable "+t);return e="function"==typeof e?e(i):e})}var d=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function G(t,e){for(var i=0;i<t.length;i++)if(t[i]===e)return i;return-1}var K="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function Y(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var X=0;function J(t){var e=+new Date,i=Math.max(0,16-(e-X));return X=e+i,window.setTimeout(t,i)}var $=window.requestAnimationFrame||Y("RequestAnimationFrame")||J,Q=window.cancelAnimationFrame||Y("CancelAnimationFrame")||Y("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function x(t,e,i){if(!i||$!==J)return $.call(window,a(t,e));t.call(e)}function r(t){t&&Q.call(window,t)}var tt={__proto__:null,extend:l,create:R,bind:a,get lastId(){return D},stamp:h,throttle:j,wrapNum:H,falseFn:u,formatNum:i,trim:W,splitWords:F,setOptions:c,getParamString:U,template:q,isArray:d,indexOf:G,emptyImageUrl:K,requestFn:$,cancelFn:Q,requestAnimFrame:x,cancelAnimFrame:r};function et(){}et.extend=function(t){function e(){c(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()}var i,n=e.__super__=this.prototype,o=R(n);for(i in(o.constructor=e).prototype=o,this)Object.prototype.hasOwnProperty.call(this,i)&&"prototype"!==i&&"__super__"!==i&&(e[i]=this[i]);if(t.statics&&l(e,t.statics),t.includes){var s=t.includes;if("undefined"!=typeof L&&L&&L.Mixin){s=d(s)?s:[s];for(var r=0;r<s.length;r++)s[r]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",(new Error).stack)}l.apply(null,[o].concat(t.includes))}return l(o,t),delete o.statics,delete o.includes,o.options&&(o.options=n.options?R(n.options):{},l(o.options,t.options)),o._initHooks=[],o.callInitHooks=function(){if(!this._initHooksCalled){n.callInitHooks&&n.callInitHooks.call(this),this._initHooksCalled=!0;for(var t=0,e=o._initHooks.length;t<e;t++)o._initHooks[t].call(this)}},e},et.include=function(t){var e=this.prototype.options;return l(this.prototype,t),t.options&&(this.prototype.options=e,this.mergeOptions(t.options)),this},et.mergeOptions=function(t){return l(this.prototype.options,t),this},et.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i),this};var e={on:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e);else for(var o=0,s=(t=F(t)).length;o<s;o++)this._on(t[o],e,i);return this},off:function(t,e,i){if(arguments.length)if("object"==typeof t)for(var n in t)this._off(n,t[n],e);else{t=F(t);for(var o=1===arguments.length,s=0,r=t.length;s<r;s++)o?this._off(t[s]):this._off(t[s],e,i)}else delete this._events;return this},_on:function(t,e,i,n){"function"!=typeof e?console.warn("wrong listener type: "+typeof e):!1===this._listens(t,e,i)&&(e={fn:e,ctx:i=i===this?void 0:i},n&&(e.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(e))},_off:function(t,e,i){var n,o,s;if(this._events&&(n=this._events[t]))if(1===arguments.length){if(this._firingCount)for(o=0,s=n.length;o<s;o++)n[o].fn=u;delete this._events[t]}else"function"!=typeof e?console.warn("wrong listener type: "+typeof e):!1!==(e=this._listens(t,e,i))&&(i=n[e],this._firingCount&&(i.fn=u,this._events[t]=n=n.slice()),n.splice(e,1))},fire:function(t,e,i){if(this.listens(t,i)){var n=l({},e,{type:t,target:this,sourceTarget:e&&e.sourceTarget||this});if(this._events){var o=this._events[t];if(o){this._firingCount=this._firingCount+1||1;for(var s=0,r=o.length;s<r;s++){var a=o[s],h=a.fn;a.once&&this.off(t,h,a.ctx),h.call(a.ctx||this,n)}this._firingCount--}}i&&this._propagateEvent(n)}return this},listens:function(t,e,i,n){"string"!=typeof t&&console.warn('"string" type argument expected');var o=e,s=("function"!=typeof e&&(n=!!e,i=o=void 0),this._events&&this._events[t]);if(s&&s.length&&!1!==this._listens(t,o,i))return!0;if(n)for(var r in this._eventParents)if(this._eventParents[r].listens(t,e,i,n))return!0;return!1},_listens:function(t,e,i){if(this._events){var n=this._events[t]||[];if(!e)return!!n.length;i===this&&(i=void 0);for(var o=0,s=n.length;o<s;o++)if(n[o].fn===e&&n[o].ctx===i)return o}return!1},once:function(t,e,i){if("object"==typeof t)for(var n in t)this._on(n,t[n],e,!0);else for(var o=0,s=(t=F(t)).length;o<s;o++)this._on(t[o],e,i,!0);return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[h(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[h(t)],this},_propagateEvent:function(t){for(var e in this._eventParents)this._eventParents[e].fire(t.type,l({layer:t.target,propagatedFrom:t.target},t),!0)}},it=(e.addEventListener=e.on,e.removeEventListener=e.clearAllEventListeners=e.off,e.addOneTimeEventListener=e.once,e.fireEvent=e.fire,e.hasEventListeners=e.listens,et.extend(e));function p(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e}var nt=Math.trunc||function(t){return 0<t?Math.floor(t):Math.ceil(t)};function m(t,e,i){return t instanceof p?t:d(t)?new p(t[0],t[1]):null==t?t:"object"==typeof t&&"x"in t&&"y"in t?new p(t.x,t.y):new p(t,e,i)}function f(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function _(t,e){return!t||t instanceof f?t:new f(t,e)}function s(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;n<o;n++)this.extend(i[n])}function g(t,e){return t instanceof s?t:new s(t,e)}function v(t,e,i){if(isNaN(t)||isNaN(e))throw new Error("Invalid LatLng object: ("+t+", "+e+")");this.lat=+t,this.lng=+e,void 0!==i&&(this.alt=+i)}function w(t,e,i){return t instanceof v?t:d(t)&&"object"!=typeof t[0]?3===t.length?new v(t[0],t[1],t[2]):2===t.length?new v(t[0],t[1]):null:null==t?t:"object"==typeof t&&"lat"in t?new v(t.lat,"lng"in t?t.lng:t.lon,t.alt):void 0===e?null:new v(t,e,i)}p.prototype={clone:function(){return new p(this.x,this.y)},add:function(t){return this.clone()._add(m(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(m(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new p(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new p(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=nt(this.x),this.y=nt(this.y),this},distanceTo:function(t){var e=(t=m(t)).x-this.x,t=t.y-this.y;return Math.sqrt(e*e+t*t)},equals:function(t){return(t=m(t)).x===this.x&&t.y===this.y},contains:function(t){return t=m(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+i(this.x)+", "+i(this.y)+")"}},f.prototype={extend:function(t){var e,i;if(t){if(t instanceof p||"number"==typeof t[0]||"x"in t)e=i=m(t);else if(e=(t=_(t)).min,i=t.max,!e||!i)return this;this.min||this.max?(this.min.x=Math.min(e.x,this.min.x),this.max.x=Math.max(i.x,this.max.x),this.min.y=Math.min(e.y,this.min.y),this.max.y=Math.max(i.y,this.max.y)):(this.min=e.clone(),this.max=i.clone())}return this},getCenter:function(t){return m((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return m(this.min.x,this.max.y)},getTopRight:function(){return m(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return(t=("number"==typeof t[0]||t instanceof p?m:_)(t))instanceof f?(e=t.min,i=t.max):e=i=t,e.x>=this.min.x&&i.x<=this.max.x&&e.y>=this.min.y&&i.y<=this.max.y},intersects:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>=e.x&&n.x<=i.x,t=t.y>=e.y&&n.y<=i.y;return o&&t},overlaps:function(t){t=_(t);var e=this.min,i=this.max,n=t.min,t=t.max,o=t.x>e.x&&n.x<i.x,t=t.y>e.y&&n.y<i.y;return o&&t},isValid:function(){return!(!this.min||!this.max)},pad:function(t){var e=this.min,i=this.max,n=Math.abs(e.x-i.x)*t,t=Math.abs(e.y-i.y)*t;return _(m(e.x-n,e.y-t),m(i.x+n,i.y+t))},equals:function(t){return!!t&&(t=_(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight()))}},s.prototype={extend:function(t){var e,i,n=this._southWest,o=this._northEast;if(t instanceof v)i=e=t;else{if(!(t instanceof s))return t?this.extend(w(t)||g(t)):this;if(e=t._southWest,i=t._northEast,!e||!i)return this}return n||o?(n.lat=Math.min(e.lat,n.lat),n.lng=Math.min(e.lng,n.lng),o.lat=Math.max(i.lat,o.lat),o.lng=Math.max(i.lng,o.lng)):(this._southWest=new v(e.lat,e.lng),this._northEast=new v(i.lat,i.lng)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,t=Math.abs(e.lng-i.lng)*t;return new s(new v(e.lat-n,e.lng-t),new v(i.lat+n,i.lng+t))},getCenter:function(){return new v((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new v(this.getNorth(),this.getWest())},getSouthEast:function(){return new v(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){t=("number"==typeof t[0]||t instanceof v||"lat"in t?w:g)(t);var e,i,n=this._southWest,o=this._northEast;return t instanceof s?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=o.lat&&e.lng>=n.lng&&i.lng<=o.lng},intersects:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>=e.lat&&n.lat<=i.lat,t=t.lng>=e.lng&&n.lng<=i.lng;return o&&t},overlaps:function(t){t=g(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),t=t.getNorthEast(),o=t.lat>e.lat&&n.lat<i.lat,t=t.lng>e.lng&&n.lng<i.lng;return o&&t},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,e){return!!t&&(t=g(t),this._southWest.equals(t.getSouthWest(),e)&&this._northEast.equals(t.getNorthEast(),e))},isValid:function(){return!(!this._southWest||!this._northEast)}};var ot={latLngToPoint:function(t,e){t=this.projection.project(t),e=this.scale(e);return this.transformation._transform(t,e)},pointToLatLng:function(t,e){e=this.scale(e),t=this.transformation.untransform(t,e);return this.projection.unproject(t)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){var e;return this.infinite?null:(e=this.projection.bounds,t=this.scale(t),new f(this.transformation.transform(e.min,t),this.transformation.transform(e.max,t)))},infinite:!(v.prototype={equals:function(t,e){return!!t&&(t=w(t),Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng))<=(void 0===e?1e-9:e))},toString:function(t){return"LatLng("+i(this.lat,t)+", "+i(this.lng,t)+")"},distanceTo:function(t){return st.distance(this,w(t))},wrap:function(){return st.wrapLatLng(this)},toBounds:function(t){var t=180*t/40075017,e=t/Math.cos(Math.PI/180*this.lat);return g([this.lat-t,this.lng-e],[this.lat+t,this.lng+e])},clone:function(){return new v(this.lat,this.lng,this.alt)}}),wrapLatLng:function(t){var e=this.wrapLng?H(t.lng,this.wrapLng,!0):t.lng;return new v(this.wrapLat?H(t.lat,this.wrapLat,!0):t.lat,e,t.alt)},wrapLatLngBounds:function(t){var e=t.getCenter(),i=this.wrapLatLng(e),n=e.lat-i.lat,e=e.lng-i.lng;return 0==n&&0==e?t:(i=t.getSouthWest(),t=t.getNorthEast(),new s(new v(i.lat-n,i.lng-e),new v(t.lat-n,t.lng-e)))}},st=l({},ot,{wrapLng:[-180,180],R:6371e3,distance:function(t,e){var i=Math.PI/180,n=t.lat*i,o=e.lat*i,s=Math.sin((e.lat-t.lat)*i/2),e=Math.sin((e.lng-t.lng)*i/2),t=s*s+Math.cos(n)*Math.cos(o)*e*e,i=2*Math.atan2(Math.sqrt(t),Math.sqrt(1-t));return this.R*i}}),rt=6378137,rt={R:rt,MAX_LATITUDE:85.0511287798,project:function(t){var e=Math.PI/180,i=this.MAX_LATITUDE,i=Math.max(Math.min(i,t.lat),-i),i=Math.sin(i*e);return new p(this.R*t.lng*e,this.R*Math.log((1+i)/(1-i))/2)},unproject:function(t){var e=180/Math.PI;return new v((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*e,t.x*e/this.R)},bounds:new f([-(rt=rt*Math.PI),-rt],[rt,rt])};function at(t,e,i,n){d(t)?(this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3]):(this._a=t,this._b=e,this._c=i,this._d=n)}function ht(t,e,i,n){return new at(t,e,i,n)}at.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return t.x=(e=e||1)*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return new p((t.x/(e=e||1)-this._b)/this._a,(t.y/e-this._d)/this._c)}};var lt=l({},st,{code:"EPSG:3857",projection:rt,transformation:ht(lt=.5/(Math.PI*rt.R),.5,-lt,.5)}),ut=l({},lt,{code:"EPSG:900913"});function ct(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function dt(t,e){for(var i,n,o,s,r="",a=0,h=t.length;a<h;a++){for(i=0,n=(o=t[a]).length;i<n;i++)r+=(i?"L":"M")+(s=o[i]).x+" "+s.y;r+=e?b.svg?"z":"x":""}return r||"M0 0"}var _t=document.documentElement.style,pt="ActiveXObject"in window,mt=pt&&!document.addEventListener,n="msLaunchUri"in navigator&&!("documentMode"in document),ft=y("webkit"),gt=y("android"),vt=y("android 2")||y("android 3"),yt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),yt=gt&&y("Google")&&yt<537&&!("AudioNode"in window),xt=!!window.opera,wt=!n&&y("chrome"),bt=y("gecko")&&!ft&&!xt&&!pt,Pt=!wt&&y("safari"),Lt=y("phantom"),o="OTransition"in _t,Tt=0===navigator.platform.indexOf("Win"),Mt=pt&&"transition"in _t,zt="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!vt,_t="MozPerspective"in _t,Ct=!window.L_DISABLE_3D&&(Mt||zt||_t)&&!o&&!Lt,Zt="undefined"!=typeof orientation||y("mobile"),St=Zt&&ft,Et=Zt&&zt,kt=!window.PointerEvent&&window.MSPointerEvent,Ot=!(!window.PointerEvent&&!kt),At="ontouchstart"in window||!!window.TouchEvent,Bt=!window.L_NO_TOUCH&&(At||Ot),It=Zt&&xt,Rt=Zt&&bt,Nt=1<(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI),Dt=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",u,e),window.removeEventListener("testPassiveEventSupport",u,e)}catch(t){}return t}(),jt=!!document.createElement("canvas").getContext,Ht=!(!document.createElementNS||!ct("svg").createSVGRect),Wt=!!Ht&&((Wt=document.createElement("div")).innerHTML="<svg/>","http://www.w3.org/2000/svg"===(Wt.firstChild&&Wt.firstChild.namespaceURI));function y(t){return 0<=navigator.userAgent.toLowerCase().indexOf(t)}var b={ie:pt,ielt9:mt,edge:n,webkit:ft,android:gt,android23:vt,androidStock:yt,opera:xt,chrome:wt,gecko:bt,safari:Pt,phantom:Lt,opera12:o,win:Tt,ie3d:Mt,webkit3d:zt,gecko3d:_t,any3d:Ct,mobile:Zt,mobileWebkit:St,mobileWebkit3d:Et,msPointer:kt,pointer:Ot,touch:Bt,touchNative:At,mobileOpera:It,mobileGecko:Rt,retina:Nt,passiveEvents:Dt,canvas:jt,svg:Ht,vml:!Ht&&function(){try{var t=document.createElement("div"),e=(t.innerHTML='<v:shape adj="1"/>',t.firstChild);return e.style.behavior="url(#default#VML)",e&&"object"==typeof e.adj}catch(t){return!1}}(),inlineSvg:Wt,mac:0===navigator.platform.indexOf("Mac"),linux:0===navigator.platform.indexOf("Linux")},Ft=b.msPointer?"MSPointerDown":"pointerdown",Ut=b.msPointer?"MSPointerMove":"pointermove",Vt=b.msPointer?"MSPointerUp":"pointerup",qt=b.msPointer?"MSPointerCancel":"pointercancel",Gt={touchstart:Ft,touchmove:Ut,touchend:Vt,touchcancel:qt},Kt={touchstart:function(t,e){e.MSPOINTER_TYPE_TOUCH&&e.pointerType===e.MSPOINTER_TYPE_TOUCH&&O(e);ee(t,e)},touchmove:ee,touchend:ee,touchcancel:ee},Yt={},Xt=!1;function Jt(t,e,i){return"touchstart"!==e||Xt||(document.addEventListener(Ft,$t,!0),document.addEventListener(Ut,Qt,!0),document.addEventListener(Vt,te,!0),document.addEventListener(qt,te,!0),Xt=!0),Kt[e]?(i=Kt[e].bind(this,i),t.addEventListener(Gt[e],i,!1),i):(console.warn("wrong event specified:",e),u)}function $t(t){Yt[t.pointerId]=t}function Qt(t){Yt[t.pointerId]&&(Yt[t.pointerId]=t)}function te(t){delete Yt[t.pointerId]}function ee(t,e){if(e.pointerType!==(e.MSPOINTER_TYPE_MOUSE||"mouse")){for(var i in e.touches=[],Yt)e.touches.push(Yt[i]);e.changedTouches=[e],t(e)}}var ie=200;function ne(t,i){t.addEventListener("dblclick",i);var n,o=0;function e(t){var e;1!==t.detail?n=t.detail:"mouse"===t.pointerType||t.sourceCapabilities&&!t.sourceCapabilities.firesTouchEvents||((e=Ne(t)).some(function(t){return t instanceof HTMLLabelElement&&t.attributes.for})&&!e.some(function(t){return t instanceof HTMLInputElement||t instanceof HTMLSelectElement})||((e=Date.now())-o<=ie?2===++n&&i(function(t){var e,i,n={};for(i in t)e=t[i],n[i]=e&&e.bind?e.bind(t):e;return(t=n).type="dblclick",n.detail=2,n.isTrusted=!1,n._simulated=!0,n}(t)):n=1,o=e))}return t.addEventListener("click",e),{dblclick:i,simDblclick:e}}var oe,se,re,ae,he,le,ue=we(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),ce=we(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),de="webkitTransition"===ce||"OTransition"===ce?ce+"End":"transitionend";function _e(t){return"string"==typeof t?document.getElementById(t):t}function pe(t,e){var i=t.style[e]||t.currentStyle&&t.currentStyle[e];return"auto"===(i=i&&"auto"!==i||!document.defaultView?i:(t=document.defaultView.getComputedStyle(t,null))?t[e]:null)?null:i}function P(t,e,i){t=document.createElement(t);return t.className=e||"",i&&i.appendChild(t),t}function T(t){var e=t.parentNode;e&&e.removeChild(t)}function me(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function fe(t){var e=t.parentNode;e&&e.lastChild!==t&&e.appendChild(t)}function ge(t){var e=t.parentNode;e&&e.firstChild!==t&&e.insertBefore(t,e.firstChild)}function ve(t,e){return void 0!==t.classList?t.classList.contains(e):0<(t=xe(t)).length&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(t)}function M(t,e){var i;if(void 0!==t.classList)for(var n=F(e),o=0,s=n.length;o<s;o++)t.classList.add(n[o]);else ve(t,e)||ye(t,((i=xe(t))?i+" ":"")+e)}function z(t,e){void 0!==t.classList?t.classList.remove(e):ye(t,W((" "+xe(t)+" ").replace(" "+e+" "," ")))}function ye(t,e){void 0===t.className.baseVal?t.className=e:t.className.baseVal=e}function xe(t){return void 0===(t=t.correspondingElement?t.correspondingElement:t).className.baseVal?t.className:t.className.baseVal}function C(t,e){if("opacity"in t.style)t.style.opacity=e;else if("filter"in t.style){var i=!1,n="DXImageTransform.Microsoft.Alpha";try{i=t.filters.item(n)}catch(t){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}}function we(t){for(var e=document.documentElement.style,i=0;i<t.length;i++)if(t[i]in e)return t[i];return!1}function be(t,e,i){e=e||new p(0,0);t.style[ue]=(b.ie3d?"translate("+e.x+"px,"+e.y+"px)":"translate3d("+e.x+"px,"+e.y+"px,0)")+(i?" scale("+i+")":"")}function Z(t,e){t._leaflet_pos=e,b.any3d?be(t,e):(t.style.left=e.x+"px",t.style.top=e.y+"px")}function Pe(t){return t._leaflet_pos||new p(0,0)}function Le(){S(window,"dragstart",O)}function Te(){k(window,"dragstart",O)}function Me(t){for(;-1===t.tabIndex;)t=t.parentNode;t.style&&(ze(),le=(he=t).style.outlineStyle,t.style.outlineStyle="none",S(window,"keydown",ze))}function ze(){he&&(he.style.outlineStyle=le,le=he=void 0,k(window,"keydown",ze))}function Ce(t){for(;!((t=t.parentNode).offsetWidth&&t.offsetHeight||t===document.body););return t}function Ze(t){var e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}ae="onselectstart"in document?(re=function(){S(window,"selectstart",O)},function(){k(window,"selectstart",O)}):(se=we(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]),re=function(){var t;se&&(t=document.documentElement.style,oe=t[se],t[se]="none")},function(){se&&(document.documentElement.style[se]=oe,oe=void 0)});pt={__proto__:null,TRANSFORM:ue,TRANSITION:ce,TRANSITION_END:de,get:_e,getStyle:pe,create:P,remove:T,empty:me,toFront:fe,toBack:ge,hasClass:ve,addClass:M,removeClass:z,setClass:ye,getClass:xe,setOpacity:C,testProp:we,setTransform:be,setPosition:Z,getPosition:Pe,get disableTextSelection(){return re},get enableTextSelection(){return ae},disableImageDrag:Le,enableImageDrag:Te,preventOutline:Me,restoreOutline:ze,getSizedParentNode:Ce,getScale:Ze};function S(t,e,i,n){if(e&&"object"==typeof e)for(var o in e)ke(t,o,e[o],i);else for(var s=0,r=(e=F(e)).length;s<r;s++)ke(t,e[s],i,n);return this}var E="_leaflet_events";function k(t,e,i,n){if(1===arguments.length)Se(t),delete t[E];else if(e&&"object"==typeof e)for(var o in e)Oe(t,o,e[o],i);else if(e=F(e),2===arguments.length)Se(t,function(t){return-1!==G(e,t)});else for(var s=0,r=e.length;s<r;s++)Oe(t,e[s],i,n);return this}function Se(t,e){for(var i in t[E]){var n=i.split(/\d/)[0];e&&!e(n)||Oe(t,n,null,null,i)}}var Ee={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function ke(e,t,i,n){var o,s,r=t+h(i)+(n?"_"+h(n):"");e[E]&&e[E][r]||(s=o=function(t){return i.call(n||e,t||window.event)},!b.touchNative&&b.pointer&&0===t.indexOf("touch")?o=Jt(e,t,o):b.touch&&"dblclick"===t?o=ne(e,o):"addEventListener"in e?"touchstart"===t||"touchmove"===t||"wheel"===t||"mousewheel"===t?e.addEventListener(Ee[t]||t,o,!!b.passiveEvents&&{passive:!1}):"mouseenter"===t||"mouseleave"===t?e.addEventListener(Ee[t],o=function(t){t=t||window.event,We(e,t)&&s(t)},!1):e.addEventListener(t,s,!1):e.attachEvent("on"+t,o),e[E]=e[E]||{},e[E][r]=o)}function Oe(t,e,i,n,o){o=o||e+h(i)+(n?"_"+h(n):"");var s,r,i=t[E]&&t[E][o];i&&(!b.touchNative&&b.pointer&&0===e.indexOf("touch")?(n=t,r=i,Gt[s=e]?n.removeEventListener(Gt[s],r,!1):console.warn("wrong event specified:",s)):b.touch&&"dblclick"===e?(n=i,(r=t).removeEventListener("dblclick",n.dblclick),r.removeEventListener("click",n.simDblclick)):"removeEventListener"in t?t.removeEventListener(Ee[e]||e,i,!1):t.detachEvent("on"+e,i),t[E][o]=null)}function Ae(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function Be(t){return ke(t,"wheel",Ae),this}function Ie(t){return S(t,"mousedown touchstart dblclick contextmenu",Ae),t._leaflet_disable_click=!0,this}function O(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Re(t){return O(t),Ae(t),this}function Ne(t){if(t.composedPath)return t.composedPath();for(var e=[],i=t.target;i;)e.push(i),i=i.parentNode;return e}function De(t,e){var i,n;return e?(n=(i=Ze(e)).boundingClientRect,new p((t.clientX-n.left)/i.x-e.clientLeft,(t.clientY-n.top)/i.y-e.clientTop)):new p(t.clientX,t.clientY)}var je=b.linux&&b.chrome?window.devicePixelRatio:b.mac?3*window.devicePixelRatio:0<window.devicePixelRatio?2*window.devicePixelRatio:1;function He(t){return b.edge?t.wheelDeltaY/2:t.deltaY&&0===t.deltaMode?-t.deltaY/je:t.deltaY&&1===t.deltaMode?20*-t.deltaY:t.deltaY&&2===t.deltaMode?60*-t.deltaY:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?20*-t.detail:t.detail?t.detail/-32765*60:0}function We(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(t){return!1}return i!==t}var mt={__proto__:null,on:S,off:k,stopPropagation:Ae,disableScrollPropagation:Be,disableClickPropagation:Ie,preventDefault:O,stop:Re,getPropagationPath:Ne,getMousePosition:De,getWheelDelta:He,isExternalTarget:We,addListener:S,removeListener:k},Fe=it.extend({run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._duration=i||.25,this._easeOutPower=1/Math.max(n||.5,.2),this._startPos=Pe(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=x(this._animate,this),this._step()},_step:function(t){var e=+new Date-this._startTime,i=1e3*this._duration;e<i?this._runFrame(this._easeOut(e/i),t):(this._runFrame(1),this._complete())},_runFrame:function(t,e){t=this._startPos.add(this._offset.multiplyBy(t));e&&t._round(),Z(this._el,t),this.fire("step")},_complete:function(){r(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),A=it.extend({options:{crs:lt,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,e){e=c(this,e),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=a(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),void 0!==e.zoom&&(this._zoom=this._limitZoom(e.zoom)),e.center&&void 0!==e.zoom&&this.setView(w(e.center),e.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=ce&&b.any3d&&!b.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),S(this._proxy,de,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,e,i){if((e=void 0===e?this._zoom:this._limitZoom(e),t=this._limitCenter(w(t),e,this.options.maxBounds),i=i||{},this._stop(),this._loaded&&!i.reset&&!0!==i)&&(void 0!==i.animate&&(i.zoom=l({animate:i.animate},i.zoom),i.pan=l({animate:i.animate,duration:i.duration},i.pan)),this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,i.zoom):this._tryAnimatedPan(t,i.pan)))return clearTimeout(this._sizeTimer),this;return this._resetView(t,e,i.pan&&i.pan.noMoveStart),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=t,this)},zoomIn:function(t,e){return t=t||(b.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,e)},zoomOut:function(t,e){return t=t||(b.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),o=this.getSize().divideBy(2),t=(t instanceof p?t:this.latLngToContainerPoint(t)).subtract(o).multiplyBy(1-1/n),n=this.containerPointToLatLng(o.add(t));return this.setView(n,e,{zoom:i})},_getBoundsCenterZoom:function(t,e){e=e||{},t=t.getBounds?t.getBounds():g(t);var i=m(e.paddingTopLeft||e.padding||[0,0]),n=m(e.paddingBottomRight||e.padding||[0,0]),o=this.getBoundsZoom(t,!1,i.add(n));return(o="number"==typeof e.maxZoom?Math.min(e.maxZoom,o):o)===1/0?{center:t.getCenter(),zoom:o}:(e=n.subtract(i).divideBy(2),n=this.project(t.getSouthWest(),o),i=this.project(t.getNorthEast(),o),{center:this.unproject(n.add(i).divideBy(2).add(e),o),zoom:o})},fitBounds:function(t,e){if((t=g(t)).isValid())return t=this._getBoundsCenterZoom(t,e),this.setView(t.center,t.zoom,e);throw new Error("Bounds are not valid.")},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,e){return this.setView(t,this._zoom,{pan:e})},panBy:function(t,e){var i;return e=e||{},(t=m(t).round()).x||t.y?(!0===e.animate||this.getSize().contains(t)?(this._panAnim||(this._panAnim=new Fe,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate?(M(this._mapPane,"leaflet-pan-anim"),i=this._getMapPanePos().subtract(t).round(),this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)):(this._rawPanBy(t),this.fire("move").fire("moveend"))):this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this):this.fire("moveend")},flyTo:function(n,o,t){if(!1===(t=t||{}).animate||!b.any3d)return this.setView(n,o,t);this._stop();var s=this.project(this.getCenter()),r=this.project(n),e=this.getSize(),a=this._zoom,h=(n=w(n),o=void 0===o?a:o,Math.max(e.x,e.y)),i=h*this.getZoomScale(a,o),l=r.distanceTo(s)||1,u=1.42,c=u*u;function d(t){t=(i*i-h*h+(t?-1:1)*c*c*l*l)/(2*(t?i:h)*c*l),t=Math.sqrt(t*t+1)-t;return t<1e-9?-18:Math.log(t)}function _(t){return(Math.exp(t)-Math.exp(-t))/2}function p(t){return(Math.exp(t)+Math.exp(-t))/2}var m=d(0);function f(t){return h*(p(m)*(_(t=m+u*t)/p(t))-_(m))/c}var g=Date.now(),v=(d(1)-m)/u,y=t.duration?1e3*t.duration:1e3*v*.8;return this._moveStart(!0,t.noMoveStart),function t(){var e=(Date.now()-g)/y,i=(1-Math.pow(1-e,1.5))*v;e<=1?(this._flyToFrame=x(t,this),this._move(this.unproject(s.add(r.subtract(s).multiplyBy(f(i)/l)),a),this.getScaleZoom(h/(e=i,h*(p(m)/p(m+u*e))),a),{flyTo:!0})):this._move(n,o)._moveEnd(!0)}.call(this),this},flyToBounds:function(t,e){t=this._getBoundsCenterZoom(t,e);return this.flyTo(t.center,t.zoom,e)},setMaxBounds:function(t){return t=g(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var e=this.options.minZoom;return this.options.minZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var e=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&e!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,e){this._enforcingBounds=!0;var i=this.getCenter(),t=this._limitCenter(i,this._zoom,g(t));return i.equals(t)||this.panTo(t,e),this._enforcingBounds=!1,this},panInside:function(t,e){var i=m((e=e||{}).paddingTopLeft||e.padding||[0,0]),n=m(e.paddingBottomRight||e.padding||[0,0]),o=this.project(this.getCenter()),t=this.project(t),s=this.getPixelBounds(),i=_([s.min.add(i),s.max.subtract(n)]),s=i.getSize();return i.contains(t)||(this._enforcingBounds=!0,n=t.subtract(i.getCenter()),i=i.extend(t).getSize().subtract(s),o.x+=n.x<0?-i.x:i.x,o.y+=n.y<0?-i.y:i.y,this.panTo(this.unproject(o),e),this._enforcingBounds=!1),this},invalidateSize:function(t){if(!this._loaded)return this;t=l({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize(),i=(this._sizeChanged=!0,this._lastCenter=null,this.getSize()),n=e.divideBy(2).round(),o=i.divideBy(2).round(),n=n.subtract(o);return n.x||n.y?(t.animate&&t.pan?this.panBy(n):(t.pan&&this._rawPanBy(n),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(a(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){var e,i;return t=this._locateOptions=l({timeout:1e4,watch:!1},t),"geolocation"in navigator?(e=a(this._handleGeolocationResponse,this),i=a(this._handleGeolocationError,this),t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t)):this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e;this._container._leaflet_id&&(e=t.code,t=t.message||(1===e?"permission denied":2===e?"position unavailable":"timeout"),this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:e,message:"Geolocation error: "+t+"."}))},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var e,i,n=new v(t.coords.latitude,t.coords.longitude),o=n.toBounds(2*t.coords.accuracy),s=this._locateOptions,r=(s.setView&&(e=this.getBoundsZoom(o),this.setView(n,s.maxZoom?Math.min(e,s.maxZoom):e)),{latlng:n,bounds:o,timestamp:t.timestamp});for(i in t.coords)"number"==typeof t.coords[i]&&(r[i]=t.coords[i]);this.fire("locationfound",r)}},addHandler:function(t,e){return e&&(e=this[t]=new e(this),this._handlers.push(e),this.options[t]&&e.enable()),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch(t){this._container._leaflet_id=void 0,this._containerId=void 0}for(var t in void 0!==this._locationWatchId&&this.stopLocate(),this._stop(),T(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(r(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload"),this._layers)this._layers[t].remove();for(t in this._panes)T(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,e){e=P("div","leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),e||this._mapPane);return t&&(this._panes[t]=e),e},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds();return new s(this.unproject(t.getBottomLeft()),this.unproject(t.getTopRight()))},getMinZoom:function(){return void 0===this.options.minZoom?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return void 0===this.options.maxZoom?void 0===this._layersMaxZoom?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=g(t),i=m(i||[0,0]);var n=this.getZoom()||0,o=this.getMinZoom(),s=this.getMaxZoom(),r=t.getNorthWest(),t=t.getSouthEast(),i=this.getSize().subtract(i),t=_(this.project(t,n),this.project(r,n)).getSize(),r=b.any3d?this.options.zoomSnap:1,a=i.x/t.x,i=i.y/t.y,t=e?Math.max(a,i):Math.min(a,i),n=this.getScaleZoom(t,n);return r&&(n=Math.round(n/(r/100))*(r/100),n=e?Math.ceil(n/r)*r:Math.floor(n/r)*r),Math.max(o,Math.min(s,n))},getSize:function(){return this._size&&!this._sizeChanged||(this._size=new p(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,e){t=this._getTopLeftPoint(t,e);return new f(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(void 0===t?this.getZoom():t)},getPane:function(t){return"string"==typeof t?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,e){var i=this.options.crs;return e=void 0===e?this._zoom:e,i.scale(t)/i.scale(e)},getScaleZoom:function(t,e){var i=this.options.crs,t=(e=void 0===e?this._zoom:e,i.zoom(t*i.scale(e)));return isNaN(t)?1/0:t},project:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.latLngToPoint(w(t),e)},unproject:function(t,e){return e=void 0===e?this._zoom:e,this.options.crs.pointToLatLng(m(t),e)},layerPointToLatLng:function(t){t=m(t).add(this.getPixelOrigin());return this.unproject(t)},latLngToLayerPoint:function(t){return this.project(w(t))._round()._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(w(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(g(t))},distance:function(t,e){return this.options.crs.distance(w(t),w(e))},containerPointToLayerPoint:function(t){return m(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return m(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){t=this.containerPointToLayerPoint(m(t));return this.layerPointToLatLng(t)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(w(t)))},mouseEventToContainerPoint:function(t){return De(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){t=this._container=_e(t);if(!t)throw new Error("Map container not found.");if(t._leaflet_id)throw new Error("Map container is already initialized.");S(t,"scroll",this._onScroll,this),this._containerId=h(t)},_initLayout:function(){var t=this._container,e=(this._fadeAnimated=this.options.fadeAnimation&&b.any3d,M(t,"leaflet-container"+(b.touch?" leaflet-touch":"")+(b.retina?" leaflet-retina":"")+(b.ielt9?" leaflet-oldie":"")+(b.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":"")),pe(t,"position"));"absolute"!==e&&"relative"!==e&&"fixed"!==e&&"sticky"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),Z(this._mapPane,new p(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(M(t.markerPane,"leaflet-zoom-hide"),M(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,e,i){Z(this._mapPane,new p(0,0));var n=!this._loaded,o=(this._loaded=!0,e=this._limitZoom(e),this.fire("viewprereset"),this._zoom!==e);this._moveStart(o,i)._move(t,e)._moveEnd(o),this.fire("viewreset"),n&&this.fire("load")},_moveStart:function(t,e){return t&&this.fire("zoomstart"),e||this.fire("movestart"),this},_move:function(t,e,i,n){void 0===e&&(e=this._zoom);var o=this._zoom!==e;return this._zoom=e,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),n?i&&i.pinch&&this.fire("zoom",i):((o||i&&i.pinch)&&this.fire("zoom",i),this.fire("move",i)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return r(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){Z(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={};var e=t?k:S;e((this._targets[h(this._container)]=this)._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&e(window,"resize",this._onResize,this),b.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){r(this._resizeRequest),this._resizeRequest=x(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,e){for(var i,n=[],o="mouseout"===e||"mouseover"===e,s=t.target||t.srcElement,r=!1;s;){if((i=this._targets[h(s)])&&("click"===e||"preclick"===e)&&this._draggableMoved(i)){r=!0;break}if(i&&i.listens(e,!0)){if(o&&!We(s,t))break;if(n.push(i),o)break}if(s===this._container)break;s=s.parentNode}return n=n.length||r||o||!this.listens(e,!0)?n:[this]},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var e,i=t.target||t.srcElement;!this._loaded||i._leaflet_disable_events||"click"===t.type&&this._isClickDisabled(i)||("mousedown"===(e=t.type)&&Me(i),this._fireDOMEvent(t,e))},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,e,i){"click"===t.type&&((a=l({},t)).type="preclick",this._fireDOMEvent(a,a.type,i));var n=this._findEventTargets(t,e);if(i){for(var o=[],s=0;s<i.length;s++)i[s].listens(e,!0)&&o.push(i[s]);n=o.concat(n)}if(n.length){"contextmenu"===e&&O(t);var r,a=n[0],h={originalEvent:t};for("keypress"!==t.type&&"keydown"!==t.type&&"keyup"!==t.type&&(r=a.getLatLng&&(!a._radius||a._radius<=10),h.containerPoint=r?this.latLngToContainerPoint(a.getLatLng()):this.mouseEventToContainerPoint(t),h.layerPoint=this.containerPointToLayerPoint(h.containerPoint),h.latlng=r?a.getLatLng():this.layerPointToLatLng(h.layerPoint)),s=0;s<n.length;s++)if(n[s].fire(e,h,!0),h.originalEvent._stopped||!1===n[s].options.bubblingMouseEvents&&-1!==G(this._mouseEvents,e))return}},_draggableMoved:function(t){return(t=t.dragging&&t.dragging.enabled()?t:this).dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,e=this._handlers.length;t<e;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,{target:this}):this.on("load",t,e),this},_getMapPanePos:function(){return Pe(this._mapPane)||new p(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,e){return(t&&void 0!==e?this._getNewPixelOrigin(t,e):this.getPixelOrigin()).subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,e,i){i=this._getNewPixelOrigin(i,e);return this.project(t,e)._subtract(i)},_latLngBoundsToNewLayerBounds:function(t,e,i){i=this._getNewPixelOrigin(i,e);return _([this.project(t.getSouthWest(),e)._subtract(i),this.project(t.getNorthWest(),e)._subtract(i),this.project(t.getSouthEast(),e)._subtract(i),this.project(t.getNorthEast(),e)._subtract(i)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){var n,o;return!i||(n=this.project(t,e),o=this.getSize().divideBy(2),o=new f(n.subtract(o),n.add(o)),o=this._getBoundsOffset(o,i,e),Math.abs(o.x)<=1&&Math.abs(o.y)<=1)?t:this.unproject(n.add(o),e)},_limitOffset:function(t,e){var i;return e?(i=new f((i=this.getPixelBounds()).min.add(t),i.max.add(t)),t.add(this._getBoundsOffset(i,e))):t},_getBoundsOffset:function(t,e,i){e=_(this.project(e.getNorthEast(),i),this.project(e.getSouthWest(),i)),i=e.min.subtract(t.min),e=e.max.subtract(t.max);return new p(this._rebound(i.x,-e.x),this._rebound(i.y,-e.y))},_rebound:function(t,e){return 0<t+e?Math.round(t-e)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(e))},_limitZoom:function(t){var e=this.getMinZoom(),i=this.getMaxZoom(),n=b.any3d?this.options.zoomSnap:1;return n&&(t=Math.round(t/n)*n),Math.max(e,Math.min(i,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){z(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){t=this._getCenterOffset(t)._trunc();return!(!0!==(e&&e.animate)&&!this.getSize().contains(t))&&(this.panBy(t,e),!0)},_createAnimProxy:function(){var t=this._proxy=P("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(t){var e=ue,i=this._proxy.style[e];be(this._proxy,this.project(t.center,t.zoom),this.getZoomScale(t.zoom,1)),i===this._proxy.style[e]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){T(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),e=this.getZoom();be(this._proxy,this.project(t,e),this.getZoomScale(e,1))},_catchTransitionEnd:function(t){this._animatingZoom&&0<=t.propertyName.indexOf("transform")&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(!this._animatingZoom){if(i=i||{},!this._zoomAnimated||!1===i.animate||this._nothingToAnimate()||Math.abs(e-this._zoom)>this.options.zoomAnimationThreshold)return!1;var n=this.getZoomScale(e),n=this._getCenterOffset(t)._divideBy(1-1/n);if(!0!==i.animate&&!this.getSize().contains(n))return!1;x(function(){this._moveStart(!0,i.noMoveStart||!1)._animateZoom(t,e,!0)},this)}return!0},_animateZoom:function(t,e,i,n){this._mapPane&&(i&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=e,M(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:e,noUpdate:n}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(a(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&z(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function Ue(t){return new B(t)}var B=et.extend({options:{position:"topright"},initialize:function(t){c(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var e=this._map;return e&&e.removeControl(this),this.options.position=t,e&&e.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),t=t._controlCorners[i];return M(e,"leaflet-control"),-1!==i.indexOf("bottom")?t.insertBefore(e,t.firstChild):t.appendChild(e),this._map.on("unload",this.remove,this),this},remove:function(){return this._map&&(T(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null),this},_refocusOnMap:function(t){this._map&&t&&0<t.screenX&&0<t.screenY&&this._map.getContainer().focus()}}),Ve=(A.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var i=this._controlCorners={},n="leaflet-",o=this._controlContainer=P("div",n+"control-container",this._container);function t(t,e){i[t+e]=P("div",n+t+" "+n+e,o)}t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)T(this._controlCorners[t]);T(this._controlContainer),delete this._controlCorners,delete this._controlContainer}}),B.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,e,i,n){return i<n?-1:n<i?1:0}},initialize:function(t,e,i){for(var n in c(this,i),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1,t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){this._initLayout(),this._update(),(this._map=t).on("zoomend",this._checkDisabledLayers,this);for(var e=0;e<this._layers.length;e++)this._layers[e].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return B.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._map?this._update():this},addOverlay:function(t,e){return this._addLayer(t,e,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);t=this._getLayer(h(t));return t&&this._layers.splice(this._layers.indexOf(t),1),this._map?this._update():this},expand:function(){M(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(M(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):z(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return z(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=P("div",t),i=this.options.collapsed,n=(e.setAttribute("aria-haspopup",!0),Ie(e),Be(e),this._section=P("section",t+"-list")),o=(i&&(this._map.on("click",this.collapse,this),S(e,{mouseenter:this._expandSafely,mouseleave:this.collapse},this)),this._layersLink=P("a",t+"-toggle",e));o.href="#",o.title="Layers",o.setAttribute("role","button"),S(o,{keydown:function(t){13===t.keyCode&&this._expandSafely()},click:function(t){O(t),this._expandSafely()}},this),i||this.expand(),this._baseLayersList=P("div",t+"-base",n),this._separator=P("div",t+"-separator",n),this._overlaysList=P("div",t+"-overlays",n),e.appendChild(n)},_getLayer:function(t){for(var e=0;e<this._layers.length;e++)if(this._layers[e]&&h(this._layers[e].layer)===t)return this._layers[e]},_addLayer:function(t,e,i){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:e,overlay:i}),this.options.sortLayers&&this._layers.sort(a(function(t,e){return this.options.sortFunction(t.layer,e.layer,t.name,e.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(this._container){me(this._baseLayersList),me(this._overlaysList),this._layerControlInputs=[];for(var t,e,i,n=0,o=0;o<this._layers.length;o++)i=this._layers[o],this._addItem(i),e=e||i.overlay,t=t||!i.overlay,n+=i.overlay?0:1;this.options.hideSingleBase&&(this._baseLayersList.style.display=(t=t&&1<n)?"":"none"),this._separator.style.display=e&&t?"":"none"}return this},_onLayerChange:function(t){this._handlingClick||this._update();var e=this._getLayer(h(t.target)),t=e.overlay?"add"===t.type?"overlayadd":"overlayremove":"add"===t.type?"baselayerchange":null;t&&this._map.fire(t,e)},_createRadioElement:function(t,e){t='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(e?' checked="checked"':"")+"/>",e=document.createElement("div");return e.innerHTML=t,e.firstChild},_addItem:function(t){var e,i=document.createElement("label"),n=this._map.hasLayer(t.layer),n=(t.overlay?((e=document.createElement("input")).type="checkbox",e.className="leaflet-control-layers-selector",e.defaultChecked=n):e=this._createRadioElement("leaflet-base-layers_"+h(this),n),this._layerControlInputs.push(e),e.layerId=h(t.layer),S(e,"click",this._onInputClick,this),document.createElement("span")),o=(n.innerHTML=" "+t.name,document.createElement("span"));return i.appendChild(o),o.appendChild(e),o.appendChild(n),(t.overlay?this._overlaysList:this._baseLayersList).appendChild(i),this._checkDisabledLayers(),i},_onInputClick:function(){if(!this._preventClick){var t,e,i=this._layerControlInputs,n=[],o=[];this._handlingClick=!0;for(var s=i.length-1;0<=s;s--)t=i[s],e=this._getLayer(t.layerId).layer,t.checked?n.push(e):t.checked||o.push(e);for(s=0;s<o.length;s++)this._map.hasLayer(o[s])&&this._map.removeLayer(o[s]);for(s=0;s<n.length;s++)this._map.hasLayer(n[s])||this._map.addLayer(n[s]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t,e,i=this._layerControlInputs,n=this._map.getZoom(),o=i.length-1;0<=o;o--)t=i[o],e=this._getLayer(t.layerId).layer,t.disabled=void 0!==e.options.minZoom&&n<e.options.minZoom||void 0!==e.options.maxZoom&&n>e.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section,e=(this._preventClick=!0,S(t,"click",O),this.expand(),this);setTimeout(function(){k(t,"click",O),e._preventClick=!1})}})),qe=B.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=P("div",e+" leaflet-bar"),n=this.options;return this._zoomInButton=this._createButton(n.zoomInText,n.zoomInTitle,e+"-in",i,this._zoomIn),this._zoomOutButton=this._createButton(n.zoomOutText,n.zoomOutTitle,e+"-out",i,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,e,i,n,o){i=P("a",i,n);return i.innerHTML=t,i.href="#",i.title=e,i.setAttribute("role","button"),i.setAttribute("aria-label",e),Ie(i),S(i,"click",Re),S(i,"click",o,this),S(i,"click",this._refocusOnMap,this),i},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";z(this._zoomInButton,e),z(this._zoomOutButton,e),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),!this._disabled&&t._zoom!==t.getMinZoom()||(M(this._zoomOutButton,e),this._zoomOutButton.setAttribute("aria-disabled","true")),!this._disabled&&t._zoom!==t.getMaxZoom()||(M(this._zoomInButton,e),this._zoomInButton.setAttribute("aria-disabled","true"))}}),Ge=(A.mergeOptions({zoomControl:!0}),A.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new qe,this.addControl(this.zoomControl))}),B.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var e="leaflet-control-scale",i=P("div",e),n=this.options;return this._addScales(n,e+"-line",i),t.on(n.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),i},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,e,i){t.metric&&(this._mScale=P("div",e,i)),t.imperial&&(this._iScale=P("div",e,i))},_update:function(){var t=this._map,e=t.getSize().y/2,t=t.distance(t.containerPointToLatLng([0,e]),t.containerPointToLatLng([this.options.maxWidth,e]));this._updateScales(t)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var e=this._getRoundNum(t);this._updateScale(this._mScale,e<1e3?e+" m":e/1e3+" km",e/t)},_updateImperial:function(t){var e,i,t=3.2808399*t;5280<t?(i=this._getRoundNum(e=t/5280),this._updateScale(this._iScale,i+" mi",i/e)):(i=this._getRoundNum(t),this._updateScale(this._iScale,i+" ft",i/t))},_updateScale:function(t,e,i){t.style.width=Math.round(this.options.maxWidth*i)+"px",t.innerHTML=e},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),t=t/e;return e*(t=10<=t?10:5<=t?5:3<=t?3:2<=t?2:1)}})),Ke=B.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(b.inlineSvg?'<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg> ':"")+"Leaflet</a>"},initialize:function(t){c(this,t),this._attributions={}},onAdd:function(t){for(var e in(t.attributionControl=this)._container=P("div","leaflet-control-attribution"),Ie(this._container),t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t&&(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update()),this},removeAttribution:function(t){return t&&this._attributions[t]&&(this._attributions[t]--,this._update()),this},_update:function(){if(this._map){var t,e=[];for(t in this._attributions)this._attributions[t]&&e.push(t);var i=[];this.options.prefix&&i.push(this.options.prefix),e.length&&i.push(e.join(", ")),this._container.innerHTML=i.join(' <span aria-hidden="true">|</span> ')}}}),n=(A.mergeOptions({attributionControl:!0}),A.addInitHook(function(){this.options.attributionControl&&(new Ke).addTo(this)}),B.Layers=Ve,B.Zoom=qe,B.Scale=Ge,B.Attribution=Ke,Ue.layers=function(t,e,i){return new Ve(t,e,i)},Ue.zoom=function(t){return new qe(t)},Ue.scale=function(t){return new Ge(t)},Ue.attribution=function(t){return new Ke(t)},et.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled||(this._enabled=!0,this.addHooks()),this},disable:function(){return this._enabled&&(this._enabled=!1,this.removeHooks()),this},enabled:function(){return!!this._enabled}})),ft=(n.addTo=function(t,e){return t.addHandler(e,this),this},{Events:e}),Ye=b.touch?"touchstart mousedown":"mousedown",Xe=it.extend({options:{clickTolerance:3},initialize:function(t,e,i,n){c(this,n),this._element=t,this._dragStartTarget=e||t,this._preventOutline=i},enable:function(){this._enabled||(S(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(Xe._dragging===this&&this.finishDrag(!0),k(this._dragStartTarget,Ye,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){var e,i;this._enabled&&(this._moved=!1,ve(this._element,"leaflet-zoom-anim")||(t.touches&&1!==t.touches.length?Xe._dragging===this&&this.finishDrag():Xe._dragging||t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||((Xe._dragging=this)._preventOutline&&Me(this._element),Le(),re(),this._moving||(this.fire("down"),i=t.touches?t.touches[0]:t,e=Ce(this._element),this._startPoint=new p(i.clientX,i.clientY),this._startPos=Pe(this._element),this._parentScale=Ze(e),i="mousedown"===t.type,S(document,i?"mousemove":"touchmove",this._onMove,this),S(document,i?"mouseup":"touchend touchcancel",this._onUp,this)))))},_onMove:function(t){var e;this._enabled&&(t.touches&&1<t.touches.length?this._moved=!0:!(e=new p((e=t.touches&&1===t.touches.length?t.touches[0]:t).clientX,e.clientY)._subtract(this._startPoint)).x&&!e.y||Math.abs(e.x)+Math.abs(e.y)<this.options.clickTolerance||(e.x/=this._parentScale.x,e.y/=this._parentScale.y,O(t),this._moved||(this.fire("dragstart"),this._moved=!0,M(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),M(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(e),this._moving=!0,this._lastEvent=t,this._updatePosition()))},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),Z(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){z(document.body,"leaflet-dragging"),this._lastTarget&&(z(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),k(document,"mousemove touchmove",this._onMove,this),k(document,"mouseup touchend touchcancel",this._onUp,this),Te(),ae();var e=this._moved&&this._moving;this._moving=!1,Xe._dragging=!1,e&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function Je(t,e,i){for(var n,o,s,r,a,h,l,u=[1,4,2,8],c=0,d=t.length;c<d;c++)t[c]._code=si(t[c],e);for(s=0;s<4;s++){for(h=u[s],n=[],c=0,o=(d=t.length)-1;c<d;o=c++)r=t[c],a=t[o],r._code&h?a._code&h||((l=oi(a,r,h,e,i))._code=si(l,e),n.push(l)):(a._code&h&&((l=oi(a,r,h,e,i))._code=si(l,e),n.push(l)),n.push(r));t=n}return t}function $e(t,e){var i,n,o,s,r,a,h;if(!t||0===t.length)throw new Error("latlngs not passed");I(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);for(var l=w([0,0]),u=g(t),c=(u.getNorthWest().distanceTo(u.getSouthWest())*u.getNorthEast().distanceTo(u.getNorthWest())<1700&&(l=Qe(t)),t.length),d=[],_=0;_<c;_++){var p=w(t[_]);d.push(e.project(w([p.lat-l.lat,p.lng-l.lng])))}for(_=r=a=h=0,i=c-1;_<c;i=_++)n=d[_],o=d[i],s=n.y*o.x-o.y*n.x,a+=(n.x+o.x)*s,h+=(n.y+o.y)*s,r+=3*s;u=0===r?d[0]:[a/r,h/r],u=e.unproject(m(u));return w([u.lat+l.lat,u.lng+l.lng])}function Qe(t){for(var e=0,i=0,n=0,o=0;o<t.length;o++){var s=w(t[o]);e+=s.lat,i+=s.lng,n++}return w([e/n,i/n])}var ti,gt={__proto__:null,clipPolygon:Je,polygonCenter:$e,centroid:Qe};function ei(t,e){if(e&&t.length){var i=t=function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;n<s;n++)(function(t,e){var i=e.x-t.x,e=e.y-t.y;return i*i+e*e})(t[n],t[o])>e&&(i.push(t[n]),o=n);o<s-1&&i.push(t[s-1]);return i}(t,e=e*e),n=i.length,o=new(typeof Uint8Array!=void 0+""?Uint8Array:Array)(n);o[0]=o[n-1]=1,function t(e,i,n,o,s){var r,a,h,l=0;for(a=o+1;a<=s-1;a++)h=ri(e[a],e[o],e[s],!0),l<h&&(r=a,l=h);n<l&&(i[r]=1,t(e,i,n,o,r),t(e,i,n,r,s))}(i,o,e,0,n-1);var s,r=[];for(s=0;s<n;s++)o[s]&&r.push(i[s]);return r}return t.slice()}function ii(t,e,i){return Math.sqrt(ri(t,e,i,!0))}function ni(t,e,i,n,o){var s,r,a,h=n?ti:si(t,i),l=si(e,i);for(ti=l;;){if(!(h|l))return[t,e];if(h&l)return!1;a=si(r=oi(t,e,s=h||l,i,o),i),s===h?(t=r,h=a):(e=r,l=a)}}function oi(t,e,i,n,o){var s,r,a=e.x-t.x,e=e.y-t.y,h=n.min,n=n.max;return 8&i?(s=t.x+a*(n.y-t.y)/e,r=n.y):4&i?(s=t.x+a*(h.y-t.y)/e,r=h.y):2&i?(s=n.x,r=t.y+e*(n.x-t.x)/a):1&i&&(s=h.x,r=t.y+e*(h.x-t.x)/a),new p(s,r,o)}function si(t,e){var i=0;return t.x<e.min.x?i|=1:t.x>e.max.x&&(i|=2),t.y<e.min.y?i|=4:t.y>e.max.y&&(i|=8),i}function ri(t,e,i,n){var o=e.x,e=e.y,s=i.x-o,r=i.y-e,a=s*s+r*r;return 0<a&&(1<(a=((t.x-o)*s+(t.y-e)*r)/a)?(o=i.x,e=i.y):0<a&&(o+=s*a,e+=r*a)),s=t.x-o,r=t.y-e,n?s*s+r*r:new p(o,e)}function I(t){return!d(t[0])||"object"!=typeof t[0][0]&&void 0!==t[0][0]}function ai(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),I(t)}function hi(t,e){var i,n,o,s,r,a;if(!t||0===t.length)throw new Error("latlngs not passed");I(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);for(var h=w([0,0]),l=g(t),u=(l.getNorthWest().distanceTo(l.getSouthWest())*l.getNorthEast().distanceTo(l.getNorthWest())<1700&&(h=Qe(t)),t.length),c=[],d=0;d<u;d++){var _=w(t[d]);c.push(e.project(w([_.lat-h.lat,_.lng-h.lng])))}for(i=d=0;d<u-1;d++)i+=c[d].distanceTo(c[d+1])/2;if(0===i)a=c[0];else for(n=d=0;d<u-1;d++)if(o=c[d],s=c[d+1],i<(n+=r=o.distanceTo(s))){a=[s.x-(r=(n-i)/r)*(s.x-o.x),s.y-r*(s.y-o.y)];break}l=e.unproject(m(a));return w([l.lat+h.lat,l.lng+h.lng])}var vt={__proto__:null,simplify:ei,pointToSegmentDistance:ii,closestPointOnSegment:function(t,e,i){return ri(t,e,i)},clipSegment:ni,_getEdgeIntersection:oi,_getBitCode:si,_sqClosestPointOnSegment:ri,isFlat:I,_flat:ai,polylineCenter:hi},yt={project:function(t){return new p(t.lng,t.lat)},unproject:function(t){return new v(t.y,t.x)},bounds:new f([-180,-90],[180,90])},xt={R:6378137,R_MINOR:6356752.314245179,bounds:new f([-20037508.34279,-15496570.73972],[20037508.34279,18764656.23138]),project:function(t){var e=Math.PI/180,i=this.R,n=t.lat*e,o=this.R_MINOR/i,o=Math.sqrt(1-o*o),s=o*Math.sin(n),s=Math.tan(Math.PI/4-n/2)/Math.pow((1-s)/(1+s),o/2),n=-i*Math.log(Math.max(s,1e-10));return new p(t.lng*e*i,n)},unproject:function(t){for(var e,i=180/Math.PI,n=this.R,o=this.R_MINOR/n,s=Math.sqrt(1-o*o),r=Math.exp(-t.y/n),a=Math.PI/2-2*Math.atan(r),h=0,l=.1;h<15&&1e-7<Math.abs(l);h++)e=s*Math.sin(a),e=Math.pow((1-e)/(1+e),s/2),a+=l=Math.PI/2-2*Math.atan(r*e)-a;return new v(a*i,t.x*i/n)}},wt={__proto__:null,LonLat:yt,Mercator:xt,SphericalMercator:rt},Pt=l({},st,{code:"EPSG:3395",projection:xt,transformation:ht(bt=.5/(Math.PI*xt.R),.5,-bt,.5)}),li=l({},st,{code:"EPSG:4326",projection:yt,transformation:ht(1/180,1,-1/180,.5)}),Lt=l({},ot,{projection:yt,transformation:ht(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,e){var i=e.lng-t.lng,e=e.lat-t.lat;return Math.sqrt(i*i+e*e)},infinite:!0}),o=(ot.Earth=st,ot.EPSG3395=Pt,ot.EPSG3857=lt,ot.EPSG900913=ut,ot.EPSG4326=li,ot.Simple=Lt,it.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[h(t)]=this},removeInteractiveTarget:function(t){return delete this._map._targets[h(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var e,i=t.target;i.hasLayer(this)&&(this._map=i,this._zoomAnimated=i._zoomAnimated,this.getEvents&&(e=this.getEvents(),i.on(e,this),this.once("remove",function(){i.off(e,this)},this)),this.onAdd(i),this.fire("add"),i.fire("layeradd",{layer:this}))}})),ui=(A.include({addLayer:function(t){var e;if(t._layerAdd)return e=h(t),this._layers[e]||((this._layers[e]=t)._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t)),this;throw new Error("The provided object is not a Layer.")},removeLayer:function(t){var e=h(t);return this._layers[e]&&(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null),this},hasLayer:function(t){return h(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},_addLayers:function(t){for(var e=0,i=(t=t?d(t)?t:[t]:[]).length;e<i;e++)this.addLayer(t[e])},_addZoomLimit:function(t){isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[h(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){t=h(t);this._zoomBoundLayers[t]&&(delete this._zoomBoundLayers[t],this._updateZoomLevels())},_updateZoomLevels:function(){var t,e=1/0,i=-1/0,n=this._getZoomSpan();for(t in this._zoomBoundLayers)var o=this._zoomBoundLayers[t].options,e=void 0===o.minZoom?e:Math.min(e,o.minZoom),i=void 0===o.maxZoom?i:Math.max(i,o.maxZoom);this._layersMaxZoom=i===-1/0?void 0:i,this._layersMinZoom=e===1/0?void 0:e,n!==this._getZoomSpan()&&this.fire("zoomlevelschange"),void 0===this.options.maxZoom&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),void 0===this.options.minZoom&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}}),o.extend({initialize:function(t,e){var i,n;if(c(this,e),this._layers={},t)for(i=0,n=t.length;i<n;i++)this.addLayer(t[i])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){t=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[t]&&this._map.removeLayer(this._layers[t]),delete this._layers[t],this},hasLayer:function(t){return("number"==typeof t?t:this.getLayerId(t))in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)(i=this._layers[e])[t]&&i[t].apply(i,n);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:h})),ci=ui.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),ui.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?((t=t in this._layers?this._layers[t]:t).removeEventParent(this),ui.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t,e=new s;for(t in this._layers){var i=this._layers[t];e.extend(i.getBounds?i.getBounds():i.getLatLng())}return e}}),di=et.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){c(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,e){var i=this._getIconUrl(t);if(i)return i=this._createImg(i,e&&"IMG"===e.tagName?e:null),this._setIconStyles(i,t),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),i;if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null},_setIconStyles:function(t,e){var i=this.options,n=i[e+"Size"],n=m(n="number"==typeof n?[n,n]:n),o=m("shadow"===e&&i.shadowAnchor||i.iconAnchor||n&&n.divideBy(2,!0));t.className="leaflet-marker-"+e+" "+(i.className||""),o&&(t.style.marginLeft=-o.x+"px",t.style.marginTop=-o.y+"px"),n&&(t.style.width=n.x+"px",t.style.height=n.y+"px")},_createImg:function(t,e){return(e=e||document.createElement("img")).src=t,e},_getIconUrl:function(t){return b.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});var _i=di.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return"string"!=typeof _i.imagePath&&(_i.imagePath=this._detectIconPath()),(this.options.imagePath||_i.imagePath)+di.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){function e(t,e,i){return(e=e.exec(t))&&e[i]}return(t=e(t,/^url\((['"])?(.+)\1\)$/,2))&&e(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=P("div","leaflet-default-icon-path",document.body),e=pe(t,"background-image")||pe(t,"backgroundImage");return document.body.removeChild(t),(e=this._stripUrl(e))?e:(t=document.querySelector('link[href$="leaflet.css"]'))?t.href.substring(0,t.href.length-"leaflet.css".length-1):""}}),pi=n.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new Xe(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),M(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&z(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var e=this._marker,i=e._map,n=this._marker.options.autoPanSpeed,o=this._marker.options.autoPanPadding,s=Pe(e._icon),r=i.getPixelBounds(),a=i.getPixelOrigin(),a=_(r.min._subtract(a).add(o),r.max._subtract(a).subtract(o));a.contains(s)||(o=m((Math.max(a.max.x,s.x)-a.max.x)/(r.max.x-a.max.x)-(Math.min(a.min.x,s.x)-a.min.x)/(r.min.x-a.min.x),(Math.max(a.max.y,s.y)-a.max.y)/(r.max.y-a.max.y)-(Math.min(a.min.y,s.y)-a.min.y)/(r.min.y-a.min.y)).multiplyBy(n),i.panBy(o,{animate:!1}),this._draggable._newPos._add(o),this._draggable._startPos._add(o),Z(e._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=x(this._adjustPan.bind(this,t)))},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(r(this._panRequest),this._panRequest=x(this._adjustPan.bind(this,t)))},_onDrag:function(t){var e=this._marker,i=e._shadow,n=Pe(e._icon),o=e._map.layerPointToLatLng(n);i&&Z(i,n),e._latlng=o,t.latlng=o,t.oldLatLng=this._oldLatLng,e.fire("move",t).fire("drag",t)},_onDragEnd:function(t){r(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),mi=o.extend({options:{icon:new _i,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,e){c(this,e),this._latlng=w(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var e=this._latlng;return this._latlng=w(t),this.update(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){var t;return this._icon&&this._map&&(t=this._map.latLngToLayerPoint(this._latlng).round(),this._setPos(t)),this},_initIcon:function(){var t=this.options,e="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),i=t.icon.createIcon(this._icon),n=!1,i=(i!==this._icon&&(this._icon&&this._removeIcon(),n=!0,t.title&&(i.title=t.title),"IMG"===i.tagName&&(i.alt=t.alt||"")),M(i,e),t.keyboard&&(i.tabIndex="0",i.setAttribute("role","button")),this._icon=i,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&S(i,"focus",this._panOnFocus,this),t.icon.createShadow(this._shadow)),o=!1;i!==this._shadow&&(this._removeShadow(),o=!0),i&&(M(i,e),i.alt=""),this._shadow=i,t.opacity<1&&this._updateOpacity(),n&&this.getPane().appendChild(this._icon),this._initInteraction(),i&&o&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&k(this._icon,"focus",this._panOnFocus,this),T(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&T(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&Z(this._icon,t),this._shadow&&Z(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(t)},_initInteraction:function(){var t;this.options.interactive&&(M(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),pi&&(t=this.options.draggable,this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new pi(this),t&&this.dragging.enable()))},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&C(this._icon,t),this._shadow&&C(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t,e,i=this._map;i&&(t=(e=this.options.icon.options).iconSize?m(e.iconSize):m(0,0),e=e.iconAnchor?m(e.iconAnchor):m(0,0),i.panInside(this._latlng,{paddingTopLeft:e,paddingBottomRight:t.subtract(e)}))},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});var fi=o.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return c(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),gi=fi.extend({options:{fill:!0,radius:10},initialize:function(t,e){c(this,e),this._latlng=w(t),this._radius=this.options.radius},setLatLng:function(t){var e=this._latlng;return this._latlng=w(t),this.redraw(),this.fire("move",{oldLatLng:e,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var e=t&&t.radius||this._radius;return fi.prototype.setStyle.call(this,t),this.setRadius(e),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,e=this._radiusY||t,i=this._clickTolerance(),t=[t+i,e+i];this._pxBounds=new f(this._point.subtract(t),this._point.add(t))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});var vi=gi.extend({initialize:function(t,e,i){if(c(this,e="number"==typeof e?l({},i,{radius:e}):e),this._latlng=w(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new s(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:fi.prototype.setStyle,_project:function(){var t,e,i,n,o,s=this._latlng.lng,r=this._latlng.lat,a=this._map,h=a.options.crs;h.distance===st.distance?(n=Math.PI/180,o=this._mRadius/st.R/n,t=a.project([r+o,s]),e=a.project([r-o,s]),e=t.add(e).divideBy(2),i=a.unproject(e).lat,n=Math.acos((Math.cos(o*n)-Math.sin(r*n)*Math.sin(i*n))/(Math.cos(r*n)*Math.cos(i*n)))/n,!isNaN(n)&&0!==n||(n=o/Math.cos(Math.PI/180*r)),this._point=e.subtract(a.getPixelOrigin()),this._radius=isNaN(n)?0:e.x-a.project([i,s-n]).x,this._radiusY=e.y-t.y):(o=h.unproject(h.project(this._latlng).subtract([this._mRadius,0])),this._point=a.latLngToLayerPoint(this._latlng),this._radius=this._point.x-a.latLngToLayerPoint(o).x),this._updateBounds()}});var yi=fi.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,e){c(this,e),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var e=1/0,i=null,n=ri,o=0,s=this._parts.length;o<s;o++)for(var r=this._parts[o],a=1,h=r.length;a<h;a++){var l,u,c=n(t,l=r[a-1],u=r[a],!0);c<e&&(e=c,i=n(t,l,u))}return i&&(i.distance=Math.sqrt(e)),i},getCenter:function(){if(this._map)return hi(this._defaultShape(),this._map.options.crs);throw new Error("Must add layer to map before using getCenter()")},getBounds:function(){return this._bounds},addLatLng:function(t,e){return e=e||this._defaultShape(),t=w(t),e.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new s,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return I(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var e=[],i=I(t),n=0,o=t.length;n<o;n++)i?(e[n]=w(t[n]),this._bounds.extend(e[n])):e[n]=this._convertLatLngs(t[n]);return e},_project:function(){var t=new f;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),t=new p(t,t);this._rawPxBounds&&(this._pxBounds=new f([this._rawPxBounds.min.subtract(t),this._rawPxBounds.max.add(t)]))},_projectLatlngs:function(t,e,i){var n,o,s=t[0]instanceof v,r=t.length;if(s){for(o=[],n=0;n<r;n++)o[n]=this._map.latLngToLayerPoint(t[n]),i.extend(o[n]);e.push(o)}else for(n=0;n<r;n++)this._projectLatlngs(t[n],e,i)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var e,i,n,o,s=this._parts,r=0,a=0,h=this._rings.length;r<h;r++)for(e=0,i=(o=this._rings[r]).length;e<i-1;e++)(n=ni(o[e],o[e+1],t,e,!0))&&(s[a]=s[a]||[],s[a].push(n[0]),n[1]===o[e+1]&&e!==i-2||(s[a].push(n[1]),a++))},_simplifyPoints:function(){for(var t=this._parts,e=this.options.smoothFactor,i=0,n=t.length;i<n;i++)t[i]=ei(t[i],e)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,e){var i,n,o,s,r,a,h=this._clickTolerance();if(this._pxBounds&&this._pxBounds.contains(t))for(i=0,s=this._parts.length;i<s;i++)for(n=0,o=(r=(a=this._parts[i]).length)-1;n<r;o=n++)if((e||0!==n)&&ii(t,a[o],a[n])<=h)return!0;return!1}});yi._flat=ai;var xi=yi.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(this._map)return $e(this._defaultShape(),this._map.options.crs);throw new Error("Must add layer to map before using getCenter()")},_convertLatLngs:function(t){var t=yi.prototype._convertLatLngs.call(this,t),e=t.length;return 2<=e&&t[0]instanceof v&&t[0].equals(t[e-1])&&t.pop(),t},_setLatLngs:function(t){yi.prototype._setLatLngs.call(this,t),I(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return(I(this._latlngs[0])?this._latlngs:this._latlngs[0])[0]},_clipPoints:function(){var t=this._renderer._bounds,e=this.options.weight,e=new p(e,e),t=new f(t.min.subtract(e),t.max.add(e));if(this._parts=[],this._pxBounds&&this._pxBounds.intersects(t))if(this.options.noClip)this._parts=this._rings;else for(var i,n=0,o=this._rings.length;n<o;n++)(i=Je(this._rings[n],t,!0)).length&&this._parts.push(i)},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var e,i,n,o,s,r,a,h,l=!1;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(o=0,a=this._parts.length;o<a;o++)for(s=0,r=(h=(e=this._parts[o]).length)-1;s<h;r=s++)i=e[s],n=e[r],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(l=!l);return l||yi.prototype._containsPoint.call(this,t,!0)}});var wi=ci.extend({initialize:function(t,e){c(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,o=d(t)?t:t.features;if(o){for(e=0,i=o.length;e<i;e++)((n=o[e]).geometries||n.geometry||n.features||n.coordinates)&&this.addData(n);return this}var s,r=this.options;return(!r.filter||r.filter(t))&&(s=bi(t,r))?(s.feature=Zi(t),s.defaultOptions=s.options,this.resetStyle(s),r.onEachFeature&&r.onEachFeature(t,s),this.addLayer(s)):this},resetStyle:function(t){return void 0===t?this.eachLayer(this.resetStyle,this):(t.options=l({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(e){return this.eachLayer(function(t){this._setLayerStyle(t,e)},this)},_setLayerStyle:function(t,e){t.setStyle&&("function"==typeof e&&(e=e(t.feature)),t.setStyle(e))}});function bi(t,e){var i,n,o,s,r="Feature"===t.type?t.geometry:t,a=r?r.coordinates:null,h=[],l=e&&e.pointToLayer,u=e&&e.coordsToLatLng||Li;if(!a&&!r)return null;switch(r.type){case"Point":return Pi(l,t,i=u(a),e);case"MultiPoint":for(o=0,s=a.length;o<s;o++)i=u(a[o]),h.push(Pi(l,t,i,e));return new ci(h);case"LineString":case"MultiLineString":return n=Ti(a,"LineString"===r.type?0:1,u),new yi(n,e);case"Polygon":case"MultiPolygon":return n=Ti(a,"Polygon"===r.type?1:2,u),new xi(n,e);case"GeometryCollection":for(o=0,s=r.geometries.length;o<s;o++){var c=bi({geometry:r.geometries[o],type:"Feature",properties:t.properties},e);c&&h.push(c)}return new ci(h);case"FeatureCollection":for(o=0,s=r.features.length;o<s;o++){var d=bi(r.features[o],e);d&&h.push(d)}return new ci(h);default:throw new Error("Invalid GeoJSON object.")}}function Pi(t,e,i,n){return t?t(e,i):new mi(i,n&&n.markersInheritOptions&&n)}function Li(t){return new v(t[1],t[0],t[2])}function Ti(t,e,i){for(var n,o=[],s=0,r=t.length;s<r;s++)n=e?Ti(t[s],e-1,i):(i||Li)(t[s]),o.push(n);return o}function Mi(t,e){return void 0!==(t=w(t)).alt?[i(t.lng,e),i(t.lat,e),i(t.alt,e)]:[i(t.lng,e),i(t.lat,e)]}function zi(t,e,i,n){for(var o=[],s=0,r=t.length;s<r;s++)o.push(e?zi(t[s],I(t[s])?0:e-1,i,n):Mi(t[s],n));return!e&&i&&0<o.length&&o.push(o[0].slice()),o}function Ci(t,e){return t.feature?l({},t.feature,{geometry:e}):Zi(e)}function Zi(t){return"Feature"===t.type||"FeatureCollection"===t.type?t:{type:"Feature",properties:{},geometry:t}}Tt={toGeoJSON:function(t){return Ci(this,{type:"Point",coordinates:Mi(this.getLatLng(),t)})}};function Si(t,e){return new wi(t,e)}mi.include(Tt),vi.include(Tt),gi.include(Tt),yi.include({toGeoJSON:function(t){var e=!I(this._latlngs);return Ci(this,{type:(e?"Multi":"")+"LineString",coordinates:zi(this._latlngs,e?1:0,!1,t)})}}),xi.include({toGeoJSON:function(t){var e=!I(this._latlngs),i=e&&!I(this._latlngs[0]),t=zi(this._latlngs,i?2:e?1:0,!0,t);return Ci(this,{type:(i?"Multi":"")+"Polygon",coordinates:t=e?t:[t]})}}),ui.include({toMultiPoint:function(e){var i=[];return this.eachLayer(function(t){i.push(t.toGeoJSON(e).geometry.coordinates)}),Ci(this,{type:"MultiPoint",coordinates:i})},toGeoJSON:function(e){var i,n,t=this.feature&&this.feature.geometry&&this.feature.geometry.type;return"MultiPoint"===t?this.toMultiPoint(e):(i="GeometryCollection"===t,n=[],this.eachLayer(function(t){t.toGeoJSON&&(t=t.toGeoJSON(e),i?n.push(t.geometry):"FeatureCollection"===(t=Zi(t)).type?n.push.apply(n,t.features):n.push(t))}),i?Ci(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n})}});var Mt=Si,Ei=o.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,e,i){this._url=t,this._bounds=g(e),c(this,i)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(M(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){T(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&fe(this._image),this},bringToBack:function(){return this._map&&ge(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=g(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t="IMG"===this._url.tagName,e=this._image=t?this._url:P("img");M(e,"leaflet-image-layer"),this._zoomAnimated&&M(e,"leaflet-zoom-animated"),this.options.className&&M(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onload=a(this.fire,this,"load"),e.onerror=a(this._overlayOnError,this,"error"),!this.options.crossOrigin&&""!==this.options.crossOrigin||(e.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t?this._url=e.src:(e.src=this._url,e.alt=this.options.alt)},_animateZoom:function(t){var e=this._map.getZoomScale(t.zoom),t=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;be(this._image,t,e)},_reset:function(){var t=this._image,e=new f(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),i=e.getSize();Z(t,e.min),t.style.width=i.x+"px",t.style.height=i.y+"px"},_updateOpacity:function(){C(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),ki=Ei.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t="VIDEO"===this._url.tagName,e=this._image=t?this._url:P("video");if(M(e,"leaflet-image-layer"),this._zoomAnimated&&M(e,"leaflet-zoom-animated"),this.options.className&&M(e,this.options.className),e.onselectstart=u,e.onmousemove=u,e.onloadeddata=a(this.fire,this,"load"),t){for(var i=e.getElementsByTagName("source"),n=[],o=0;o<i.length;o++)n.push(i[o].src);this._url=0<i.length?n:[e.src]}else{d(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(e.style,"objectFit")&&(e.style.objectFit="fill"),e.autoplay=!!this.options.autoplay,e.loop=!!this.options.loop,e.muted=!!this.options.muted,e.playsInline=!!this.options.playsInline;for(var s=0;s<this._url.length;s++){var r=P("source");r.src=this._url[s],e.appendChild(r)}}}});var Oi=Ei.extend({_initImage:function(){var t=this._image=this._url;M(t,"leaflet-image-layer"),this._zoomAnimated&&M(t,"leaflet-zoom-animated"),this.options.className&&M(t,this.options.className),t.onselectstart=u,t.onmousemove=u}});var Ai=o.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,e){t&&(t instanceof v||d(t))?(this._latlng=w(t),c(this,e)):(c(this,t),this._source=e),this.options.content&&(this._content=this.options.content)},openOn:function(t){return(t=arguments.length?t:this._source._map).hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&C(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&C(this._container,1),this.bringToFront(),this.options.interactive&&(M(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(C(this._container,0),this._removeTimeout=setTimeout(a(T,void 0,this._container),200)):T(this._container),this.options.interactive&&(z(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=w(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&fe(this._container),this},bringToBack:function(){return this._map&&ge(this._container),this},_prepareOpen:function(t){if(!(i=this._source)._map)return!1;if(i instanceof ci){var e,i=null,n=this._source._layers;for(e in n)if(n[e]._map){i=n[e];break}if(!i)return!1;this._source=i}if(!t)if(i.getCenter)t=i.getCenter();else if(i.getLatLng)t=i.getLatLng();else{if(!i.getBounds)throw new Error("Unable to get source layer LatLng.");t=i.getBounds().getCenter()}return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,e="function"==typeof this._content?this._content(this._source||this):this._content;if("string"==typeof e)t.innerHTML=e;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(e)}this.fire("contentupdate")}},_updatePosition:function(){var t,e,i;this._map&&(e=this._map.latLngToLayerPoint(this._latlng),t=m(this.options.offset),i=this._getAnchor(),this._zoomAnimated?Z(this._container,e.add(i)):t=t.add(e).add(i),e=this._containerBottom=-t.y,i=this._containerLeft=-Math.round(this._containerWidth/2)+t.x,this._container.style.bottom=e+"px",this._container.style.left=i+"px")},_getAnchor:function(){return[0,0]}}),Bi=(A.include({_initOverlay:function(t,e,i,n){var o=e;return o instanceof t||(o=new t(n).setContent(e)),i&&o.setLatLng(i),o}}),o.include({_initOverlay:function(t,e,i,n){var o=i;return o instanceof t?(c(o,n),o._source=this):(o=e&&!n?e:new t(n,this)).setContent(i),o}}),Ai.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return!(t=arguments.length?t:this._source._map).hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,Ai.prototype.openOn.call(this,t)},onAdd:function(t){Ai.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof fi||this._source.on("preclick",Ae))},onRemove:function(t){Ai.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof fi||this._source.off("preclick",Ae))},getEvents:function(){var t=Ai.prototype.getEvents.call(this);return(void 0!==this.options.closeOnClick?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",e=this._container=P("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),i=this._wrapper=P("div",t+"-content-wrapper",e);this._contentNode=P("div",t+"-content",i),Ie(e),Be(this._contentNode),S(e,"contextmenu",Ae),this._tipContainer=P("div",t+"-tip-container",e),this._tip=P("div",t+"-tip",this._tipContainer),this.options.closeButton&&((i=this._closeButton=P("a",t+"-close-button",e)).setAttribute("role","button"),i.setAttribute("aria-label","Close popup"),i.href="#close",i.innerHTML='<span aria-hidden="true">×</span>',S(i,"click",function(t){O(t),this.close()},this))},_updateLayout:function(){var t=this._contentNode,e=t.style,i=(e.width="",e.whiteSpace="nowrap",t.offsetWidth),i=Math.min(i,this.options.maxWidth),i=(i=Math.max(i,this.options.minWidth),e.width=i+1+"px",e.whiteSpace="",e.height="",t.offsetHeight),n=this.options.maxHeight,o="leaflet-popup-scrolled";(n&&n<i?(e.height=n+"px",M):z)(t,o),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),e=this._getAnchor();Z(this._container,t.add(e))},_adjustPan:function(){var t,e,i,n,o,s,r,a;this.options.autoPan&&(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning?this._autopanning=!1:(t=this._map,e=parseInt(pe(this._container,"marginBottom"),10)||0,e=this._container.offsetHeight+e,a=this._containerWidth,(i=new p(this._containerLeft,-e-this._containerBottom))._add(Pe(this._container)),i=t.layerPointToContainerPoint(i),o=m(this.options.autoPanPadding),n=m(this.options.autoPanPaddingTopLeft||o),o=m(this.options.autoPanPaddingBottomRight||o),s=t.getSize(),r=0,i.x+a+o.x>s.x&&(r=i.x+a-s.x+o.x),i.x-r-n.x<(a=0)&&(r=i.x-n.x),i.y+e+o.y>s.y&&(a=i.y+e-s.y+o.y),i.y-a-n.y<0&&(a=i.y-n.y),(r||a)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([r,a]))))},_getAnchor:function(){return m(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}})),Ii=(A.mergeOptions({closePopupOnClick:!0}),A.include({openPopup:function(t,e,i){return this._initOverlay(Bi,t,e,i).openOn(this),this},closePopup:function(t){return(t=arguments.length?t:this._popup)&&t.close(),this}}),o.include({bindPopup:function(t,e){return this._popup=this._initOverlay(Bi,this._popup,t,e),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof ci||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return!!this._popup&&this._popup.isOpen()},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){var e;this._popup&&this._map&&(Re(t),e=t.layer||t.target,this._popup._source!==e||e instanceof fi?(this._popup._source=e,this.openPopup(t.latlng)):this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng))},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){13===t.originalEvent.keyCode&&this._openPopup(t)}}),Ai.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){Ai.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){Ai.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=Ai.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=P("div",t),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+h(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var e,i=this._map,n=this._container,o=i.latLngToContainerPoint(i.getCenter()),i=i.layerPointToContainerPoint(t),s=this.options.direction,r=n.offsetWidth,a=n.offsetHeight,h=m(this.options.offset),l=this._getAnchor(),i="top"===s?(e=r/2,a):"bottom"===s?(e=r/2,0):(e="center"===s?r/2:"right"===s?0:"left"===s?r:i.x<o.x?(s="right",0):(s="left",r+2*(h.x+l.x)),a/2);t=t.subtract(m(e,i,!0)).add(h).add(l),z(n,"leaflet-tooltip-right"),z(n,"leaflet-tooltip-left"),z(n,"leaflet-tooltip-top"),z(n,"leaflet-tooltip-bottom"),M(n,"leaflet-tooltip-"+s),Z(n,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&C(this._container,t)},_animateZoom:function(t){t=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(t)},_getAnchor:function(){return m(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}})),Ri=(A.include({openTooltip:function(t,e,i){return this._initOverlay(Ii,t,e,i).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),o.include({bindTooltip:function(t,e){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(Ii,this._tooltip,t,e),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){var e,i;!t&&this._tooltipHandlersAdded||(e=t?"off":"on",i={remove:this.closeTooltip,move:this._moveTooltip},this._tooltip.options.permanent?i.add=this._openTooltip:(i.mouseover=this._openTooltip,i.mouseout=this.closeTooltip,i.click=this._openTooltip,this._map?this._addFocusListeners():i.add=this._addFocusListeners),this._tooltip.options.sticky&&(i.mousemove=this._moveTooltip),this[e](i),this._tooltipHandlersAdded=!t)},openTooltip:function(t){return this._tooltip&&(this instanceof ci||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var e="function"==typeof t.getElement&&t.getElement();e&&(S(e,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),S(e,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){t="function"==typeof t.getElement&&t.getElement();t&&t.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){var e;this._tooltip&&this._map&&(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag?(this._openOnceFlag=!0,(e=this)._map.once("moveend",function(){e._openOnceFlag=!1,e._openTooltip(t)})):(this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)))},_moveTooltip:function(t){var e=t.latlng;this._tooltip.options.sticky&&t.originalEvent&&(t=this._map.mouseEventToContainerPoint(t.originalEvent),t=this._map.containerPointToLayerPoint(t),e=this._map.layerPointToLatLng(t)),this._tooltip.setLatLng(e)}}),di.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var t=t&&"DIV"===t.tagName?t:document.createElement("div"),e=this.options;return e.html instanceof Element?(me(t),t.appendChild(e.html)):t.innerHTML=!1!==e.html?e.html:"",e.bgPos&&(e=m(e.bgPos),t.style.backgroundPosition=-e.x+"px "+-e.y+"px"),this._setIconStyles(t,"icon"),t},createShadow:function(){return null}}));di.Default=_i;var Ni=o.extend({options:{tileSize:256,opacity:1,updateWhenIdle:b.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){c(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),T(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(fe(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(ge(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){var t;return this._map&&(this._removeAllTiles(),(t=this._clampZoom(this._map.getZoom()))!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()),this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=j(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof p?t:new p(t,t)},_updateZIndex:function(){this._container&&void 0!==this.options.zIndex&&null!==this.options.zIndex&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var e,i=this.getPane().children,n=-t(-1/0,1/0),o=0,s=i.length;o<s;o++)e=i[o].style.zIndex,i[o]!==this._container&&e&&(n=t(n,+e));isFinite(n)&&(this.options.zIndex=n+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!b.ielt9){C(this._container,this.options.opacity);var t,e=+new Date,i=!1,n=!1;for(t in this._tiles){var o,s=this._tiles[t];s.current&&s.loaded&&(o=Math.min(1,(e-s.loaded)/200),C(s.el,o),o<1?i=!0:(s.active?n=!0:this._onOpaqueTile(s),s.active=!0))}n&&!this._noPrune&&this._pruneTiles(),i&&(r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this))}},_onOpaqueTile:u,_initContainer:function(){this._container||(this._container=P("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,e=this.options.maxZoom;if(void 0!==t){for(var i in this._levels)i=Number(i),this._levels[i].el.children.length||i===t?(this._levels[i].el.style.zIndex=e-Math.abs(t-i),this._onUpdateLevel(i)):(T(this._levels[i].el),this._removeTilesAtZoom(i),this._onRemoveLevel(i),delete this._levels[i]);var n=this._levels[t],o=this._map;return n||((n=this._levels[t]={}).el=P("div","leaflet-tile-container leaflet-zoom-animated",this._container),n.el.style.zIndex=e,n.origin=o.project(o.unproject(o.getPixelOrigin()),t).round(),n.zoom=t,this._setZoomTransform(n,o.getCenter(),o.getZoom()),u(n.el.offsetWidth),this._onCreateLevel(n)),this._level=n}},_onUpdateLevel:u,_onRemoveLevel:u,_onCreateLevel:u,_pruneTiles:function(){if(this._map){var t,e,i,n=this._map.getZoom();if(n>this.options.maxZoom||n<this.options.minZoom)this._removeAllTiles();else{for(t in this._tiles)(i=this._tiles[t]).retain=i.current;for(t in this._tiles)(i=this._tiles[t]).current&&!i.active&&(e=i.coords,this._retainParent(e.x,e.y,e.z,e.z-5)||this._retainChildren(e.x,e.y,e.z,e.z+2));for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}}},_removeTilesAtZoom:function(t){for(var e in this._tiles)this._tiles[e].coords.z===t&&this._removeTile(e)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)T(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,e,i,n){var t=Math.floor(t/2),e=Math.floor(e/2),i=i-1,o=new p(+t,+e),o=(o.z=i,this._tileCoordsToKey(o)),o=this._tiles[o];return o&&o.active?o.retain=!0:(o&&o.loaded&&(o.retain=!0),n<i&&this._retainParent(t,e,i,n))},_retainChildren:function(t,e,i,n){for(var o=2*t;o<2*t+2;o++)for(var s=2*e;s<2*e+2;s++){var r=new p(o,s),r=(r.z=i+1,this._tileCoordsToKey(r)),r=this._tiles[r];r&&r.active?r.retain=!0:(r&&r.loaded&&(r.retain=!0),i+1<n&&this._retainChildren(o,s,i+1,n))}},_resetView:function(t){t=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),t,t)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var e=this.options;return void 0!==e.minNativeZoom&&t<e.minNativeZoom?e.minNativeZoom:void 0!==e.maxNativeZoom&&e.maxNativeZoom<t?e.maxNativeZoom:t},_setView:function(t,e,i,n){var o=Math.round(e),o=void 0!==this.options.maxZoom&&o>this.options.maxZoom||void 0!==this.options.minZoom&&o<this.options.minZoom?void 0:this._clampZoom(o),s=this.options.updateWhenZooming&&o!==this._tileZoom;n&&!s||(this._tileZoom=o,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),void 0!==o&&this._update(t),i||this._pruneTiles(),this._noPrune=!!i),this._setZoomTransforms(t,e)},_setZoomTransforms:function(t,e){for(var i in this._levels)this._setZoomTransform(this._levels[i],t,e)},_setZoomTransform:function(t,e,i){var n=this._map.getZoomScale(i,t.zoom),e=t.origin.multiplyBy(n).subtract(this._map._getNewPixelOrigin(e,i)).round();b.any3d?be(t.el,e,n):Z(t.el,e)},_resetGrid:function(){var t=this._map,e=t.options.crs,i=this._tileSize=this.getTileSize(),n=this._tileZoom,o=this._map.getPixelWorldBounds(this._tileZoom);o&&(this._globalTileRange=this._pxBoundsToTileRange(o)),this._wrapX=e.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,e.wrapLng[0]],n).x/i.x),Math.ceil(t.project([0,e.wrapLng[1]],n).x/i.y)],this._wrapY=e.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([e.wrapLat[0],0],n).y/i.x),Math.ceil(t.project([e.wrapLat[1],0],n).y/i.y)]},_onMoveEnd:function(){this._map&&!this._map._animatingZoom&&this._update()},_getTiledPixelBounds:function(t){var e=this._map,i=e._animatingZoom?Math.max(e._animateToZoom,e.getZoom()):e.getZoom(),i=e.getZoomScale(i,this._tileZoom),t=e.project(t,this._tileZoom).floor(),e=e.getSize().divideBy(2*i);return new f(t.subtract(e),t.add(e))},_update:function(t){var e=this._map;if(e){var i=this._clampZoom(e.getZoom());if(void 0===t&&(t=e.getCenter()),void 0!==this._tileZoom){var n,e=this._getTiledPixelBounds(t),o=this._pxBoundsToTileRange(e),s=o.getCenter(),r=[],e=this.options.keepBuffer,a=new f(o.getBottomLeft().subtract([e,-e]),o.getTopRight().add([e,-e]));if(!(isFinite(o.min.x)&&isFinite(o.min.y)&&isFinite(o.max.x)&&isFinite(o.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(n in this._tiles){var h=this._tiles[n].coords;h.z===this._tileZoom&&a.contains(new p(h.x,h.y))||(this._tiles[n].current=!1)}if(1<Math.abs(i-this._tileZoom))this._setView(t,i);else{for(var l=o.min.y;l<=o.max.y;l++)for(var u=o.min.x;u<=o.max.x;u++){var c,d=new p(u,l);d.z=this._tileZoom,this._isValidTile(d)&&((c=this._tiles[this._tileCoordsToKey(d)])?c.current=!0:r.push(d))}if(r.sort(function(t,e){return t.distanceTo(s)-e.distanceTo(s)}),0!==r.length){this._loading||(this._loading=!0,this.fire("loading"));for(var _=document.createDocumentFragment(),u=0;u<r.length;u++)this._addTile(r[u],_);this._level.el.appendChild(_)}}}}},_isValidTile:function(t){var e=this._map.options.crs;if(!e.infinite){var i=this._globalTileRange;if(!e.wrapLng&&(t.x<i.min.x||t.x>i.max.x)||!e.wrapLat&&(t.y<i.min.y||t.y>i.max.y))return!1}return!this.options.bounds||(e=this._tileCoordsToBounds(t),g(this.options.bounds).overlaps(e))},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var e=this._map,i=this.getTileSize(),n=t.scaleBy(i),i=n.add(i);return[e.unproject(n,t.z),e.unproject(i,t.z)]},_tileCoordsToBounds:function(t){t=this._tileCoordsToNwSe(t),t=new s(t[0],t[1]);return t=this.options.noWrap?t:this._map.wrapLatLngBounds(t)},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var t=t.split(":"),e=new p(+t[0],+t[1]);return e.z=+t[2],e},_removeTile:function(t){var e=this._tiles[t];e&&(T(e.el),delete this._tiles[t],this.fire("tileunload",{tile:e.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){M(t,"leaflet-tile");var e=this.getTileSize();t.style.width=e.x+"px",t.style.height=e.y+"px",t.onselectstart=u,t.onmousemove=u,b.ielt9&&this.options.opacity<1&&C(t,this.options.opacity)},_addTile:function(t,e){var i=this._getTilePos(t),n=this._tileCoordsToKey(t),o=this.createTile(this._wrapCoords(t),a(this._tileReady,this,t));this._initTile(o),this.createTile.length<2&&x(a(this._tileReady,this,t,null,o)),Z(o,i),this._tiles[n]={el:o,coords:t,current:!0},e.appendChild(o),this.fire("tileloadstart",{tile:o,coords:t})},_tileReady:function(t,e,i){e&&this.fire("tileerror",{error:e,tile:i,coords:t});var n=this._tileCoordsToKey(t);(i=this._tiles[n])&&(i.loaded=+new Date,this._map._fadeAnimated?(C(i.el,0),r(this._fadeFrame),this._fadeFrame=x(this._updateOpacity,this)):(i.active=!0,this._pruneTiles()),e||(M(i.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:i.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),b.ielt9||!this._map._fadeAnimated?x(this._pruneTiles,this):setTimeout(a(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var e=new p(this._wrapX?H(t.x,this._wrapX):t.x,this._wrapY?H(t.y,this._wrapY):t.y);return e.z=t.z,e},_pxBoundsToTileRange:function(t){var e=this.getTileSize();return new f(t.min.unscaleBy(e).floor(),t.max.unscaleBy(e).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});var Di=Ni.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,e){this._url=t,(e=c(this,e)).detectRetina&&b.retina&&0<e.maxZoom?(e.tileSize=Math.floor(e.tileSize/2),e.zoomReverse?(e.zoomOffset--,e.minZoom=Math.min(e.maxZoom,e.minZoom+1)):(e.zoomOffset++,e.maxZoom=Math.max(e.minZoom,e.maxZoom-1)),e.minZoom=Math.max(0,e.minZoom)):e.zoomReverse?e.minZoom=Math.min(e.maxZoom,e.minZoom):e.maxZoom=Math.max(e.minZoom,e.maxZoom),"string"==typeof e.subdomains&&(e.subdomains=e.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,e){return this._url===t&&void 0===e&&(e=!0),this._url=t,e||this.redraw(),this},createTile:function(t,e){var i=document.createElement("img");return S(i,"load",a(this._tileOnLoad,this,e,i)),S(i,"error",a(this._tileOnError,this,e,i)),!this.options.crossOrigin&&""!==this.options.crossOrigin||(i.crossOrigin=!0===this.options.crossOrigin?"":this.options.crossOrigin),"string"==typeof this.options.referrerPolicy&&(i.referrerPolicy=this.options.referrerPolicy),i.alt="",i.src=this.getTileUrl(t),i},getTileUrl:function(t){var e={r:b.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};return this._map&&!this._map.options.crs.infinite&&(t=this._globalTileRange.max.y-t.y,this.options.tms&&(e.y=t),e["-y"]=t),q(this._url,l(e,this.options))},_tileOnLoad:function(t,e){b.ielt9?setTimeout(a(t,this,null,e),0):t(null,e)},_tileOnError:function(t,e,i){var n=this.options.errorTileUrl;n&&e.getAttribute("src")!==n&&(e.src=n),t(i,e)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,e=this.options.maxZoom;return(t=this.options.zoomReverse?e-t:t)+this.options.zoomOffset},_getSubdomain:function(t){t=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[t]},_abortLoading:function(){var t,e,i;for(t in this._tiles)this._tiles[t].coords.z!==this._tileZoom&&((i=this._tiles[t].el).onload=u,i.onerror=u,i.complete||(i.src=K,e=this._tiles[t].coords,T(i),delete this._tiles[t],this.fire("tileabort",{tile:i,coords:e})))},_removeTile:function(t){var e=this._tiles[t];if(e)return e.el.setAttribute("src",K),Ni.prototype._removeTile.call(this,t)},_tileReady:function(t,e,i){if(this._map&&(!i||i.getAttribute("src")!==K))return Ni.prototype._tileReady.call(this,t,e,i)}});function ji(t,e){return new Di(t,e)}var Hi=Di.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,e){this._url=t;var i,n=l({},this.defaultWmsParams);for(i in e)i in this.options||(n[i]=e[i]);var t=(e=c(this,e)).detectRetina&&b.retina?2:1,o=this.getTileSize();n.width=o.x*t,n.height=o.y*t,this.wmsParams=n},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=1.3<=this._wmsVersion?"crs":"srs";this.wmsParams[e]=this._crs.code,Di.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._tileCoordsToNwSe(t),i=this._crs,i=_(i.project(e[0]),i.project(e[1])),e=i.min,i=i.max,e=(1.3<=this._wmsVersion&&this._crs===li?[e.y,e.x,i.y,i.x]:[e.x,e.y,i.x,i.y]).join(","),i=Di.prototype.getTileUrl.call(this,t);return i+U(this.wmsParams,i,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+e},setParams:function(t,e){return l(this.wmsParams,t),e||this.redraw(),this}});Di.WMS=Hi,ji.wms=function(t,e){return new Hi(t,e)};var Wi=o.extend({options:{padding:.1},initialize:function(t){c(this,t),h(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),M(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,e){var i=this._map.getZoomScale(e,this._zoom),n=this._map.getSize().multiplyBy(.5+this.options.padding),o=this._map.project(this._center,e),n=n.multiplyBy(-i).add(o).subtract(this._map._getNewPixelOrigin(t,e));b.any3d?be(this._container,n,i):Z(this._container,n)},_reset:function(){for(var t in this._update(),this._updateTransform(this._center,this._zoom),this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,e=this._map.getSize(),i=this._map.containerPointToLayerPoint(e.multiplyBy(-t)).round();this._bounds=new f(i,i.add(e.multiplyBy(1+2*t)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),Fi=Wi.extend({options:{tolerance:0},getEvents:function(){var t=Wi.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){Wi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");S(t,"mousemove",this._onMouseMove,this),S(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),S(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){r(this._redrawRequest),delete this._ctx,T(this._container),k(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){for(var t in this._redrawBounds=null,this._layers)this._layers[t]._update();this._redraw()}},_update:function(){var t,e,i,n;this._map._animatingZoom&&this._bounds||(Wi.prototype._update.call(this),t=this._bounds,e=this._container,i=t.getSize(),n=b.retina?2:1,Z(e,t.min),e.width=n*i.x,e.height=n*i.y,e.style.width=i.x+"px",e.style.height=i.y+"px",b.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update"))},_reset:function(){Wi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t);t=(this._layers[h(t)]=t)._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=t),this._drawLast=t,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var e=t._order,i=e.next,e=e.prev;i?i.prev=e:this._drawLast=e,e?e.next=i:this._drawFirst=i,delete t._order,delete this._layers[h(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if("string"==typeof t.options.dashArray){for(var e,i=t.options.dashArray.split(/[, ]+/),n=[],o=0;o<i.length;o++){if(e=Number(i[o]),isNaN(e))return;n.push(e)}t.options._dashArray=n}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||x(this._redraw,this))},_extendRedrawBounds:function(t){var e;t._pxBounds&&(e=(t.options.weight||0)+1,this._redrawBounds=this._redrawBounds||new f,this._redrawBounds.extend(t._pxBounds.min.subtract([e,e])),this._redrawBounds.extend(t._pxBounds.max.add([e,e])))},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t,e=this._redrawBounds;e?(t=e.getSize(),this._ctx.clearRect(e.min.x,e.min.y,t.x,t.y)):(this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore())},_draw:function(){var t,e,i=this._redrawBounds;this._ctx.save(),i&&(e=i.getSize(),this._ctx.beginPath(),this._ctx.rect(i.min.x,i.min.y,e.x,e.y),this._ctx.clip()),this._drawing=!0;for(var n=this._drawFirst;n;n=n.next)t=n.layer,(!i||t._pxBounds&&t._pxBounds.intersects(i))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,e){if(this._drawing){var i,n,o,s,r=t._parts,a=r.length,h=this._ctx;if(a){for(h.beginPath(),i=0;i<a;i++){for(n=0,o=r[i].length;n<o;n++)s=r[i][n],h[n?"lineTo":"moveTo"](s.x,s.y);e&&h.closePath()}this._fillStroke(h,t)}}},_updateCircle:function(t){var e,i,n,o;this._drawing&&!t._empty()&&(e=t._point,i=this._ctx,n=Math.max(Math.round(t._radius),1),1!=(o=(Math.max(Math.round(t._radiusY),1)||n)/n)&&(i.save(),i.scale(1,o)),i.beginPath(),i.arc(e.x,e.y/o,n,0,2*Math.PI,!1),1!=o&&i.restore(),this._fillStroke(i,t))},_fillStroke:function(t,e){var i=e.options;i.fill&&(t.globalAlpha=i.fillOpacity,t.fillStyle=i.fillColor||i.color,t.fill(i.fillRule||"evenodd")),i.stroke&&0!==i.weight&&(t.setLineDash&&t.setLineDash(e.options&&e.options._dashArray||[]),t.globalAlpha=i.opacity,t.lineWidth=i.weight,t.strokeStyle=i.color,t.lineCap=i.lineCap,t.lineJoin=i.lineJoin,t.stroke())},_onClick:function(t){for(var e,i,n=this._map.mouseEventToLayerPoint(t),o=this._drawFirst;o;o=o.next)(e=o.layer).options.interactive&&e._containsPoint(n)&&(("click"===t.type||"preclick"===t.type)&&this._map._draggableMoved(e)||(i=e));this._fireEvent(!!i&&[i],t)},_onMouseMove:function(t){var e;!this._map||this._map.dragging.moving()||this._map._animatingZoom||(e=this._map.mouseEventToLayerPoint(t),this._handleMouseHover(t,e))},_handleMouseOut:function(t){var e=this._hoveredLayer;e&&(z(this._container,"leaflet-interactive"),this._fireEvent([e],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,e){if(!this._mouseHoverThrottled){for(var i,n,o=this._drawFirst;o;o=o.next)(i=o.layer).options.interactive&&i._containsPoint(e)&&(n=i);n!==this._hoveredLayer&&(this._handleMouseOut(t),n&&(M(this._container,"leaflet-interactive"),this._fireEvent([n],t,"mouseover"),this._hoveredLayer=n)),this._fireEvent(!!this._hoveredLayer&&[this._hoveredLayer],t),this._mouseHoverThrottled=!0,setTimeout(a(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,e,i){this._map._fireDOMEvent(e,i||e.type,t)},_bringToFront:function(t){var e,i,n=t._order;n&&(e=n.next,i=n.prev,e&&((e.prev=i)?i.next=e:e&&(this._drawFirst=e),n.prev=this._drawLast,(this._drawLast.next=n).next=null,this._drawLast=n,this._requestRedraw(t)))},_bringToBack:function(t){var e,i,n=t._order;n&&(e=n.next,(i=n.prev)&&((i.next=e)?e.prev=i:i&&(this._drawLast=i),n.prev=null,n.next=this._drawFirst,this._drawFirst.prev=n,this._drawFirst=n,this._requestRedraw(t)))}});function Ui(t){return b.canvas?new Fi(t):null}var Vi=function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch(t){}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}(),zt={_initContainer:function(){this._container=P("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(Wi.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var e=t._container=Vi("shape");M(e,"leaflet-vml-shape "+(this.options.className||"")),e.coordsize="1 1",t._path=Vi("path"),e.appendChild(t._path),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){var e=t._container;this._container.appendChild(e),t.options.interactive&&t.addInteractiveTarget(e)},_removePath:function(t){var e=t._container;T(e),t.removeInteractiveTarget(e),delete this._layers[h(t)]},_updateStyle:function(t){var e=t._stroke,i=t._fill,n=t.options,o=t._container;o.stroked=!!n.stroke,o.filled=!!n.fill,n.stroke?(e=e||(t._stroke=Vi("stroke")),o.appendChild(e),e.weight=n.weight+"px",e.color=n.color,e.opacity=n.opacity,n.dashArray?e.dashStyle=d(n.dashArray)?n.dashArray.join(" "):n.dashArray.replace(/( *, *)/g," "):e.dashStyle="",e.endcap=n.lineCap.replace("butt","flat"),e.joinstyle=n.lineJoin):e&&(o.removeChild(e),t._stroke=null),n.fill?(i=i||(t._fill=Vi("fill")),o.appendChild(i),i.color=n.fillColor||n.color,i.opacity=n.fillOpacity):i&&(o.removeChild(i),t._fill=null)},_updateCircle:function(t){var e=t._point.round(),i=Math.round(t._radius),n=Math.round(t._radiusY||i);this._setPath(t,t._empty()?"M0 0":"AL "+e.x+","+e.y+" "+i+","+n+" 0,23592600")},_setPath:function(t,e){t._path.v=e},_bringToFront:function(t){fe(t._container)},_bringToBack:function(t){ge(t._container)}},qi=b.vml?Vi:ct,Gi=Wi.extend({_initContainer:function(){this._container=qi("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=qi("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){T(this._container),k(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){var t,e,i;this._map._animatingZoom&&this._bounds||(Wi.prototype._update.call(this),e=(t=this._bounds).getSize(),i=this._container,this._svgSize&&this._svgSize.equals(e)||(this._svgSize=e,i.setAttribute("width",e.x),i.setAttribute("height",e.y)),Z(i,t.min),i.setAttribute("viewBox",[t.min.x,t.min.y,e.x,e.y].join(" ")),this.fire("update"))},_initPath:function(t){var e=t._path=qi("path");t.options.className&&M(e,t.options.className),t.options.interactive&&M(e,"leaflet-interactive"),this._updateStyle(t),this._layers[h(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){T(t._path),t.removeInteractiveTarget(t._path),delete this._layers[h(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var e=t._path,t=t.options;e&&(t.stroke?(e.setAttribute("stroke",t.color),e.setAttribute("stroke-opacity",t.opacity),e.setAttribute("stroke-width",t.weight),e.setAttribute("stroke-linecap",t.lineCap),e.setAttribute("stroke-linejoin",t.lineJoin),t.dashArray?e.setAttribute("stroke-dasharray",t.dashArray):e.removeAttribute("stroke-dasharray"),t.dashOffset?e.setAttribute("stroke-dashoffset",t.dashOffset):e.removeAttribute("stroke-dashoffset")):e.setAttribute("stroke","none"),t.fill?(e.setAttribute("fill",t.fillColor||t.color),e.setAttribute("fill-opacity",t.fillOpacity),e.setAttribute("fill-rule",t.fillRule||"evenodd")):e.setAttribute("fill","none"))},_updatePoly:function(t,e){this._setPath(t,dt(t._parts,e))},_updateCircle:function(t){var e=t._point,i=Math.max(Math.round(t._radius),1),n="a"+i+","+(Math.max(Math.round(t._radiusY),1)||i)+" 0 1,0 ",e=t._empty()?"M0 0":"M"+(e.x-i)+","+e.y+n+2*i+",0 "+n+2*-i+",0 ";this._setPath(t,e)},_setPath:function(t,e){t._path.setAttribute("d",e)},_bringToFront:function(t){fe(t._path)},_bringToBack:function(t){ge(t._path)}});function Ki(t){return b.svg||b.vml?new Gi(t):null}b.vml&&Gi.include(zt),A.include({getRenderer:function(t){t=(t=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer)||(this._renderer=this._createRenderer());return this.hasLayer(t)||this.addLayer(t),t},_getPaneRenderer:function(t){var e;return"overlayPane"!==t&&void 0!==t&&(void 0===(e=this._paneRenderers[t])&&(e=this._createRenderer({pane:t}),this._paneRenderers[t]=e),e)},_createRenderer:function(t){return this.options.preferCanvas&&Ui(t)||Ki(t)}});var Yi=xi.extend({initialize:function(t,e){xi.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return[(t=g(t)).getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});Gi.create=qi,Gi.pointsToPath=dt,wi.geometryToLayer=bi,wi.coordsToLatLng=Li,wi.coordsToLatLngs=Ti,wi.latLngToCoords=Mi,wi.latLngsToCoords=zi,wi.getFeature=Ci,wi.asFeature=Zi,A.mergeOptions({boxZoom:!0});var _t=n.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){S(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){k(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){T(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){0!==this._resetStateTimeout&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||1!==t.which&&1!==t.button)return!1;this._clearDeferredResetState(),this._resetState(),re(),Le(),this._startPoint=this._map.mouseEventToContainerPoint(t),S(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=P("div","leaflet-zoom-box",this._container),M(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var t=new f(this._point,this._startPoint),e=t.getSize();Z(this._box,t.min),this._box.style.width=e.x+"px",this._box.style.height=e.y+"px"},_finish:function(){this._moved&&(T(this._box),z(this._container,"leaflet-crosshair")),ae(),Te(),k(document,{contextmenu:Re,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){1!==t.which&&1!==t.button||(this._finish(),this._moved&&(this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(a(this._resetState,this),0),t=new s(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point)),this._map.fitBounds(t).fire("boxzoomend",{boxZoomBounds:t})))},_onKeyDown:function(t){27===t.keyCode&&(this._finish(),this._clearDeferredResetState(),this._resetState())}}),Ct=(A.addInitHook("addHandler","boxZoom",_t),A.mergeOptions({doubleClickZoom:!0}),n.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var e=this._map,i=e.getZoom(),n=e.options.zoomDelta,i=t.originalEvent.shiftKey?i-n:i+n;"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}})),Zt=(A.addInitHook("addHandler","doubleClickZoom",Ct),A.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0}),n.extend({addHooks:function(){var t;this._draggable||(t=this._map,this._draggable=new Xe(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))),M(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){z(this._map._container,"leaflet-grab"),z(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t,e=this._map;e._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity?(t=g(this._map.options.maxBounds),this._offsetLimit=_(this._map.latLngToContainerPoint(t.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(t.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))):this._offsetLimit=null,e.fire("movestart").fire("dragstart"),e.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){var e,i;this._map.options.inertia&&(e=this._lastTime=+new Date,i=this._lastPos=this._draggable._absPos||this._draggable._newPos,this._positions.push(i),this._times.push(e),this._prunePositions(e)),this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;1<this._positions.length&&50<t-this._times[0];)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,e){return t-(t-e)*this._viscosity},_onPreDragLimit:function(){var t,e;this._viscosity&&this._offsetLimit&&(t=this._draggable._newPos.subtract(this._draggable._startPos),e=this._offsetLimit,t.x<e.min.x&&(t.x=this._viscousLimit(t.x,e.min.x)),t.y<e.min.y&&(t.y=this._viscousLimit(t.y,e.min.y)),t.x>e.max.x&&(t.x=this._viscousLimit(t.x,e.max.x)),t.y>e.max.y&&(t.y=this._viscousLimit(t.y,e.max.y)),this._draggable._newPos=this._draggable._startPos.add(t))},_onPreDragWrap:function(){var t=this._worldWidth,e=Math.round(t/2),i=this._initialWorldOffset,n=this._draggable._newPos.x,o=(n-e+i)%t+e-i,n=(n+e+i)%t-e-i,t=Math.abs(o+i)<Math.abs(n+i)?o:n;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=t},_onDragEnd:function(t){var e,i,n,o,s=this._map,r=s.options,a=!r.inertia||t.noInertia||this._times.length<2;s.fire("dragend",t),!a&&(this._prunePositions(+new Date),t=this._lastPos.subtract(this._positions[0]),a=(this._lastTime-this._times[0])/1e3,e=r.easeLinearity,a=(t=t.multiplyBy(e/a)).distanceTo([0,0]),i=Math.min(r.inertiaMaxSpeed,a),t=t.multiplyBy(i/a),n=i/(r.inertiaDeceleration*e),(o=t.multiplyBy(-n/2).round()).x||o.y)?(o=s._limitOffset(o,s.options.maxBounds),x(function(){s.panBy(o,{duration:n,easeLinearity:e,noMoveStart:!0,animate:!0})})):s.fire("moveend")}})),St=(A.addInitHook("addHandler","dragging",Zt),A.mergeOptions({keyboard:!0,keyboardPanDelta:80}),n.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),S(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),k(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){var t,e,i;this._focused||(i=document.body,t=document.documentElement,e=i.scrollTop||t.scrollTop,i=i.scrollLeft||t.scrollLeft,this._map._container.focus(),window.scrollTo(i,e))},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){for(var e=this._panKeys={},i=this.keyCodes,n=0,o=i.left.length;n<o;n++)e[i.left[n]]=[-1*t,0];for(n=0,o=i.right.length;n<o;n++)e[i.right[n]]=[t,0];for(n=0,o=i.down.length;n<o;n++)e[i.down[n]]=[0,t];for(n=0,o=i.up.length;n<o;n++)e[i.up[n]]=[0,-1*t]},_setZoomDelta:function(t){for(var e=this._zoomKeys={},i=this.keyCodes,n=0,o=i.zoomIn.length;n<o;n++)e[i.zoomIn[n]]=t;for(n=0,o=i.zoomOut.length;n<o;n++)e[i.zoomOut[n]]=-t},_addHooks:function(){S(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){k(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var e,i,n=t.keyCode,o=this._map;if(n in this._panKeys)o._panAnim&&o._panAnim._inProgress||(i=this._panKeys[n],t.shiftKey&&(i=m(i).multiplyBy(3)),o.options.maxBounds&&(i=o._limitOffset(m(i),o.options.maxBounds)),o.options.worldCopyJump?(e=o.wrapLatLng(o.unproject(o.project(o.getCenter()).add(i))),o.panTo(e)):o.panBy(i));else if(n in this._zoomKeys)o.setZoom(o.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[n]);else{if(27!==n||!o._popup||!o._popup.options.closeOnEscapeKey)return;o.closePopup()}Re(t)}}})),Et=(A.addInitHook("addHandler","keyboard",St),A.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60}),n.extend({addHooks:function(){S(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){k(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var e=He(t),i=this._map.options.wheelDebounceTime,e=(this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date),Math.max(i-(+new Date-this._startTime),0));clearTimeout(this._timer),this._timer=setTimeout(a(this._performZoom,this),e),Re(t)},_performZoom:function(){var t=this._map,e=t.getZoom(),i=this._map.options.zoomSnap||0,n=(t._stop(),this._delta/(4*this._map.options.wheelPxPerZoomLevel)),n=4*Math.log(2/(1+Math.exp(-Math.abs(n))))/Math.LN2,i=i?Math.ceil(n/i)*i:n,n=t._limitZoom(e+(0<this._delta?i:-i))-e;this._delta=0,this._startTime=null,n&&("center"===t.options.scrollWheelZoom?t.setZoom(e+n):t.setZoomAround(this._lastMousePos,e+n))}})),kt=(A.addInitHook("addHandler","scrollWheelZoom",Et),A.mergeOptions({tapHold:b.touchNative&&b.safari&&b.mobile,tapTolerance:15}),n.extend({addHooks:function(){S(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){k(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){var e;clearTimeout(this._holdTimeout),1===t.touches.length&&(e=t.touches[0],this._startPos=this._newPos=new p(e.clientX,e.clientY),this._holdTimeout=setTimeout(a(function(){this._cancel(),this._isTapValid()&&(S(document,"touchend",O),S(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",e))},this),600),S(document,"touchend touchcancel contextmenu",this._cancel,this),S(document,"touchmove",this._onMove,this))},_cancelClickPrevent:function t(){k(document,"touchend",O),k(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),k(document,"touchend touchcancel contextmenu",this._cancel,this),k(document,"touchmove",this._onMove,this)},_onMove:function(t){t=t.touches[0];this._newPos=new p(t.clientX,t.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,e){t=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:e.screenX,screenY:e.screenY,clientX:e.clientX,clientY:e.clientY});t._simulated=!0,e.target.dispatchEvent(t)}})),Ot=(A.addInitHook("addHandler","tapHold",kt),A.mergeOptions({touchZoom:b.touch,bounceAtZoomLimits:!0}),n.extend({addHooks:function(){M(this._map._container,"leaflet-touch-zoom"),S(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){z(this._map._container,"leaflet-touch-zoom"),k(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var e,i,n=this._map;!t.touches||2!==t.touches.length||n._animatingZoom||this._zooming||(e=n.mouseEventToContainerPoint(t.touches[0]),i=n.mouseEventToContainerPoint(t.touches[1]),this._centerPoint=n.getSize()._divideBy(2),this._startLatLng=n.containerPointToLatLng(this._centerPoint),"center"!==n.options.touchZoom&&(this._pinchStartLatLng=n.containerPointToLatLng(e.add(i)._divideBy(2))),this._startDist=e.distanceTo(i),this._startZoom=n.getZoom(),this._moved=!1,this._zooming=!0,n._stop(),S(document,"touchmove",this._onTouchMove,this),S(document,"touchend touchcancel",this._onTouchEnd,this),O(t))},_onTouchMove:function(t){if(t.touches&&2===t.touches.length&&this._zooming){var e=this._map,i=e.mouseEventToContainerPoint(t.touches[0]),n=e.mouseEventToContainerPoint(t.touches[1]),o=i.distanceTo(n)/this._startDist;if(this._zoom=e.getScaleZoom(o,this._startZoom),!e.options.bounceAtZoomLimits&&(this._zoom<e.getMinZoom()&&o<1||this._zoom>e.getMaxZoom()&&1<o)&&(this._zoom=e._limitZoom(this._zoom)),"center"===e.options.touchZoom){if(this._center=this._startLatLng,1==o)return}else{i=i._add(n)._divideBy(2)._subtract(this._centerPoint);if(1==o&&0===i.x&&0===i.y)return;this._center=e.unproject(e.project(this._pinchStartLatLng,this._zoom).subtract(i),this._zoom)}this._moved||(e._moveStart(!0,!1),this._moved=!0),r(this._animRequest);n=a(e._move,e,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=x(n,this,!0),O(t)}},_onTouchEnd:function(){this._moved&&this._zooming?(this._zooming=!1,r(this._animRequest),k(document,"touchmove",this._onTouchMove,this),k(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))):this._zooming=!1}})),Xi=(A.addInitHook("addHandler","touchZoom",Ot),A.BoxZoom=_t,A.DoubleClickZoom=Ct,A.Drag=Zt,A.Keyboard=St,A.ScrollWheelZoom=Et,A.TapHold=kt,A.TouchZoom=Ot,t.Bounds=f,t.Browser=b,t.CRS=ot,t.Canvas=Fi,t.Circle=vi,t.CircleMarker=gi,t.Class=et,t.Control=B,t.DivIcon=Ri,t.DivOverlay=Ai,t.DomEvent=mt,t.DomUtil=pt,t.Draggable=Xe,t.Evented=it,t.FeatureGroup=ci,t.GeoJSON=wi,t.GridLayer=Ni,t.Handler=n,t.Icon=di,t.ImageOverlay=Ei,t.LatLng=v,t.LatLngBounds=s,t.Layer=o,t.LayerGroup=ui,t.LineUtil=vt,t.Map=A,t.Marker=mi,t.Mixin=ft,t.Path=fi,t.Point=p,t.PolyUtil=gt,t.Polygon=xi,t.Polyline=yi,t.Popup=Bi,t.PosAnimation=Fe,t.Projection=wt,t.Rectangle=Yi,t.Renderer=Wi,t.SVG=Gi,t.SVGOverlay=Oi,t.TileLayer=Di,t.Tooltip=Ii,t.Transformation=at,t.Util=tt,t.VideoOverlay=ki,t.bind=a,t.bounds=_,t.canvas=Ui,t.circle=function(t,e,i){return new vi(t,e,i)},t.circleMarker=function(t,e){return new gi(t,e)},t.control=Ue,t.divIcon=function(t){return new Ri(t)},t.extend=l,t.featureGroup=function(t,e){return new ci(t,e)},t.geoJSON=Si,t.geoJson=Mt,t.gridLayer=function(t){return new Ni(t)},t.icon=function(t){return new di(t)},t.imageOverlay=function(t,e,i){return new Ei(t,e,i)},t.latLng=w,t.latLngBounds=g,t.layerGroup=function(t,e){return new ui(t,e)},t.map=function(t,e){return new A(t,e)},t.marker=function(t,e){return new mi(t,e)},t.point=m,t.polygon=function(t,e){return new xi(t,e)},t.polyline=function(t,e){return new yi(t,e)},t.popup=function(t,e){return new Bi(t,e)},t.rectangle=function(t,e){return new Yi(t,e)},t.setOptions=c,t.stamp=h,t.svg=Ki,t.svgOverlay=function(t,e,i){return new Oi(t,e,i)},t.tileLayer=ji,t.tooltip=function(t,e){return new Ii(t,e)},t.transformation=ht,t.version="1.9.4",t.videoOverlay=function(t,e,i){return new ki(t,e,i)},window.L);t.noConflict=function(){return window.L=Xi,this},window.L=t});!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e.Leaflet=e.Leaflet||{},e.Leaflet.markercluster=e.Leaflet.markercluster||{}))}(this,function(e){"use strict";var t=L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,clusterPane:L.Marker.prototype.options.pane,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:null,removeOutsideVisibleBounds:!0,animate:!0,animateAddingMarkers:!1,spiderfyDistanceMultiplier:1,spiderLegPolylineOptions:{weight:1.5,color:"#222",opacity:.5},chunkedLoading:!1,chunkInterval:200,chunkDelay:50,chunkProgress:null,polygonOptions:{}},initialize:function(e){L.Util.setOptions(this,e),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.addEventParent(this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.addEventParent(this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[],this._childMarkerEventHandlers={dragstart:this._childMarkerDragStart,move:this._childMarkerMoved,dragend:this._childMarkerDragEnd};var t=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,t?this._withAnimation:this._noAnimation),this._markerCluster=t?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(e){if(e instanceof L.LayerGroup)return this.addLayers([e]);if(!e.getLatLng)return this._nonPointGroup.addLayer(e),this.fire("layeradd",{layer:e}),this;if(!this._map)return this._needsClustering.push(e),this.fire("layeradd",{layer:e}),this;if(this.hasLayer(e))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(e,this._maxZoom),this.fire("layeradd",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons();var t=e,i=this._zoom;if(e.__parent)for(;t.__parent._zoom>=i;)t=t.__parent;return this._currentShownBounds.contains(t.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(e,t):this._animationAddLayerNonAnimated(e,t)),this},removeLayer:function(e){return e instanceof L.LayerGroup?this.removeLayers([e]):e.getLatLng?this._map?e.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(e)),this._removeLayer(e,!0),this.fire("layerremove",{layer:e}),this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),e.off(this._childMarkerEventHandlers,this),this._featureGroup.hasLayer(e)&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,e)&&this.hasLayer(e)&&this._needsRemoving.push({layer:e,latlng:e._latlng}),this.fire("layerremove",{layer:e}),this):(this._nonPointGroup.removeLayer(e),this.fire("layerremove",{layer:e}),this)},addLayers:function(e,t){if(!L.Util.isArray(e))return this.addLayer(e);var i,n=this._featureGroup,r=this._nonPointGroup,s=this.options.chunkedLoading,o=this.options.chunkInterval,a=this.options.chunkProgress,h=e.length,l=0,u=!0;if(this._map){var _=(new Date).getTime(),d=L.bind(function(){for(var c=(new Date).getTime();h>l;l++){if(s&&0===l%200){var p=(new Date).getTime()-c;if(p>o)break}if(i=e[l],i instanceof L.LayerGroup)u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length;else if(i.getLatLng){if(!this.hasLayer(i)&&(this._addLayer(i,this._maxZoom),t||this.fire("layeradd",{layer:i}),i.__parent&&2===i.__parent.getChildCount())){var f=i.__parent.getAllChildMarkers(),m=f[0]===i?f[1]:f[0];n.removeLayer(m)}}else r.addLayer(i),t||this.fire("layeradd",{layer:i})}a&&a(l,h,(new Date).getTime()-_),l===h?(this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else for(var c=this._needsClustering;h>l;l++)i=e[l],i instanceof L.LayerGroup?(u&&(e=e.slice(),u=!1),this._extractNonGroupLayers(i,e),h=e.length):i.getLatLng?this.hasLayer(i)||c.push(i):r.addLayer(i);return this},removeLayers:function(e){var t,i,n=e.length,r=this._featureGroup,s=this._nonPointGroup,o=!0;if(!this._map){for(t=0;n>t;t++)i=e[t],i instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),n=e.length):(this._arraySplice(this._needsClustering,i),s.removeLayer(i),this.hasLayer(i)&&this._needsRemoving.push({layer:i,latlng:i._latlng}),this.fire("layerremove",{layer:i}));return this}if(this._unspiderfy){this._unspiderfy();var a=e.slice(),h=n;for(t=0;h>t;t++)i=a[t],i instanceof L.LayerGroup?(this._extractNonGroupLayers(i,a),h=a.length):this._unspiderfyLayer(i)}for(t=0;n>t;t++)i=e[t],i instanceof L.LayerGroup?(o&&(e=e.slice(),o=!1),this._extractNonGroupLayers(i,e),n=e.length):i.__parent?(this._removeLayer(i,!0,!0),this.fire("layerremove",{layer:i}),r.hasLayer(i)&&(r.removeLayer(i),i.clusterShow&&i.clusterShow())):(s.removeLayer(i),this.fire("layerremove",{layer:i}));return this._topClusterLevel._recalculateBounds(),this._refreshClustersIcons(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),this},clearLayers:function(){return this._map||(this._needsClustering=[],this._needsRemoving=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(e){e.off(this._childMarkerEventHandlers,this),delete e.__parent},this),this._map&&this._generateInitialClusters(),this},getBounds:function(){var e=new L.LatLngBounds;this._topClusterLevel&&e.extend(this._topClusterLevel._bounds);for(var t=this._needsClustering.length-1;t>=0;t--)e.extend(this._needsClustering[t].getLatLng());return e.extend(this._nonPointGroup.getBounds()),e},eachLayer:function(e,t){var i,n,r,s=this._needsClustering.slice(),o=this._needsRemoving;for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(s),n=s.length-1;n>=0;n--){for(i=!0,r=o.length-1;r>=0;r--)if(o[r].layer===s[n]){i=!1;break}i&&e.call(t,s[n])}this._nonPointGroup.eachLayer(e,t)},getLayers:function(){var e=[];return this.eachLayer(function(t){e.push(t)}),e},getLayer:function(e){var t=null;return e=parseInt(e,10),this.eachLayer(function(i){L.stamp(i)===e&&(t=i)}),t},hasLayer:function(e){if(!e)return!1;var t,i=this._needsClustering;for(t=i.length-1;t>=0;t--)if(i[t]===e)return!0;for(i=this._needsRemoving,t=i.length-1;t>=0;t--)if(i[t].layer===e)return!1;return!(!e.__parent||e.__parent._group!==this)||this._nonPointGroup.hasLayer(e)},zoomToShowLayer:function(e,t){"function"!=typeof t&&(t=function(){});var i=function(){!e._icon&&!e.__parent._icon||this._inZoomAnimation||(this._map.off("moveend",i,this),this.off("animationend",i,this),e._icon?t():e.__parent._icon&&(this.once("spiderfied",t,this),e.__parent.spiderfy()))};e._icon&&this._map.getBounds().contains(e.getLatLng())?t():e.__parent._zoom<Math.round(this._map._zoom)?(this._map.on("moveend",i,this),this._map.panTo(e.getLatLng())):(this._map.on("moveend",i,this),this.on("animationend",i,this),e.__parent.zoomToBounds())},onAdd:function(e){this._map=e;var t,i,n;if(!isFinite(this._map.getMaxZoom()))throw"Map has no maxZoom specified";for(this._featureGroup.addTo(e),this._nonPointGroup.addTo(e),this._gridClusters||this._generateInitialClusters(),this._maxLat=e.options.crs.projection.MAX_LATITUDE,t=0,i=this._needsRemoving.length;i>t;t++)n=this._needsRemoving[t],n.newlatlng=n.layer._latlng,n.layer._latlng=n.latlng;for(t=0,i=this._needsRemoving.length;i>t;t++)n=this._needsRemoving[t],this._removeLayer(n.layer,!0),n.layer._latlng=n.newlatlng;this._needsRemoving=[],this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds(),this._map.on("zoomend",this._zoomEnd,this),this._map.on("moveend",this._moveEnd,this),this._spiderfierOnAdd&&this._spiderfierOnAdd(),this._bindEvents(),i=this._needsClustering,this._needsClustering=[],this.addLayers(i,!0)},onRemove:function(e){e.off("zoomend",this._zoomEnd,this),e.off("moveend",this._moveEnd,this),this._unbindEvents(),this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim",""),this._spiderfierOnRemove&&this._spiderfierOnRemove(),delete this._maxLat,this._hideCoverage(),this._featureGroup.remove(),this._nonPointGroup.remove(),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(e){for(var t=e;t&&!t._icon;)t=t.__parent;return t||null},_arraySplice:function(e,t){for(var i=e.length-1;i>=0;i--)if(e[i]===t)return e.splice(i,1),!0},_removeFromGridUnclustered:function(e,t){for(var i=this._map,n=this._gridUnclustered,r=Math.floor(this._map.getMinZoom());t>=r&&n[t].removeObject(e,i.project(e.getLatLng(),t));t--);},_childMarkerDragStart:function(e){e.target.__dragStart=e.target._latlng},_childMarkerMoved:function(e){if(!this._ignoreMove&&!e.target.__dragStart){var t=e.target._popup&&e.target._popup.isOpen();this._moveChild(e.target,e.oldLatLng,e.latlng),t&&e.target.openPopup()}},_moveChild:function(e,t,i){e._latlng=t,this.removeLayer(e),e._latlng=i,this.addLayer(e)},_childMarkerDragEnd:function(e){var t=e.target.__dragStart;delete e.target.__dragStart,t&&this._moveChild(e.target,t,e.target._latlng)},_removeLayer:function(e,t,i){var n=this._gridClusters,r=this._gridUnclustered,s=this._featureGroup,o=this._map,a=Math.floor(this._map.getMinZoom());t&&this._removeFromGridUnclustered(e,this._maxZoom);var h,l=e.__parent,u=l._markers;for(this._arraySplice(u,e);l&&(l._childCount--,l._boundsNeedUpdate=!0,!(l._zoom<a));)t&&l._childCount<=1?(h=l._markers[0]===e?l._markers[1]:l._markers[0],n[l._zoom].removeObject(l,o.project(l._cLatLng,l._zoom)),r[l._zoom].addObject(h,o.project(h.getLatLng(),l._zoom)),this._arraySplice(l.__parent._childClusters,l),l.__parent._markers.push(h),h.__parent=l.__parent,l._icon&&(s.removeLayer(l),i||s.addLayer(h))):l._iconNeedsUpdate=!0,l=l.__parent;delete e.__parent},_isOrIsParent:function(e,t){for(;t;){if(e===t)return!0;t=t.parentNode}return!1},fire:function(e,t,i){if(t&&t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;e="cluster"+e}L.FeatureGroup.prototype.fire.call(this,e,t,i)},listens:function(e,t){return L.FeatureGroup.prototype.listens.call(this,e,t)||L.FeatureGroup.prototype.listens.call(this,"cluster"+e,t)},_defaultIconCreateFunction:function(e){var t=e.getChildCount(),i=" marker-cluster-";return i+=10>t?"small":100>t?"medium":"large",new L.DivIcon({html:"<div><span>"+t+"</span></div>",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var e=this._map,t=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick;(t||n)&&this.on("clusterclick",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),e.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(e){for(var t=e.layer,i=t;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===t._childCount&&this.options.spiderfyOnMaxZoom?t.spiderfy():this.options.zoomToBoundsOnClick&&t.zoomToBounds(),e.originalEvent&&13===e.originalEvent.keyCode&&this._map._container.focus()},_showCoverage:function(e){var t=this._map;this._inZoomAnimation||(this._shownPolygon&&t.removeLayer(this._shownPolygon),e.layer.getChildCount()>2&&e.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(e.layer.getConvexHull(),this.options.polygonOptions),t.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var e=this.options.spiderfyOnMaxZoom,t=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this._map;(e||i)&&this.off("clusterclick",this._zoomOrSpiderfy,this),t&&(this.off("clustermouseover",this._showCoverage,this),this.off("clustermouseout",this._hideCoverage,this),n.off("zoomend",this._hideCoverage,this))},_zoomEnd:function(){this._map&&(this._mergeSplitClusters(),this._zoom=Math.round(this._map._zoom),this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var e=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,Math.round(this._map._zoom),e),this._currentShownBounds=e}},_generateInitialClusters:function(){var e=Math.ceil(this._map.getMaxZoom()),t=Math.floor(this._map.getMinZoom()),i=this.options.maxClusterRadius,n=i;"function"!=typeof i&&(n=function(){return i}),null!==this.options.disableClusteringAtZoom&&(e=this.options.disableClusteringAtZoom-1),this._maxZoom=e,this._gridClusters={},this._gridUnclustered={};for(var r=e;r>=t;r--)this._gridClusters[r]=new L.DistanceGrid(n(r)),this._gridUnclustered[r]=new L.DistanceGrid(n(r));this._topClusterLevel=new this._markerCluster(this,t-1)},_addLayer:function(e,t){var i,n,r=this._gridClusters,s=this._gridUnclustered,o=Math.floor(this._map.getMinZoom());for(this.options.singleMarkerMode&&this._overrideMarkerIcon(e),e.on(this._childMarkerEventHandlers,this);t>=o;t--){i=this._map.project(e.getLatLng(),t);var a=r[t].getNearObject(i);if(a)return a._addChild(e),e.__parent=a,void 0;if(a=s[t].getNearObject(i)){var h=a.__parent;h&&this._removeLayer(a,!1);var l=new this._markerCluster(this,t,a,e);r[t].addObject(l,this._map.project(l._cLatLng,t)),a.__parent=l,e.__parent=l;var u=l;for(n=t-1;n>h._zoom;n--)u=new this._markerCluster(this,n,u),r[n].addObject(u,this._map.project(a.getLatLng(),n));return h._addChild(u),this._removeFromGridUnclustered(a,t),void 0}s[t].addObject(e,i)}this._topClusterLevel._addChild(e),e.__parent=this._topClusterLevel},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(e){e instanceof L.MarkerCluster&&e._iconNeedsUpdate&&e._updateIcon()})},_enqueue:function(e){this._queue.push(e),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var e=0;e<this._queue.length;e++)this._queue[e].call(this);this._queue.length=0,clearTimeout(this._queueTimeout),this._queueTimeout=null},_mergeSplitClusters:function(){var e=Math.round(this._map._zoom);this._processQueue(),this._zoom<e&&this._currentShownBounds.intersects(this._getExpandedVisibleBounds())?(this._animationStart(),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),this._zoom,this._getExpandedVisibleBounds()),this._animationZoomIn(this._zoom,e)):this._zoom>e?(this._animationStart(),this._animationZoomOut(this._zoom,e)):this._moveEnd()},_getExpandedVisibleBounds:function(){return this.options.removeOutsideVisibleBounds?L.Browser.mobile?this._checkBoundsMaxLat(this._map.getBounds()):this._checkBoundsMaxLat(this._map.getBounds().pad(1)):this._mapBoundsInfinite},_checkBoundsMaxLat:function(e){var t=this._maxLat;return void 0!==t&&(e.getNorth()>=t&&(e._northEast.lat=1/0),e.getSouth()<=-t&&(e._southWest.lat=-1/0)),e},_animationAddLayerNonAnimated:function(e,t){if(t===e)this._featureGroup.addLayer(e);else if(2===t._childCount){t._addToMap();var i=t.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else t._updateIcon()},_extractNonGroupLayers:function(e,t){var i,n=e.getLayers(),r=0;for(t=t||[];r<n.length;r++)i=n[r],i instanceof L.LayerGroup?this._extractNonGroupLayers(i,t):t.push(i);return t},_overrideMarkerIcon:function(e){var t=e.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){return[e]}});return t}});L.MarkerClusterGroup.include({_mapBoundsInfinite:new L.LatLngBounds(new L.LatLng(-1/0,-1/0),new L.LatLng(1/0,1/0))}),L.MarkerClusterGroup.include({_noAnimation:{_animationStart:function(){},_animationZoomIn:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(e,t){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(e,t){this._animationAddLayerNonAnimated(e,t)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(e,t){var i,n=this._getExpandedVisibleBounds(),r=this._featureGroup,s=Math.floor(this._map.getMinZoom());this._ignoreMove=!0,this._topClusterLevel._recursively(n,e,s,function(s){var o,a=s._latlng,h=s._markers;for(n.contains(a)||(a=null),s._isSingleParent()&&e+1===t?(r.removeLayer(s),s._recursivelyAddChildrenToMap(null,t,n)):(s.clusterHide(),s._recursivelyAddChildrenToMap(a,t,n)),i=h.length-1;i>=0;i--)o=h[i],n.contains(o._latlng)||r.removeLayer(o)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(n,t),r.eachLayer(function(e){e instanceof L.MarkerCluster||!e._icon||e.clusterShow()}),this._topClusterLevel._recursively(n,e,t,function(e){e._recursivelyRestoreChildPositions(t)}),this._ignoreMove=!1,this._enqueue(function(){this._topClusterLevel._recursively(n,e,s,function(e){r.removeLayer(e),e.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(e,t){this._animationZoomOutSingle(this._topClusterLevel,e-1,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,t,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,Math.floor(this._map.getMinZoom()),e,this._getExpandedVisibleBounds())},_animationAddLayer:function(e,t){var i=this,n=this._featureGroup;n.addLayer(e),t!==e&&(t._childCount>2?(t._updateIcon(),this._forceLayout(),this._animationStart(),e._setPos(this._map.latLngToLayerPoint(t.getLatLng())),e.clusterHide(),this._enqueue(function(){n.removeLayer(e),e.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(t,this._map.getMaxZoom(),this._zoom)))}},_animationZoomOutSingle:function(e,t,i){var n=this._getExpandedVisibleBounds(),r=Math.floor(this._map.getMinZoom());e._recursivelyAnimateChildrenInAndAddSelfToMap(n,r,t+1,i);var s=this;this._forceLayout(),e._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(1===e._childCount){var o=e._markers[0];this._ignoreMove=!0,o.setLatLng(o.getLatLng()),this._ignoreMove=!1,o.clusterShow&&o.clusterShow()}else e._recursively(n,i,r,function(e){e._recursivelyRemoveChildrenFromMap(n,r,t+1)});s._animationEnd()})},_animationEnd:function(){this._map&&(this._map._mapPane.className=this._map._mapPane.className.replace(" leaflet-cluster-anim","")),this._inZoomAnimation--,this.fire("animationend")},_forceLayout:function(){L.Util.falseFn(document.body.offsetWidth)}}),L.markerClusterGroup=function(e){return new L.MarkerClusterGroup(e)};var i=L.MarkerCluster=L.Marker.extend({options:L.Icon.prototype.options,initialize:function(e,t,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this,pane:e.options.clusterPane}),this._group=e,this._zoom=t,this._markers=[],this._childClusters=[],this._childCount=0,this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._bounds=new L.LatLngBounds,i&&this._addChild(i),n&&this._addChild(n)},getAllChildMarkers:function(e,t){e=e||[];for(var i=this._childClusters.length-1;i>=0;i--)this._childClusters[i].getAllChildMarkers(e);for(var n=this._markers.length-1;n>=0;n--)t&&this._markers[n].__dragStart||e.push(this._markers[n]);return e},getChildCount:function(){return this._childCount},zoomToBounds:function(e){for(var t,i=this._childClusters.slice(),n=this._group._map,r=n.getBoundsZoom(this._bounds),s=this._zoom+1,o=n.getZoom();i.length>0&&r>s;){s++;var a=[];for(t=0;t<i.length;t++)a=a.concat(i[t]._childClusters);i=a}r>s?this._group._map.setView(this._latlng,s):o>=r?this._group._map.setView(this._latlng,o+1):this._group._map.fitBounds(this._bounds,e)},getBounds:function(){var e=new L.LatLngBounds;return e.extend(this._bounds),e},_updateIcon:function(){this._iconNeedsUpdate=!0,this._icon&&this.setIcon(this)},createIcon:function(){return this._iconNeedsUpdate&&(this._iconObj=this._group.options.iconCreateFunction(this),this._iconNeedsUpdate=!1),this._iconObj.createIcon()},createShadow:function(){return this._iconObj.createShadow()},_addChild:function(e,t){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(e),e instanceof L.MarkerCluster?(t||(this._childClusters.push(e),e.__parent=this),this._childCount+=e._childCount):(t||this._markers.push(e),this._childCount++),this.__parent&&this.__parent._addChild(e,!0)},_setClusterCenter:function(e){this._cLatLng||(this._cLatLng=e._cLatLng||e._latlng)},_resetBounds:function(){var e=this._bounds;e._southWest&&(e._southWest.lat=1/0,e._southWest.lng=1/0),e._northEast&&(e._northEast.lat=-1/0,e._northEast.lng=-1/0)},_recalculateBounds:function(){var e,t,i,n,r=this._markers,s=this._childClusters,o=0,a=0,h=this._childCount;if(0!==h){for(this._resetBounds(),e=0;e<r.length;e++)i=r[e]._latlng,this._bounds.extend(i),o+=i.lat,a+=i.lng;for(e=0;e<s.length;e++)t=s[e],t._boundsNeedUpdate&&t._recalculateBounds(),this._bounds.extend(t._bounds),i=t._wLatLng,n=t._childCount,o+=i.lat*n,a+=i.lng*n;this._latlng=this._wLatLng=new L.LatLng(o/h,a/h),this._boundsNeedUpdate=!1}},_addToMap:function(e){e&&(this._backupLatlng=this._latlng,this.setLatLng(e)),this._group._featureGroup.addLayer(this)},_recursivelyAnimateChildrenIn:function(e,t,i){this._recursively(e,this._group._map.getMinZoom(),i-1,function(e){var i,n,r=e._markers;for(i=r.length-1;i>=0;i--)n=r[i],n._icon&&(n._setPos(t),n.clusterHide())},function(e){var i,n,r=e._childClusters;for(i=r.length-1;i>=0;i--)n=r[i],n._icon&&(n._setPos(t),n.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(e,t,i,n){this._recursively(e,n,t,function(r){r._recursivelyAnimateChildrenIn(e,r._group._map.latLngToLayerPoint(r.getLatLng()).round(),i),r._isSingleParent()&&i-1===n?(r.clusterShow(),r._recursivelyRemoveChildrenFromMap(e,t,i)):r.clusterHide(),r._addToMap()})},_recursivelyBecomeVisible:function(e,t){this._recursively(e,this._group._map.getMinZoom(),t,null,function(e){e.clusterShow()})},_recursivelyAddChildrenToMap:function(e,t,i){this._recursively(i,this._group._map.getMinZoom()-1,t,function(n){if(t!==n._zoom)for(var r=n._markers.length-1;r>=0;r--){var s=n._markers[r];i.contains(s._latlng)&&(e&&(s._backupLatlng=s.getLatLng(),s.setLatLng(e),s.clusterHide&&s.clusterHide()),n._group._featureGroup.addLayer(s))}},function(t){t._addToMap(e)})},_recursivelyRestoreChildPositions:function(e){for(var t=this._markers.length-1;t>=0;t--){var i=this._markers[t];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(e-1===this._zoom)for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._restorePosition();else for(var r=this._childClusters.length-1;r>=0;r--)this._childClusters[r]._recursivelyRestoreChildPositions(e)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(e,t,i,n){var r,s;this._recursively(e,t-1,i-1,function(e){for(s=e._markers.length-1;s>=0;s--)r=e._markers[s],n&&n.contains(r._latlng)||(e._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())},function(e){for(s=e._childClusters.length-1;s>=0;s--)r=e._childClusters[s],n&&n.contains(r._latlng)||(e._group._featureGroup.removeLayer(r),r.clusterShow&&r.clusterShow())})},_recursively:function(e,t,i,n,r){var s,o,a=this._childClusters,h=this._zoom;if(h>=t&&(n&&n(this),r&&h===i&&r(this)),t>h||i>h)for(s=a.length-1;s>=0;s--)o=a[s],o._boundsNeedUpdate&&o._recalculateBounds(),e.intersects(o._bounds)&&o._recursively(e,t,i,n,r)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}});L.Marker.include({clusterHide:function(){var e=this.options.opacity;return this.setOpacity(0),this.options.opacity=e,this},clusterShow:function(){return this.setOpacity(this.options.opacity)}}),L.DistanceGrid=function(e){this._cellSize=e,this._sqCellSize=e*e,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(e,t){var i=this._getCoord(t.x),n=this._getCoord(t.y),r=this._grid,s=r[n]=r[n]||{},o=s[i]=s[i]||[],a=L.Util.stamp(e);this._objectPoint[a]=t,o.push(e)},updateObject:function(e,t){this.removeObject(e),this.addObject(e,t)},removeObject:function(e,t){var i,n,r=this._getCoord(t.x),s=this._getCoord(t.y),o=this._grid,a=o[s]=o[s]||{},h=a[r]=a[r]||[];for(delete this._objectPoint[L.Util.stamp(e)],i=0,n=h.length;n>i;i++)if(h[i]===e)return h.splice(i,1),1===n&&delete a[r],!0},eachObject:function(e,t){var i,n,r,s,o,a,h,l=this._grid;for(i in l){o=l[i];for(n in o)for(a=o[n],r=0,s=a.length;s>r;r++)h=e.call(t,a[r]),h&&(r--,s--)}},getNearObject:function(e){var t,i,n,r,s,o,a,h,l=this._getCoord(e.x),u=this._getCoord(e.y),_=this._objectPoint,d=this._sqCellSize,c=null;for(t=u-1;u+1>=t;t++)if(r=this._grid[t])for(i=l-1;l+1>=i;i++)if(s=r[i])for(n=0,o=s.length;o>n;n++)a=s[n],h=this._sqDist(_[L.Util.stamp(a)],e),(d>h||d>=h&&null===c)&&(d=h,c=a);return c},_getCoord:function(e){var t=Math.floor(e/this._cellSize);return isFinite(t)?t:e},_sqDist:function(e,t){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n}},function(){L.QuickHull={getDistant:function(e,t){var i=t[1].lat-t[0].lat,n=t[0].lng-t[1].lng;return n*(e.lat-t[0].lat)+i*(e.lng-t[0].lng)},findMostDistantPointFromBaseLine:function(e,t){var i,n,r,s=0,o=null,a=[];for(i=t.length-1;i>=0;i--)n=t[i],r=this.getDistant(n,e),r>0&&(a.push(n),r>s&&(s=r,o=n));return{maxPoint:o,newPoints:a}},buildConvexHull:function(e,t){var i=[],n=this.findMostDistantPointFromBaseLine(e,t);return n.maxPoint?(i=i.concat(this.buildConvexHull([e[0],n.maxPoint],n.newPoints)),i=i.concat(this.buildConvexHull([n.maxPoint,e[1]],n.newPoints))):[e[0]]},getConvexHull:function(e){var t,i=!1,n=!1,r=!1,s=!1,o=null,a=null,h=null,l=null,u=null,_=null;for(t=e.length-1;t>=0;t--){var d=e[t];(i===!1||d.lat>i)&&(o=d,i=d.lat),(n===!1||d.lat<n)&&(a=d,n=d.lat),(r===!1||d.lng>r)&&(h=d,r=d.lng),(s===!1||d.lng<s)&&(l=d,s=d.lng)}n!==i?(_=a,u=o):(_=l,u=h);var c=[].concat(this.buildConvexHull([_,u],e),this.buildConvexHull([u,_],e));return c}}}(),L.MarkerCluster.include({getConvexHull:function(){var e,t,i=this.getAllChildMarkers(),n=[];for(t=i.length-1;t>=0;t--)e=i[t].getLatLng(),n.push(e);return L.QuickHull.getConvexHull(n)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:0,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var e,t=this.getAllChildMarkers(null,!0),i=this._group,n=i._map,r=n.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,t.length>=this._circleSpiralSwitchover?e=this._generatePointsSpiral(t.length,r):(r.y+=10,e=this._generatePointsCircle(t.length,r)),this._animationSpiderfy(t,e)}},unspiderfy:function(e){this._group._inZoomAnimation||(this._animationUnspiderfy(e),this._group._spiderfied=null)},_generatePointsCircle:function(e,t){var i,n,r=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+e),s=r/this._2PI,o=this._2PI/e,a=[];for(s=Math.max(s,35),a.length=e,i=0;e>i;i++)n=this._circleStartAngle+i*o,a[i]=new L.Point(t.x+s*Math.cos(n),t.y+s*Math.sin(n))._round();return a},_generatePointsSpiral:function(e,t){var i,n=this._group.options.spiderfyDistanceMultiplier,r=n*this._spiralLengthStart,s=n*this._spiralFootSeparation,o=n*this._spiralLengthFactor*this._2PI,a=0,h=[];for(h.length=e,i=e;i>=0;i--)e>i&&(h[i]=new L.Point(t.x+r*Math.cos(a),t.y+r*Math.sin(a))._round()),a+=s/r+5e-4*i,r+=o/a;return h},_noanimationUnspiderfy:function(){var e,t,i=this._group,n=i._map,r=i._featureGroup,s=this.getAllChildMarkers(null,!0);for(i._ignoreMove=!0,this.setOpacity(1),t=s.length-1;t>=0;t--)e=s[t],r.removeLayer(e),e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng),e.setZIndexOffset&&e.setZIndexOffset(0),e._spiderLeg&&(n.removeLayer(e._spiderLeg),delete e._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:s}),i._ignoreMove=!1,i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(e,t){var i,n,r,s,o=this._group,a=o._map,h=o._featureGroup,l=this._group.options.spiderLegPolylineOptions;for(o._ignoreMove=!0,i=0;i<e.length;i++)s=a.layerPointToLatLng(t[i]),n=e[i],r=new L.Polyline([this._latlng,s],l),a.addLayer(r),n._spiderLeg=r,n._preSpiderfyLatlng=n._latlng,n.setLatLng(s),n.setZIndexOffset&&n.setZIndexOffset(1e6),h.addLayer(n);this.setOpacity(.3),o._ignoreMove=!1,o.fire("spiderfied",{cluster:this,markers:e})},_animationUnspiderfy:function(){this._noanimationUnspiderfy()}}),L.MarkerCluster.include({_animationSpiderfy:function(e,t){var i,n,r,s,o,a,h=this,l=this._group,u=l._map,_=l._featureGroup,d=this._latlng,c=u.latLngToLayerPoint(d),p=L.Path.SVG,f=L.extend({},this._group.options.spiderLegPolylineOptions),m=f.opacity;for(void 0===m&&(m=L.MarkerClusterGroup.prototype.options.spiderLegPolylineOptions.opacity),p?(f.opacity=0,f.className=(f.className||"")+" leaflet-cluster-spider-leg"):f.opacity=m,l._ignoreMove=!0,i=0;i<e.length;i++)n=e[i],a=u.layerPointToLatLng(t[i]),r=new L.Polyline([d,a],f),u.addLayer(r),n._spiderLeg=r,p&&(s=r._path,o=s.getTotalLength()+.1,s.style.strokeDasharray=o,s.style.strokeDashoffset=o),n.setZIndexOffset&&n.setZIndexOffset(1e6),n.clusterHide&&n.clusterHide(),_.addLayer(n),n._setPos&&n._setPos(c);for(l._forceLayout(),l._animationStart(),i=e.length-1;i>=0;i--)a=u.layerPointToLatLng(t[i]),n=e[i],n._preSpiderfyLatlng=n._latlng,n.setLatLng(a),n.clusterShow&&n.clusterShow(),p&&(r=n._spiderLeg,s=r._path,s.style.strokeDashoffset=0,r.setStyle({opacity:m}));this.setOpacity(.3),l._ignoreMove=!1,setTimeout(function(){l._animationEnd(),l.fire("spiderfied",{cluster:h,markers:e})},200)},_animationUnspiderfy:function(e){var t,i,n,r,s,o,a=this,h=this._group,l=h._map,u=h._featureGroup,_=e?l._latLngToNewLayerPoint(this._latlng,e.zoom,e.center):l.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(null,!0),c=L.Path.SVG;for(h._ignoreMove=!0,h._animationStart(),this.setOpacity(1),i=d.length-1;i>=0;i--)t=d[i],t._preSpiderfyLatlng&&(t.closePopup(),t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng,o=!0,t._setPos&&(t._setPos(_),o=!1),t.clusterHide&&(t.clusterHide(),o=!1),o&&u.removeLayer(t),c&&(n=t._spiderLeg,r=n._path,s=r.getTotalLength()+.1,r.style.strokeDashoffset=s,n.setStyle({opacity:0})));h._ignoreMove=!1,setTimeout(function(){var e=0;for(i=d.length-1;i>=0;i--)t=d[i],t._spiderLeg&&e++;for(i=d.length-1;i>=0;i--)t=d[i],t._spiderLeg&&(t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),e>1&&u.removeLayer(t),l.removeLayer(t._spiderLeg),delete t._spiderLeg);h._animationEnd(),h.fire("unspiderfied",{cluster:a,markers:d})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,unspiderfy:function(){this._unspiderfy.apply(this,arguments)},_spiderfierOnAdd:function(){this._map.on("click",this._unspiderfyWrapper,this),this._map.options.zoomAnimation&&this._map.on("zoomstart",this._unspiderfyZoomStart,this),this._map.on("zoomend",this._noanimationUnspiderfy,this),L.Browser.touch||this._map.getRenderer(this)},_spiderfierOnRemove:function(){this._map.off("click",this._unspiderfyWrapper,this),this._map.off("zoomstart",this._unspiderfyZoomStart,this),this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._map.off("zoomend",this._noanimationUnspiderfy,this),this._noanimationUnspiderfy()
39},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(e){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(e))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(e){this._spiderfied&&this._spiderfied.unspiderfy(e)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(e){e._spiderLeg&&(this._featureGroup.removeLayer(e),e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),this._map.removeLayer(e._spiderLeg),delete e._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(e){return e?e instanceof L.MarkerClusterGroup?e=e._topClusterLevel.getAllChildMarkers():e instanceof L.LayerGroup?e=e._layers:e instanceof L.MarkerCluster?e=e.getAllChildMarkers():e instanceof L.Marker&&(e=[e]):e=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(e),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(e),this},_flagParentsIconsNeedUpdate:function(e){var t,i;for(t in e)for(i=e[t].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshSingleMarkerModeMarkers:function(e){var t,i;for(t in e)i=e[t],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(e,t){var i=this.options.icon;return L.setOptions(i,e),this.setIcon(i),t&&this.__parent&&this.__parent._group.refreshClusters(this),this}}),e.MarkerClusterGroup=t,e.MarkerCluster=i});(function(previousMethods){if(typeof previousMethods==='undefined'){previousMethods={getCenter:L.Map.prototype.getCenter,setView:L.Map.prototype.setView,setZoomAround:L.Map.prototype.setZoomAround,getBoundsZoom:L.Map.prototype.getBoundsZoom,PopupAdjustPan:L.Popup.prototype._adjustPan,RendererUpdate:L.Renderer.prototype._update}} 40L.Map.include({getBounds:function(){if(this._viewport){return this.getViewportLatLngBounds()}else{var bounds=this.getPixelBounds(),sw=this.unproject(bounds.getBottomLeft()),ne=this.unproject(bounds.getTopRight());return new L.LatLngBounds(sw,ne)}},getViewport:function(){return this._viewport},getViewportBounds:function(){var vp=this._viewport,topleft=L.point(vp.offsetLeft,vp.offsetTop),vpsize=L.point(vp.clientWidth,vp.clientHeight);if(vpsize.x===0||vpsize.y===0){vp=this.getContainer();if(vp){topleft=L.point(0,0);vpsize=L.point(vp.clientWidth,vp.clientHeight)}} 41return L.bounds(topleft,topleft.add(vpsize))},getViewportLatLngBounds:function(){var bounds=this.getViewportBounds();return L.latLngBounds(this.containerPointToLatLng(bounds.min),this.containerPointToLatLng(bounds.max))},getOffset:function(){var mCenter=this.getSize().divideBy(2),vCenter=this.getViewportBounds().getCenter();return mCenter.subtract(vCenter)},getCenter:function(withoutViewport){var center=previousMethods.getCenter.call(this);if(this.getViewport()&&!withoutViewport){var zoom=this.getZoom(),point=this.project(center,zoom);point=point.subtract(this.getOffset());center=this.unproject(point,zoom)} 42return center},setView:function(center,zoom,options){center=L.latLng(center);zoom=zoom===undefined?this._zoom:this._limitZoom(zoom);
42if(this.getViewport()){var point=this.project(center,this._limitZoom(zoom));point=point.add(this.getOffset());center=this.unproject(point,this._limitZoom(zoom))} 43return previousMethods.setView.call(this,center,zoom,options)},setZoomAround:function(latlng,zoom,options){var vp=this.getViewport();if(vp){var scale=this.getZoomScale(zoom),viewHalf=this.getViewportBounds().getCenter(),containerPoint=latlng instanceof L.Point?latlng:this.latLngToContainerPoint(latlng),centerOffset=containerPoint.subtract(viewHalf).multiplyBy(1-1/scale),newCenter=this.containerPointToLatLng(viewHalf.add(centerOffset));return this.setView(newCenter,zoom,{zoom:options})}else{return previousMethods.setZoomAround.call(this,latlng,zoom,options)}},getBoundsZoom:function(bounds,inside,padding){bounds=L.latLngBounds(bounds);padding=L.point(padding||[0,0]);var zoom=this.getZoom()||0,min=this.getMinZoom(),max=this.getMaxZoom(),nw=bounds.getNorthWest(),se=bounds.getSouthEast(),vp=this.getViewport(),size=(vp?L.point(vp.clientWidth,vp.clientHeight):this.getSize()).subtract(padding),boundsSize=this.project(se,zoom).subtract(this.project(nw,zoom)),snap=L.Browser.any3d?this.options.zoomSnap:1;var scale=Math.min(size.x/boundsSize.x,size.y/boundsSize.y);zoom=this.getScaleZoom(scale,zoom);if(snap){zoom=Math.round(zoom/(snap/100))*(snap/100);zoom=inside?Math.ceil(zoom/snap)*snap:Math.floor(zoom/snap)*snap} 44return Math.max(min,Math.min(max,zoom))}});L.Map.include({setActiveArea:function(css,keepCenter,animate){var center;if(keepCenter&&this._zoom){center=this.getCenter()} 45if(!this._viewport){var container=this.getContainer();this._viewport=L.DomUtil.create('div','');container.insertBefore(this._viewport,container.firstChild)} 46if(typeof css==='string'){this._viewport.className=css}else{L.extend(this._viewport.style,css)} 47if(center){this.setView(center,this.getZoom(),{animate:!!animate})} 48return this}});L.Renderer.include({_onZoom:function(){this._updateTransform(this._map.getCenter(!0),this._map.getZoom())},_update:function(){previousMethods.RendererUpdate.call(this);this._center=this._map.getCenter(!0)}});L.GridLayer.include({_updateLevels:function(){var zoom=this._tileZoom,maxZoom=this.options.maxZoom;if(zoom===undefined){return undefined} 49for(var z in this._levels){if(this._levels[z].el.children.length||z===zoom){this._levels[z].el.style.zIndex=maxZoom-Math.abs(zoom-z)}else{L.DomUtil.remove(this._levels[z].el);this._removeTilesAtZoom(z);delete this._levels[z]}} 50var level=this._levels[zoom],map=this._map;if(!level){level=this._levels[zoom]={};level.el=L.DomUtil.create('div','leaflet-tile-container leaflet-zoom-animated',this._container);level.el.style.zIndex=maxZoom;level.origin=map.project(map.unproject(map.getPixelOrigin()),zoom).round();level.zoom=zoom;this._setZoomTransform(level,map.getCenter(!0),map.getZoom());L.Util.falseFn(level.el.offsetWidth)} 51this._level=level;return level},_resetView:function(e){var animating=e&&(e.pinch||e.flyTo);this._setView(this._map.getCenter(!0),this._map.getZoom(),animating,animating)},_update:function(center){var map=this._map;if(!map){return} 52var zoom=map.getZoom();if(center===undefined){center=map.getCenter(this)} 53if(this._tileZoom===undefined){return} 54var pixelBounds=this._getTiledPixelBounds(center),tileRange=this._pxBoundsToTileRange(pixelBounds),tileCenter=tileRange.getCenter(),queue=[];for(var key in this._tiles){this._tiles[key].current=!1} 55if(Math.abs(zoom-this._tileZoom)>1){this._setView(center,zoom);return} 56for(var j=tileRange.min.y;j<=tileRange.max.y;j++){for(var i=tileRange.min.x;i<=tileRange.max.x;i++){var coords=new L.Point(i,j);coords.z=this._tileZoom;if(!this._isValidTile(coords)){continue} 57var tile=this._tiles[this._tileCoordsToKey(coords)];if(tile){tile.current=!0}else{queue.push(coords)}}} 58queue.sort(function(a,b){return a.distanceTo(tileCenter)-b.distanceTo(tileCenter)});if(queue.length!==0){if(!this._loading){this._loading=!0;this.fire('loading')} 59var fragment=document.createDocumentFragment();for(i=0;i<queue.length;i++){this._addTile(queue[i],fragment)} 60this._level.el.appendChild(fragment)}}});L.Popup.include({_adjustPan:function(){if(!this._map._viewport){previousMethods.PopupAdjustPan.call(this)}else{if(!this.options.autoPan||(this._map._panAnim&&this._map._panAnim._inProgress)){return} 61var map=this._map,vp=map._viewport,containerHeight=this._container.offsetHeight,containerWidth=this._containerWidth,vpTopleft=L.point(vp.offsetLeft,vp.offsetTop),layerPos=new L.Point(this._containerLeft-vpTopleft.x,-containerHeight-this._containerBottom-vpTopleft.y);if(this._zoomAnimated){layerPos._add(L.DomUtil.getPosition(this._container))}
62var containerPos=map.layerPointToContainerPoint(layerPos),padding=L.point(this.options.autoPanPadding),paddingTL=L.point(this.options.autoPanPaddingTopLeft||padding),paddingBR=L.point(this.options.autoPanPaddingBottomRight||padding),size=L.point(vp.clientWidth,vp.clientHeight),dx=0,dy=0;if(containerPos.x+containerWidth+paddingBR.x>size.x){dx=containerPos.x+containerWidth-size.x+paddingBR.x} 63if(containerPos.x-dx-paddingTL.x<0){dx=containerPos.x-paddingTL.x} 64if(containerPos.y+containerHeight+paddingBR.y>size.y){dy=containerPos.y+containerHeight-size.y+paddingBR.y} 65if(containerPos.y-dy-paddingTL.y<0){dy=containerPos.y-paddingTL.y} 66if(dx||dy){map.fire('autopanstart').panBy([dx,dy])}}}})})(window.leafletActiveAreaPreviousMethods);var toast='<div class="toast px-2" data-delay="2000" role="alert" aria-live="assertive" aria-atomic="true"></div>';var paymentID;var paymentToken;$(document).ready(function(){$('[data-toggle="tooltip"]').tooltip();if($('header').hasClass('fixed-top')){setTimeout(function(){$('.toastContainer').css('top',$('header').innerHeight()+40)},350)}});function tapt(str){if(typeof camera_special_label!='undefined'&&camera_special_label.length>0){str=str.replace('Camera',camera_special_label)} 67switch(APT_LABEL){case 'APT':str=str.replace('Camera','Appartamento');break;case 'VIL':str=str.replace('Camera','Villa');break;case 'STR':str=str.replace('Camera','Struttura');break;case 'ALL':str=str.replace('Camera','Alloggio');break;default:break} 68try{if(typeof(jtranslate[str])!=='undefined') 69return jtranslate[str]}catch(e){} 70return str} 71function t(str){try{if(typeof(jtranslate[str])!=='undefined') 72return jtranslate[str]}catch(e){} 73return str} 74Number.prototype.formatMoney=function(c,d,t){var n=this,c=isNaN(c=Math.abs(c))?2:c,d=d==undefined?".":d,t=t==undefined?",":t,s=n<0?"-":"",i=String(parseInt(n=Math.abs(Number(n)||0).toFixed(c))),j=(j=i.length)>3?j%3:0;return s+(j?i.substr(0,j)+t:"")+i.substr(j).replace(/(\d{3})(?=\d)/g,"$1"+t)+(c?d+Math.abs(n-i).toFixed(c).slice(2):"")};function ratesToggle(me,id,solution){$('.rate-list').not('#room-row-'+solution+'x'+id).slideUp() 75$('.listing-outer').not('.listing-idrt-'+id).find('.btn-details i').removeClass('fa-chevron-up').addClass('fa-chevron-down');$('.listing-outer').not('.listing-idrt-'+id).find('.btn-details').removeClass('text-grey');ratesOpen(me,id,solution);return!1} 76function ratesOpen(me,id,solution,noscroll){$('#room-row-'+solution+'x'+id).slideToggle(function(){if(!$('.listing-idrt-'+id).hasClass('current'))$('.listing-idrt-'+id).addClass('current');var icon=$('.listing-idrt-'+id).find('.btn-details i');var button=$('.listing-idrt-'+id).find('.btn-details');if($('.listing-idrt-'+id).hasClass('current')){icon.toggleClass('fa-chevron-down fa-chevron-up');if(!button.hasClass('btn-primary')){button.toggleClass('text-999 border-muted')}} 77if(typeof noscroll==undefined||!noscroll){scrollTopObj('#anc'+solution+'x'+id)}});return!1} 78function pr(num,decimal){if(typeof decimal=='undefined'){decimal=2} 79var currency;var currency_intl;switch(CURRENCYH){case '$':nospace=!0;currency_intl='en-US';currency='USD';break;case 'MX$':nospace=!0;currency_intl='en-US';currency='MXN';break;case '£':nospace=!0;currency_intl='en-GB';currency='GBP';break;case 'CHF':nospace=!0;currency_intl='it-IT';currency='CHF';break;case 'RON':nospace=!0;currency_intl='en-GB';currency='RON';break;case 'AED':nospace=!1;currency_intl='en-GB';currency='AED';break;case '₡':nospace=!0;currency_intl='es-CR';currency='CRC';break;case '₪':nospace=!0;currency_intl='en-GB';currency='ILS';break;case '฿':nospace=!0;currency_intl='th';currency='THB';break;
79case 'S/':nospace=!0;currency_intl='es-PE';currency='PEN';break;case 'CA$':nospace=!1;currency_intl='us-CA';currency='CAD';break;default:nospace=!0;currency_intl='it-IT';currency='EUR';break} 80var val=Intl.NumberFormat(currency_intl,{style:'currency',currency:currency,minimumFractionDigits:decimal,maximumFractionDigits:decimal}).format(num);if(nospace){val=val.replace('\xa0','')} 81return val} 82function round2(num){return parseFloat(num).toFixed(2).replace('.',',')} 83function goStep2(){window.location.href=BASE_PATH+'/book/step2';return!1} 84function updateCart(goNext){if(goNext===undefined){goNext=!1} 85var post={'from':$('#formBook1 input[name=from]').val(),'to':$('#formBook1 input[name=to]').val(),'guests_ask':guests_ask,'solutions_sel':JSON.stringify(solutions_sel),};$.post(BASE_PATH+"/book/set-step2",post).done(function(data){if(goNext) 86goStep2();else{$('#reservation-summary').html(data);showOrder()}}).fail(function(){alert("Error, impossible to continue. Please contact the support.")})} 87function roomDetailsModal(idrt,gotoSlide){$('.modal-rt').load(BASE_PATH+'/book/modal-rt?idrt='+idrt,function(){if(window.innerWidth>991){$('.modal-rt .modal-dialog').addClass('modal-xl')} 88$('.modal-rt .modal-dialog').addClass('roomDetailsModalDialog'),$('.modal-rt .modal').modal();$('.modal-rt .modal .modal-body').hide();$('.modal-rt .modal').on('shown.bs.modal',function(){$('body').addClass('slickAptModalBackdrop');$('.slick-apt').slick({infinite:!0,dots:!1,centerMode:!1,arrows:!0,fade:!0,nextArrow:'<button class="slick-next slick-arrow" aria-label="Next" type="button" style="display: inline-block;"></button>',prevArrow:'<button class="slick-prev slick-arrow" aria-label="Next" type="button" style="display: inline-block;"></button>',}).on('beforeChange',function(event,slick,currentSlide,nextSlide){if(currentSlide!==nextSlide){lazyBgImg($(slick.$slides.get(nextSlide)))}});if(gotoSlide!==undefined) 89$('.slick-apt').slick('slickGoTo',gotoSlide);$('.modal-rt .modal .modal-body').fadeIn();$('.slick-apt .slick-slide').focus()}).on('hide.bs.modal',function(e){$('body').removeClass("slickAptModalBackdrop")})});return!1} 90function otaPropertyDetailsModal(idota,gotoSlide){$('.modal-rt').load(BASE_PATH+'/book/modal-ota?idota='+idota,function(){if(window.innerWidth>991){$('.modal-rt .modal-dialog').addClass('modal-xl')} 91$('.modal-rt .modal-dialog').addClass('roomDetailsModalDialog'),$('.modal-rt .modal').modal();$('.modal-rt .modal .modal-body').hide();$('.modal-rt .modal').on('shown.bs.modal',function(){$('body').addClass('slickAptModalBackdrop');$('.slick-apt').slick({infinite:!0,dots:!1,centerMode:!1,arrows:!0,fade:!0,nextArrow:'<button class="slick-next slick-arrow" aria-label="Next" type="button" style="display: inline-block;"></button>',prevArrow:'<button class="slick-prev slick-arrow" aria-label="Next" type="button" style="display: inline-block;"></button>',}).on('beforeChange',function(event,slick,currentSlide,nextSlide){if(currentSlide!==nextSlide){lazyBgImg($(slick.$slides.get(nextSlide)))}});if(gotoSlide!==undefined) 92$('.slick-apt').slick('slickGoTo',gotoSlide);$('.modal-rt .modal .modal-body').fadeIn()}).on('hide.bs.modal',function(e){$('body').removeClass("slickAptModalBackdrop")})});return!1} 93function goStep3(){$.post(BASE_PATH+"/book/set-step3",$('#formServices select, #formBook1 input[type=hidden]').serialize()).done(function(data){window.location.href=BASE_PATH+'/book/step3'}).fail(function(){alert("Error, impossible to continue. Please contact the support.")});return!1} 94function goStep4(){var methods=$('#form-payments-container input[type=radio]').length;var hasAccount=$('.pay-statement .price').length>0;if(methods==0&&hasAccount){return alert(t('js_be_acconto_impossibile'))} 95$(".loading").show();hideLoadingMan=!0;$.post(BASE_PATH+"/book/set-step4",$('#formBookData').serialize()).done(function(data){if(data.userRedirect!==undefined){window.location.href=data.userRedirect.href;return} 96if(data.paymentID!==undefined)paymentID=data.paymentID;if(data.paymentToken!==undefined)paymentToken=data.paymentToken;doPayment(data.tag)}).fail(function(){alert("Error, impossible to continue. Please contact the support.")})} 97function packageGoStep3(){$(".loading").show();hideLoadingMan=!0;$.post(BASE_PATH+"/book/package-set-step3",$('#packageData').serialize()).done(function(data){document.location=BASE_PATH+"/book/package-step3"}).fail(function(){alert("Error, impossible to continue. Please contact the support.")})} 98function bookOffer(){$(".loading").show();hideLoadingMan=!0;$.post(BASE_PATH+"/book/book-offer",$('#formBookData').serialize()).done(function(data){if(data.userRedirect!==undefined){window.location.href=data.userRedirect.href;return} 99doPayment(data.tag)}).fail(function(){alert("Error, impossible to continue. Please contact the support.")})} 100function packageGoStep4(){$(".loading").show();hideLoadingMan=!0;$.post(BASE_PATH+"/book/package-set-step-4",$('#formBookData').serialize()).done(function(data){doPayment(data.tag)}).fail(function(){alert("Error, impossible to continue. Please contact the support.")})} 101function goStepNext(){if(window.location.href.indexOf('step1')>0){goStep2()}else if(window.location.href.indexOf('step2')>0){goStep3()}else if(window.location.href.indexOf('step3')>0){if(typeof facebookAddPaymentInfo!='undefined'){facebookAddPaymentInfo()} 102$('#formBookData').submit()}else{$('#formBookData').submit()}} 103function counters(){$('input.counter').removeClass('counter').wrap('<span class="counter-elem">').parent().append('<i class="fad fa-fw fa-plus-circle fa-lg fa-swap-opacity text-lightgrey kb-add"></i>').prepend('<i class="fad fa-fw fa-minus-circle fa-lg fa-swap-opacity text-lightgrey"></i></span>');$('.counter-elem i').unbind().click(function(){var im=$(this).parent().find('input');var val=parseInt(im.val());if($(this).hasClass('kb-add')){val=val+1}else{val=val-1} 104if(im.attr('min')) 105if(val<parseInt(im.attr('min')))
106val=im.attr('min');if(im.attr('max')) 107if(val>parseInt(im.attr('max'))) 108val=im.attr('max');im.val(val);if(im.attr('onchange')){eval(im.attr('onchange'))}})} 109function changeRoomQt(el,idrt,idr){var qt_rooms=parseInt(el.val());$('#rate-row-'+idrt+'x'+idr+' .childrenrow').hide();for(var i=0;i<qt_rooms;i++) 110$('#childrenrow-'+idrt+'x'+idr+'x'+i).show();rateCalculate(idrt,idr);var qt=0;var tot=parseInt(el.attr('data-max'));$('#room-row-'+idrt+' select.selQt').each(function(){qt=qt+parseInt($(this).val())});$('#room-row-'+idrt+' select.selQt option').removeAttr('disabled');$('#room-row-'+idrt+' select.selQt').each(function(){var v=parseInt($(this).val())+tot-qt;$(this).find('option[value='+(v)+']').nextAll("option").attr('disabled','disabled')});$('#room-row-'+idrt+' select.selQt option:selected').removeAttr('disabled').prevAll("option").removeAttr('disabled');counters()} 111var total_amount_room=new Array();var total_amount_rate=new Array();var total_amount_rate_j=new Array();function rateReset(){total_amount_room=new Array();total_amount_rate=new Array();total_amount_rate_j=new Array();showSearch()} 112function rateCalculate(idrt,idr){var total_amount=0;$.each(solutions_sel,function(i,s){total_amount=total_amount+s.price});if($('#step1CartTot').length>0){$('#step1CartTot').html(pr(total_amount)).trigger('change')}} 113function showSearch(){if($('.kross-calendar').length>0){$('#calendar-container').slideDown();$('#order-sidebar').slideUp()}else{window.location.href=BASE_PATH+'/book/step1'} 114return!1} 115function showOrder(){$('#order-sidebar').slideDown();return!1} 116function serviceCalculate(id_service){var total_booking_serv=0.00;var rowWasChanged=$('#qt-service-'+id_service);var summaryRow=$('.cartElementService[data-id='+id_service+']');if(!summaryRow.length){var summaryRow=$('.model_service').clone().removeClass('model_service d-none').appendTo($('.reservation-summary-row-inner'));summaryRow.find('.serviceName').html(' x '+rowWasChanged.attr('data-name'));summaryRow.addClass('d-flex');summaryRow.attr('data-id',id_service)} 117var qty=rowWasChanged.val();var nightsMultiplier=rowWasChanged.attr('data-nightsmultiplier');var unitaryPrice=rowWasChanged.attr('data-price');var newTotalPrice=parseFloat(unitaryPrice*qty);qty=qty*nightsMultiplier;if(qty<1){summaryRow.removeClass('d-flex');summaryRow.hide()}else{summaryRow.addClass('d-flex');summaryRow.show()} 118summaryRow.find('.serviceQty').html(qty);summaryRow.find('.serviceTotalPrice').attr('data-amount',newTotalPrice);summaryRow.find('.serviceTotalPrice').html(pr(newTotalPrice));$('#totale_serv_'+id_service).html(pr(newTotalPrice));$('.serviceTotalPrice').each(function(){if($(this).attr('data-amount')){total_booking_serv+=parseFloat($(this).attr('data-amount'))}});$('#total_amount').attr('data-amount',parseFloat($('#initialTotalPrice').val())+parseFloat(total_booking_serv));$('#total_amount').html(pr(parseFloat($('#initialTotalPrice').val())+parseFloat(total_booking_serv)))} 119function serviceCalculateV1(){var total_booking_serv=parseFloat($('#total_amount').attr('data-amount'));var model_service=$('#model_service').html();$('#reservation-summary-services').html('');$('.qt-service').each(function(){var idserv=$(this).attr('data-id');var price=0;var priceUnit=$(this).attr('data-price');if(priceUnit==undefined){priceUnit=0} 120var name=$(this).attr('data-name');var img=$(this).attr('data-img');var qty=$(this).val();if(qty){price=parseFloat(parseFloat(qty)*parseFloat(priceUnit));if(qty>0){var model_service_html=$(model_service);model_service_html.find('.reservation-summary-title').html(name);model_service_html.find('.reservation-summary-price').html(pr(price));if(img!=undefined){model_service_html.find('.image').css('background-image',"url('"+img+"')");model_service_html.find('.image span').remove()} 121$('#reservation-summary-services').append(model_service_html)}} 122$('#totale_serv_'+idserv).html(pr(price));total_booking_serv+=price});$('#total_amount').html(pr(total_booking_serv))} 123function updateCartServices(){var services={};$('.qt-service').each(function(){services[$(this).data('id')]=$(this).val()});var t=$('#uid').val() 124var p=$('#id_proposta').val() 125$.post(BASE_PATH+'/offer/setServices',{services:services,t:t,p:p}).done(function(data){$('#tableriepilogo-container').html(data.riepilogo) 126$('#form-payments-container').html(data.form_pagamento)})} 127function sumArray(arr){var ans=0;var sum=0;for(var i=0;i<arr.length;i++){ans=Math.max(0,ans+arr[i]);sum=Math.max(sum,ans)} 128return sum};function showFilters(){$('.filters_top').slideToggle()} 129var hideSendingMan=!1;var hideLoadingMan=!1;function ajaxBind(){$(document).bind("ajaxSend",function(){if(!hideSendingMan) 130$(".loading").show()}).bind("ajaxComplete",function(){if(!hideLoadingMan) 131$(".loading").hide()})} 132$(function($){ajaxBind();setupSlick();stickyHeader()});function scrollTopObj(el){$('html, body').animate({scrollTop:$(el).offset().top-100},'800')} 133function btnContinue(event){if($(document).scrollTop()>100){$('.btn-to-top').fadeIn()}else{$('.btn-to-top').fadeOut()}} 134$(document).ready(function(){$(window).scroll(btnContinue);btnContinue();setTimeout(function(){popoverInfoButton();if($('body.details .favouriteContainer').length>0){popoverShareButton();initFavRt($('body.details .favouriteContainer'))}},200)});
134function stickyHeader(){if(!$('.sticky').length) 135return;var stickyHeaderTop=$('.sticky').offset().top;$(window).scroll(function(){if($(window).scrollTop()>stickyHeaderTop-15){$('.sticky').css({position:'sticky',top:'15px'})}else{$('.sticky').css({position:'relative',top:'0px'})}})} 136function resultSummaryFormatter(from=!1,to=!1,guests=0,city='',displayDiv='#searchResultSummary'){var start;var end;var start_label='';var end_label='';var current_year;var resultSummary=t('Tutte le soluzioni');if(from.length&&to.length){start=moment(from);end=moment(to);start_label=start.format('ddd')+" "+start.format('DD')+" "+start.format('MMM');end_label=end.format('ddd')+" "+end.format('DD')+" "+end.format('MMM');current_year=new Date().getFullYear();if(current_year!=end.format('YYYY')){start_label=start.format('DD')+" "+start.format('MMM')+" "+start.format('YYYY');end_label=end.format('DD')+" "+end.format('MMM')+" "+end.format('YYYY')}} 137if(city.length) 138resultSummary=city;if(start_label.length&&end_label.length) 139if(city.length){resultSummary+=start_label+" - "+end_label}else{resultSummary=start_label+" - "+end_label} 140if(guests>0){resultSummary+=" / "+guests+" "+t('Guests')} 141$(displayDiv).html(resultSummary)} 142var filterListStep1Forced=!1;var origOmnibarValue;function filterList(param){var city='';var from;var to;var guests;var flexHeadingText='';var serialized=[];$(".loading").show();$('.intro-text').animate({opacity:0}
142,300);$('#filtersContainerTop').animate({opacity:0},300);$('.show-more-container').animate({opacity:0},300);$('.count_results').animate({opacity:0},300);$('.flexHeadingTextContainer').animate({opacity:0},300);$('.sortSelect2Desktop').animate({opacity:0},300);$('#propertiesResultContainer').animate({opacity:0},300,function(){$('.listings-wrapper').html('');$('.count_results').html('');$('.flexHeadingTextContainer').html('');$('.intro-text').html('');destroySlick();var url=window.location.href.split('?')[0];if(filterListStep1Forced){url=BASE_PATH+'/book/step1'} 143$.post(url+'?search='+param,$('form#searchform').serialize()).done(function(data){if(typeof data.redir!='undefined'){setTimeout(function(){$(".loading").show();document.location=data.redir},1);return} 144if(window.innerWidth<992&&typeof panelAvailability=='undefined'){$('#innerFilterBar').slideUp();$('#innerFilterBar').toggleClass('d-flex')} 145if(data.flexHeadingText){$('.flexHeadingTextContainer').html(data.flexHeadingText)} 146if(data.prelisting){$('.intro-text').html(data.prelisting)} 147listingQuery(data.listings);window.history.pushState("","",window.location.href.split('?')[0]+"?"+$('form#searchform').serialize());if(window.innerWidth<992){serialized=$('form#searchform').serializeArray();for(i=0;i<serialized.length;i++){if(serialized[i].name==='city'){city=serialized[i].value} 148if(serialized[i].name==='collection'){city=serialized[i].value} 149if(serialized[i].name==='from'){from=serialized[i].value} 150if(serialized[i].name==='to'){to=serialized[i].value} 151if(serialized[i].name==='n_guests'){guests=serialized[i].value}} 152var city='';if(city.length>0){city=$('#widgetDestination [value="'+city+'"]').html().trim()+', '} 153resultSummaryFormatter(from,to,guests,city);$('#filterBarCondensed').slideDown()}})})} 154function backToFilterBar(inverse){if(inverse===undefined||inverse===!1){$('#filterBarCondensed').slideUp('fast',function(){$('#innerFilterBar').toggleClass('d-flex');$('#innerFilterBar').slideDown('fast',function(){})})}else{$('#innerFilterBar').slideUp('fast',function(){$('#innerFilterBar').toggleClass('d-flex');$('#filterBarCondensed').slideDown('fast')})}} 155function destroySlick(){$('.slickdo').each(function(){if($(this).hasClass('slick-initialized')){$(this).slick('destroy')}})} 156function setupSlick(){} 157function refreshSlick(){$('.slickdo:visible').each(function(){slickDo($(this))})} 158function slickDo(obj){if(!obj.hasClass('slick-initialized')){$(obj).slick({lazyLoad:'ondemand',slidesToShow:1,slidesToScroll:1,fade:!0,centerMode:!0}).on('beforeChange',function(event,slick,currentSlide,nextSlide){if(currentSlide!==nextSlide){lazyBgImg($(slick.$slides.get(nextSlide)))}else lazyBgImg($(slick.$slides.get(currentSlide)))});$(obj).find('.slick-arrow').html('')}} 159var lazyBgImg=function(el){var lazyBgImgs=$(el).find('.lazy-bg-img');lazyBgImgs.each(function(i){var el=$(this);if(!el.hasClass('is-lazy-loaded')){el.css('background-image','url('+$(this).data('lazy')+')');el.addClass('is-lazy-loaded')}})} 160function changeUrl(url){window.history.pushState("","",url)} 161function confirmCancelReservation(tag){if(!confirm(t('js_Confermi canc intera preno?'))) 162return!1;$.get(BASE_PATH+'/book/cancel-reservation/t/'+tag,function(data){window.location.href=BASE_PATH+'/book/view/t/'+tag})} 163function popoverInfoButton(){$('.infobutton').click(function(){$(this).popover({html:!0,trigger:'manual',placement:'bottom',sanitize:!1,template:'<div class="popover rateDescriptionPopoverTemplate shadow" role="tooltip"><div class="arrow "></div><h3 class="popover-header"></h3><div class="popover-body p-4"></div></div>',content:function(){var message='';return message}});$(this).on('shown.bs.popover',function(){});$(this).popover("show");return!1})} 164function popoverShareButton(){$('.sharingContainer').click(function(e){e.stopPropagation();var localLink=$(this).attr('data-linkto');var shareButtons=`<h6 class="pb-1">`+t('Condividi su')+`</h6>`;if(sharemethods.indexOf('face')>-1){shareButtons+=`<a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=`+localLink+`"><i class="fab fa-facebook-square fa-fw fa-2x"></i>`} 165if(sharemethods.indexOf('twit')>-1){shareButtons+=`<a target="_blank" href="http://twitter.com/share?url=`+localLink+`"><i class="fab fa-x-twitter fa-fw fa-2x"></i>`} 166if(sharemethods.indexOf('pint')>-1){shareButtons+=`<a target="_blank" href="https://pinterest.com/pin/create/link/?url=`+localLink+`"><i class="fab fa-pinterest fa-fw fa-2x"></i>`} 167if(sharemethods.indexOf('wapp')>-1){shareButtons+=`<a target="_blank" href="whatsapp://send?text=`+localLink+`"><i class="fab fa-whatsapp fa-fw fa-2x"></i>`} 168if(sharemethods.indexOf('mail')>-1){shareButtons+=`<a href="mailto:?body=`+localLink+`"><i class="fas fa-envelope fa-fw fa-2x"></i>`} 169if(sharemethods.indexOf('copy')>-1){shareButtons+=`<a href="javascript:popoverShareButtonCopy('`+localLink+`')"><i class="fas fa-copy fa-fw fa-2x"></i>`} 170$(this).popover({html:!0,trigger:'manual',placement:'bottom',sanitize:!1,template:'<div class="popover rateDescriptionPopoverTemplate sharing shadow" role="tooltip"><div class="arrow"></div><h3 class="popover-header"></h3><div class="popover-body p-4"></div></div>',content:function(){var message=shareButtons;return message}});$(this).on('shown.bs.popover',function(e){});$(this).popover("show")})} 171function popoverShareButtonCopy(value){var tempInput=document.createElement("input");tempInput.style="position: absolute; left: -1000px; top: -1000px";tempInput.value=value;document.body.appendChild(tempInput);tempInput.select();document.execCommand("copy");document.body.removeChild(tempInput)}
172function codiceScontoToggle(){$('#data_discount').slideToggle();if(!$('#row-codice-sconto').prop('checked')&&$('#promo_code').val()!=''){$('#promo_code').val('');applicaSconto()}} 173function applicaSconto(){let promocode=$('#promo_code').val();$.post('setPromoCode',{promocode:promocode}).done(function(data){$('#promo_code_msg').slideUp();$('#promo_code_err').slideUp();if(data.action=='added'){if(data.success){$('#promo_code_msg').slideDown();if(typeof dataLayerApplyPromoCode!='undefined'){dataLayerApplyPromoCode(!0,promocode)}}else{$('#promo_code_err').slideDown();if(typeof dataLayerApplyPromoCode!='undefined'){dataLayerApplyPromoCode(!1,promocode)}}} 174$('#reservation-summary').html(data.summary);if($(window).width()<=991){$('body.ht #total_amount').html(data.amount);let $target=$('body.ht #filterBarCondensed');if($target.length){$('html, body').animate({scrollTop:$target.offset().top-15},500)}} 175$('#form-payments-container').html(data.adv)}).fail(function(jqXHR,textStatus){alert(t('cannot_apply_promo_code'))})} 176function showConditions(){$('#modalConditions').modal('show')} 177function showPrivacy(){window.open(BASE_PATH+'/privacy-policy','_blank')} 178$(function(){$('.navbar-toggler').on('click',function(){if($(this).attr('aria-expanded')=='false'){$('header').css('height','auto')}else{setTimeout(function(){$('header').css('height','var(--headerHeight)')},300)}})}) 179function calcPrice(rateObj,guestsAsk){var ret={tot_price:parseFloat(rateObj.tot_price),adv_tot_price:parseFloat(rateObj.adv_tot_price),list_price:parseFloat(rateObj.list_price)};if(typeof rateObj.occupancy[guestsAsk.adults]!='undefined'){ret.tot_price+=parseFloat(rateObj.occupancy[guestsAsk.adults].add_price);ret.adv_tot_price+=parseFloat(rateObj.occupancy[guestsAsk.adults].add_adv_price);ret.list_price+=parseFloat(rateObj.occupancy[guestsAsk.adults].add_list_price)} 180return ret} 181function htmlEntities(str){return String(str).replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>').replace(/"/g,'"')} 182function countryCodeCheck(){var tel=$('#tel').val().replace(/[^0-9]/g,'');if(tel!=$('#tel').val()){$('#tel').val(tel)} 183tel=tel.replace(/ /g,'');var cc;if(tel.length==0){$('.iso3flag').attr('src','/v6/images/flags_svg/noflag.svg');return} 184for(var l=4;l>0;l--){cc=tel.substring(0,l);if(typeof KB_isocallcode[cc]!='undefined'){$('.iso3flag').attr('src','/v6/images/flags_svg/'+KB_isocallcode[cc]+'.svg');if(tel.substring(l).length>0){$('#tel').val(cc+' '+tel.substring(l))}else{$('#tel').val(cc)} 185return}} 186if(typeof KB_isocallcode[cc]=='undefined'){console.error('CC invalid: '+KB_isocallcode[cc])} 187$('.iso3flag').attr('src','/v6/images/flags_svg/noflag.svg')};var toast='<div class="toast px-2" data-delay="2000" role="alert" aria-live="assertive" aria-atomic="true"></div>';function setFav(rt){var d=new Date();d.setTime(d.getTime()+(365*24*60*60*1000));var expires="expires="+d.toUTCString();var cvalue=1;document.cookie="apt_"+rt+"="+cvalue+";"+expires+";samesite=lax;path=/;";navbarFav()} 188function unsetFav(rt){var d=new Date();var expires="expires="+d.toUTCString();var cvalue=1;document.cookie="apt_"+rt+"="+cvalue+";"+expires+";samesite=lax;path=/";navbarFav()} 189function toggleFav(rt){var toastMessage;if(isFav(rt)){unsetFav(rt);$('.favouriteContainer[data-rt='+rt+']').removeClass('active');$('.favouriteContainer[data-rt='+rt+']').find('.iconButton').removeClass('fas').addClass('far');$('.favorites').find('.listing-item[data-id='+rt+']').hide();toastMessage=t('Rimosso dai preferiti')}else{setFav(rt);$('.favouriteContainer[data-rt='+rt+']').addClass('active');$('.favouriteContainer[data-rt='+rt+']').find('.iconButton').removeClass('far').addClass('fas');toastMessage=t('Aggiunto ai preferiti');if(typeof dataLayerAddToFavourites!='undefined'){dataLayerAddToFavourites($('div[data-id='+rt+']'))}} 190toastMessage='<div class="toast-body d-flex align-items-center"> <i class="fas fa-heart fa-fw fa-lg text-primary mr-2"></i> '+toastMessage+'</div> ';var fullMessage=$(toast).append(toastMessage);$('.toastContainer').append(fullMessage)} 191function getFav(rt){var name="apt_"+rt+"=";var decodedCookie=decodeURIComponent(document.cookie);var ca=decodedCookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1)} 192if(c.indexOf(name)==0){return c.substring(name.length,c.length)}} 193return ""} 194function isFav(rt){return getFav(rt)!=''} 195function actionFavInit(){$('.toast').toast()} 196function initFavRt(elem){var rt=elem.attr('data-rt');if(isFav(rt)){elem.addClass('active');elem.find('.iconButton').removeClass('far').addClass('fas')} 197elem.unbind('click').click(function(e){e.stopPropagation();var idrt=elem.attr('data-rt');toggleFav(idrt);$('.toast').toast('show');$('.toast').on('hidden.bs.toast',function(){$('.toastContainer').html('')})})} 198function navbarFav(){$('header .fa-heart').removeClass('far fas');$('header .fa-heart').addClass(hasFav()?'fas':'far');$('footer .fa-heart').removeClass('far fas');$('footer .fa-heart').addClass(hasFav()?'fas':'far')} 199function hasFav(){var name=/^apt_([0-9]+)=/;var decodedCookie=decodeURIComponent(document.cookie);var ca=decodedCookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1)} 200if(c.match(name)){return!0}} 201return!1} 202$(document).ready(function(){actionFavInit();navbarFav()});
202var payMethods=['str','nexi','redsy','swikl','sixpa','vivaw','emete','syspa','pesap','zpay','gp'];function setPayMethod(method,comm){$('#metodo_pagamento').val(method).trigger('change');if(typeof comm!='undefined'){$('#down_to_pay').html(pr(parseFloat($('#down_to_pay').attr('data-original'))+comm))}else{$('#down_to_pay').html(pr(parseFloat($('#down_to_pay').attr('data-original'))))} 203if($('#pcc').length>0){if(method=='cc'){$('#paycc').slideDown()}else{$('#paycc').slideUp()}} 204if($('#pbb').length>0){if(method=='bb'){$('#paybbcc').slideDown()}else{$('#paybbcc').slideUp()}} 205if(typeof gpPaymentEnableSubmit!='undefined'){gpPaymentEnableSubmit()} 206return!1} 207function doPayment(tag){var methods=$('#form-payments-container input[type=radio]').length;if(methods==0){window.location.href=BASE_PATH+'/book/confirm?tag='+tag;return!1} 208var method=$('#metodo_pagamento').val();if(!method) 209return alert(t('js_be_selezionare_metodo_pagamen'));$(".loading").show();if(method=='cc'||method=='bb'){window.location.href=BASE_PATH+'/book/confirm?tag='+tag;return!1} 210if(payMethods.indexOf(method)>-1){window.location.href=BASE_PATH+'/book/pay/t/'+tag+'/pay/'+method;return!1} 211if(method=='pp'){window.location.href=BASE_PATH+'/book/pay/t/'+tag+'/pay/'+method;return!1} 212alert('Please select a payment method')} 213function redoPayment(method,tag){$(".loading").show();if(payMethods.indexOf(method)>-1){window.location.href=BASE_PATH+'/book/pay/t/'+tag+'/pay/'+method;return!1} 214if(method=='pp'){window.location.href=BASE_PATH+'/book/paypal-pay/t/'+tag+'/pay/'+method;return!1}} 215function gpPayment(){var tag=$('#t').val();if(tag.length==0){tag=$('#gpTag').val()} 216var method=$('input[name=mp_pay]:checked').val();if(!method) 217return alert(t('js_be_selezionare_metodo_pagamen'));setTimeout(function(){$(".loading").show()},100);if(payMethods.indexOf(method)>-1){window.location.href=BASE_PATH+'/guest/pay/t/'+tag+'/pay/'+method;return!1} 218if(method=='pp'){window.location.href=BASE_PATH+'/guest/pay/t/'+tag+'/pay/'+method;return!1}} 219function payLink(token,tag){$(".loading").show();hideLoadingMan=!0;var method=$('input[name=mp_pay]:checked').val();if(!method) 220return alert(t('js_be_selezionare_metodo_pagamen'));window.location.href=BASE_PATH+'/payment/pay/t/'+tag+'/token/'+token+'/pay/'+method} 221function redoPaymentStripe(){$('#stripeButton').click()} 222function saveCC(){$(".loading").show();hideLoadingMan=!0;$.post(BASE_PATH+"/book/save-cc",$('#formBookData').serialize()).done(function(data){if(data.ok=="1"){document.location=BASE_PATH+"/book/confirm-cc/t/"+data.tag}else{alert("Error, impossible to continue. Please contact the support.")}}).fail(function(){alert("Error, impossible to continue. Please contact the support.")})};function alertErrorPublic(err){alert(err)} 223function guestPortalPreviousStep(current){var tag=$('input[name=t]').val();$.ajax({url:BASE_PATH+'/guest/previous-step?t='+tag+'¤t='+current+'&ajax=true',error:function(err){alertErrorPublic(err)},success:function(data){$('#guest-portal-page').html(data)}})} 224function selectNumGuests(id){var n=$('#num_guests_'+id).val();$('.guest-'+id).each(function(){if(parseInt($(this).attr('data-nroomguest'))<=n){$(this).show();$(this).find('input.guestdisabled').val(0)}else{$(this).hide();$(this).find('input.guestdisabled').val(1)}})} 225var openCheckInId;function openCheckinModal(id,tag,main,room_cod_country,btn){if(!main){main=0} 226if($('#checkIn'+id).hasClass('show')){$('#checkInFormBtn'+id).trigger('click');$('.checkInFormBtn').removeClass('disabled')}else{$.get(BASE_PATH+'/guest/checkin?id='+id+'&t='+tag+'&main='+main+'&room_cod_country='+room_cod_country+'&ajax=true',function(data){openCheckInId=id;$('.collapse.checkInCollapse .card-body').html('');$('.collapse.checkInCollapse.show').removeClass('show');$('#checkIn'+id+' .card-body').html(data);$('#checkInFormBtn'+id).trigger('click');$('.checkInFormBtn').addClass('disabled');if($(window).width()<1024){scrollTopObj('#checkIn'+openCheckInId)}})}} 227function openSelfieModal(id,tag){$('#selfieModal #id_room_4_reservation_4_guest_self').val(id);$('#selfieModal #tag').val(tag);$('#selfieModal').modal();try{var isMobile=!1;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge|maemo|midp|mmp|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-||_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
227sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))){isMobile=!0} 228if(!isMobile){var att=Webcam.set({width:568,height:426,image_format:'jpeg',jpeg_quality:90});Webcam.on('error',function(){$('#btn-take-selfie').hide();$('#my_camera').hide()});if(att===!1){$('#btn-take-selfie').hide();$('#my_camera').hide()}else delSelfie();Webcam.attach('#my_camera')}else{$('#btn-take-selfie').hide();$('#my_camera').hide()}}catch(error){$('#btn-take-selfie').hide();$('#my_camera').hide()}} 229function confirmCaptureGp(){var video=document.getElementById('gpvideo');var canvas=document.createElement('canvas');canvas.width=$('#gpvideo').width();canvas.height=$('#gpvideo').height();var ctx=canvas.getContext('2d');ctx.drawImage(video,0,0,canvas.width,canvas.height);var dataURI=canvas.toDataURL('image/png');$('#capturegp').html('<img id="gpimg" src="'+dataURI+'" class="img-responsive" /><div style="margin-top:10px">'+'<button class="btn btn-danger" onclick="captureGreenPass();return false;"><i class="fa fa-times"></i> Annulla</button>'+'<button class="btn btn-success pull-right" onclick="saveGpFromWebcam();return false;"><i class="fa fa-check"></i> Conferma</button>'+'<div style="clear:both"></div>')} 230function saveGpFromWebcam(){var p={doc:'gp',src:$('#gpimg').attr('src'),id:123123123};$.ajax({url:'/admin/ospiti/load-document-from-webcam',data:p,type:'post',traditional:!0,success:function(data){hideCurrentModal();guestDocumentImage(123123123)}})} 231function totaleServizio(){var total_booking_serv=0;$('.qt-service').each(function(){var idserv=$(this).attr('data-id');var pr=0;if($(this).val()) 232pr=parseFloat(parseFloat($(this).val())*parseFloat($(this).attr('data-price')));$('#totale_serv_'+idserv).html(pr.formatMoney(2,',','.'));total_booking_serv+=pr});$('#total_booking_serv').html(total_booking_serv.formatMoney(2,',','.'))} 233function savePaymentStep(){var tag=$('#t').val();var method=$('input[name=mp_pay]:checked').val();if(!method) 234return alert('Selezionare un metodo di pagamento');$('#formPayGuestPortal').append($('#credit-card-form'));$.ajax({type:"POST",url:$('#formPayGuestPortal').attr('action')+'?ajax=true',data:$('#formPayGuestPortal').serialize(),error:function(err){alertErrorPublic(err)},timeout:15000,success:function(data){if(method=='nopay'||method=='cc'||method=='bb'||method=='paycash'){$('#guest-portal-page').html(data)}else{gpPayment()}}});return!1} 235function goToStep(step){$.ajax({type:"POST",url:BASE_PATH+'/guest/get-step/?ajax=true&step='+step,error:function(err){alertErrorPublic(err)},timeout:15000,success:function(data){$('#guest-portal-page').html(data)}})};!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):e.AOS=t()}(this,function(){"use strict";var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t="Expected a function",n=NaN,o="[object Symbol]",i=/^\s+|\s+$/g,a=/^[-+]0x[0-9a-f]+$/i,r=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt,u="object"==typeof e&&e&&e.Object===Object&&e,d="object"==typeof self&&self&&self.Object===Object&&self,l=u||d||Function("return this")(),f=Object.prototype.toString,m=Math.max,p=Math.min,b=function(){return l.Date.now()};function v(e,n,o){var i,a,r,c,s,u,d=0,l=!1,f=!1,v=!0;if("function"!=typeof e)throw new TypeError(t);function y(t){var n=i,o=a;return i=a=void 0,d=t,c=e.apply(o,n)}function h(e){var t=e-u;return void 0===u||t>=n||t<0||f&&e-d>=r}function k(){var e=b();if(h(e))return x(e);s=setTimeout(k,function(e){var t=n-(e-u);return f?p(t,r-(e-d)):t}(e))}function x(e){return s=void 0,v&&i?y(e):(i=a=void 0,c)}function O(){var e=b(),t=h(e);if(i=arguments,a=this,u=e,t){if(void 0===s)return function(e){return d=e,s=setTimeout(k,n),l?y(e):c}(u);if(f)return s=setTimeout(k,n),y(u)}return void 0===s&&(s=setTimeout(k,n)),c}return n=w(n)||0,g(o)&&(l=!!o.leading,r=(f="maxWait"in o)?m(w(o.maxWait)||0,n):r,v="trailing"in o?!!o.trailing:v),O.cancel=function(){void 0!==s&&clearTimeout(s),d=0,i=u=a=s=void 0},O.flush=function(){return void 0===s?c:x(b())},O}function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function w(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&f.call(e)==o}(e))return n;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var u=r.test(e);return u||c.test(e)?s(e.slice(2),u?2:8):a.test(e)?n:+e}var y=function(e,n,o){var i=!0,a=!0;if("function"!=typeof e)throw new TypeError(t);return g(o)&&(i="leading"in o?!!o.leading:i,a="trailing"in o?!!o.trailing:a),v(e,n,{leading:i,maxWait:n,trailing:a})},h="Expected a function",k=NaN,x="[object Symbol]",O=/^\s+|\s+$/g,j=/^[-+]0x[0-9a-f]+$/i,E=/^0b[01]+$/i,N=/^0o[0-7]+$/i,z=parseInt,C="object"==typeof e&&e&&e.Object===Object&&e,A="object"==typeof self&&self&&self.Object===Object&&self,q=C||A||Function("return this")(),L=Object.prototype.toString,T=Math.max,M=Math.min,S=function(){return q.Date.now()};function D(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function H(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&L.call(e)==x}(e))return k;if(D(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=D(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(O,"");var n=E.test(e);return n||N.test(e)?z(e.slice(2),n?2:8):j.test(e)?k:+e}var $=function(e,t,n){var o,i,a,r,c,s,u=0,d=!1,l=!1,f=!0;if("function"!=typeof e)throw new TypeError(h);function m(t){var n=o,a=i;return o=i=void 0,u=t,r=e.apply(a,n)}function p(e){var n=e-s;return void 0===s||n>=t||n<0||l&&e-u>=a}function b(){var e=S();if(p(e))return v(e);c=setTimeout(b,function(e){var n=t-(e-s);return l?M(n,a-(e-u)):n}(e))}function v(e){return c=void 0,f&&o?m(e):(o=i=void 0,r)}function g(){var e=S(),n=p(e);if(o=arguments,i=this,s=e,n){if(void 0===c)return function(e){return u=e,c=setTimeout(b,t),d?m(e):r}(s);if(l)return c=setTimeout(b,t),m(s)}return void 0===c&&(c=setTimeout(b,t)),r}return t=H(t)||0,D(n)&&(d=!!n.leading,a=(l="maxWait"in n)?T(H(n.maxWait)||0,t):a,f="trailing"in n?!!n.trailing:f),g.cancel=function(){void 0!==c&&clearTimeout(c),u=0,o=s=i=c=void 0},g.flush=function(){return void 0===c?r:v(S())},g},W=function(){};function P(e){e&&e.forEach(function(e){var t=Array.prototype.slice.call(e.addedNodes),n=Array.prototype.slice.call(e.removedNodes
235);if(function e(t){var n=void 0,o=void 0;for(n=0;n<t.length;n+=1){if((o=t[n]).dataset&&o.dataset.aos)return!0;if(o.children&&e(o.children))return!0}return!1}(t.concat(n)))return W()})}function Y(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}var _={isSupported:function(){return!!Y()},ready:function(e,t){var n=window.document,o=new(Y())(P);W=t,o.observe(n.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}},B=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},F=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},K=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge|maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,G=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-||_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(|\/)|klon|kpt|kwc\-|kyo(c|k)|le(no|xi)|lg(g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-||o|v)|zz)|mt(50|p1|v)|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v)|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|)|webc|whit|wi(g|nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,J=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge|maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,Q=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-||_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt(|\/)|klon|kpt|kwc\-|kyo(c|k)|le(no|xi)|lg(g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-||o|v)|zz)|mt(50|p1|v)|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v)|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-|)|webc|whit|wi(g|nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;function R(){return navigator.userAgent||navigator.vendor||window.opera||""}var U=new(function(){function e(){B(this,e)}return F(e,[{key:"phone",value:function(){var e=R();return!(!K.test(e)&&!G.test(e.substr(0,4)))}},{key:"mobile",value:function(){var e=R();return!(!J.test(e)&&!Q.test(e.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}},{key:"ie11",value:function(){return"-ms-scroll-limit"in document.documentElement.style&&"-ms-ime-align"in document.documentElement.style}}]),e}()),V=function(e,t){var n=void 0;return U.ie11()?(n=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,{detail:t}):n=new CustomEvent(e,{detail:t}),document.dispatchEvent(n)},X=function(e){return e.forEach(function(e,t){return function(e,t){var n=e.options,o=e.position,i=e.node,a=(e.data,function(){e.animated&&(function(e,t){t&&t.forEach(function(t){return e.classList.remove(t)})}(i,n.animatedClassNames),V("aos:out",i),e.options.id&&V("aos:in:"+e.options.id,i),e.animated=!1)});n.mirror&&t>=o.out&&!n.once?a():t>=o.in?e.animated||(function(e,t){t&&t.forEach(function(t){return e.classList.add(t)})}(i,n.animatedClassNames),V("aos:in",i),e.options.id&&V("aos:in:"+e.options.id,i),e.animated=!0):e.animated&&!n.once&&a()}(e,window.pageYOffset)})},Z=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-("BODY"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-("BODY"!=e.tagName?e.scrollTop:0),e=e.offsetParent;return{top:n,left:t}},ee=function(e,t,n){var o=e.getAttribute("data-aos-"+t);if(void 0!==o){if("true"===o)return!0;
235if("false"===o)return!1}return o||n},te=function(e,t){return e.forEach(function(e,n){var o=ee(e.node,"mirror",t.mirror),i=ee(e.node,"once",t.once),a=ee(e.node,"id"),r=t.useClassNames&&e.node.getAttribute("data-aos"),c=[t.animatedClassName].concat(r?r.split(" "):[]).filter(function(e){return"string"==typeof e});t.initClassName&&e.node.classList.add(t.initClassName),e.position={in:function(e,t,n){var o=window.innerHeight,i=ee(e,"anchor"),a=ee(e,"anchor-placement"),r=Number(ee(e,"offset",a?0:t)),c=a||n,s=e;i&&document.querySelectorAll(i)&&(s=document.querySelectorAll(i)[0]);var u=Z(s).top-o;switch(c){case"top-bottom":break;case"center-bottom":u+=s.offsetHeight/2;break;case"bottom-bottom":u+=s.offsetHeight;break;case"top-center":u+=o/2;break;case"center-center":u+=o/2+s.offsetHeight/2;break;case"bottom-center":u+=o/2+s.offsetHeight;break;case"top-top":u+=o;break;case"bottom-top":u+=o+s.offsetHeight;break;case"center-top":u+=o+s.offsetHeight/2}return u+r}(e.node,t.offset,t.anchorPlacement),out:o&&function(e,t){window.innerHeight;var n=ee(e,"anchor"),o=ee(e,"offset",t),i=e;return n&&document.querySelectorAll(n)&&(i=document.querySelectorAll(n)[0]),Z(i).top+i.offsetHeight-o}(e.node,t.offset)},e.options={once:i,mirror:o,animatedClassNames:c,id:a}}),e},ne=function(){var e=document.querySelectorAll("[data-aos]");return Array.prototype.map.call(e,function(e){return{node:e}})},oe=[],ie=!1,ae={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,mirror:!1,anchorPlacement:"top-bottom",startEvent:"DOMContentLoaded",animatedClassName:"aos-animate",initClassName:"aos-init",useClassNames:!1,disableMutationObserver:!1,throttleDelay:99,debounceDelay:50},re=function(){return document.all&&!window.atob},ce=function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]&&(ie=!0),ie&&(oe=te(oe,ae),X(oe),window.addEventListener("scroll",y(function(){X(oe,ae.once)},ae.throttleDelay)))},se=function(){if(oe=ne(),de(ae.disable)||re())return ue();ce()},ue=function(){oe.forEach(function(e,t){e.node.removeAttribute("data-aos"),e.node.removeAttribute("data-aos-easing"),e.node.removeAttribute("data-aos-duration"),e.node.removeAttribute("data-aos-delay"),ae.initClassName&&e.node.classList.remove(ae.initClassName),ae.animatedClassName&&e.node.classList.remove(ae.animatedClassName)})},de=function(e){return!0===e||"mobile"===e&&U.mobile()||"phone"===e&&U.phone()||"tablet"===e&&U.tablet()||"function"==typeof e&&!0===e()};return{init:function(e){return ae=I(ae,e),oe=ne(),ae.disableMutationObserver||_.isSupported()||(console.info('\n aos: MutationObserver is not supported on this browser,\n code mutations observing has been disabled.\n You may have to call "refreshHard()" by yourself.\n '),ae.disableMutationObserver=!0),ae.disableMutationObserver||_.ready("[data-aos]",se),de(ae.disable)||re()?ue():(document.querySelector("body").setAttribute("data-aos-easing",ae.easing),document.querySelector("body").setAttribute("data-aos-duration",ae.duration),document.querySelector("body").setAttribute("data-aos-delay",ae.delay),-1===["DOMContentLoaded","load"].indexOf(ae.startEvent)?document.addEventListener(ae.startEvent,function(){ce(!0)}):window.addEventListener("load",function(){ce(!0)}),"DOMContentLoaded"===ae.startEvent&&["complete","interactive"].indexOf(document.readyState)>-1&&ce(!0),window.addEventListener("resize",$(ce,ae.debounceDelay,!0)),window.addEventListener("orientationchange",$(ce,ae.debounceDelay,!0)),oe)},refresh:ce,refreshHard:se}});function checkDat(){var fields=$('.checkMeDat');var enable=!0;if(fields.length>0){$('.checkMeDat').each(function(){if($(this).val()==undefined||$(this).val()===0||$(this).val()==''){if($(this).hasClass('select2-hidden-accessible')&&$(this).attr('value')!==undefined&&$(this).attr('value')!==0&&$(this).attr('value')!==''){$(this).parent().find('.select2-selection__rendered').empty()} 236enable=!1}})}else{enable=!1} 237if(enable){$('.next-button:visible').removeClass('disabled')}else{$('.checkInCollapse.show #nav-doc-tab').addClass('disabled');$('.checkInCollapse.show #nav-rec-tab').addClass('disabled');$('.next-button:visible').addClass('disabled')}} 238function checkDoc(){var fields=$('.checkMeDoc');var enable=!0;if(fields.length>0){$('.checkMeDoc').each(function(){if($(this).val()==undefined||$(this).val()===0||$(this).val()==''){if($(this).hasClass('select2-hidden-accessible')&&$(this).attr('value')!==undefined&&$(this).attr('value')!==0&&$(this).attr('value')!==''){$(this).parent().find('.select2-selection__rendered').empty()} 239enable=!1}})}else{enable=!0}
240if(enable){$('.checkInCollapse.show #formNextButton').removeClass('disabled')}else{$('.checkInCollapse.show #nav-rec-tab').addClass('disabled');$('.checkInCollapse.show #formNextButton').addClass('disabled')}} 241function checkRec(){var fields=$('.checkInCollapse:visible #nav-rec .checkMeRec');var enable=!0;if(fields.length){$('.checkInCollapse:visible #nav-rec .checkMeRec').each(function(){if($(this).val()==undefined||$(this).val()===0||$(this).val().trim()==''){if($(this).hasClass('select2-hidden-accessible')&&$(this).attr('value')!==undefined&&$(this).attr('value')!==0&&$(this).attr('value')!==''){$(this).parent().find('.select2-selection__rendered').empty()} 242enable=!1}})}else{enable=!0} 243if(enable){$('.checkInCollapse.show #formNextButton').removeClass('disabled');$('.checkInCollapse.show #btn-save-edit').removeClass('disabled')}else{$('.checkInCollapse.show #formNextButton').addClass('disabled');$('.checkInCollapse.show #btn-save-edit').addClass('disabled')}} 244function CheckInCancel(id){CheckInPrev1();$('#checkInFormBtn'+id).trigger('click');$('#btn'+id).removeClass('d-none');$('.collapse.checkInCollapse .card-body').html('');$('.collapse.checkInCollapse.show').removeClass('show');$('.checkInFormBtn').removeClass('disabled');if($(window).width()<1024){scrollTopObj('#guest-'+id)} 245openCheckInId=undefined} 246function CheckInNext1(){if($('#cod_citizenship:visible').val()&&$('#cod_citizenship:visible').val()=='100000239'){if($('#birthdate_d:visible').val()&&$('#birthdate_m:visible').val()&&$('#birthdate_y:visible').val()){var birthdate=new Date($('#birthdate_y').val()+'-'+$('#birthdate_m').val()+'-'+$('#birthdate_d').val());var today=new Date();var age=(today.getFullYear()-birthdate.getFullYear());if(today.getMonth()<birthdate.getMonth()||today.getMonth()==birthdate.getMonth()&&today.getDate()<birthdate.getDate()){age--} 247if(age<14){$('.checkInCollapse:visible #nav-doc #cod_personal_doc_type').removeClass('checkMeDoc');$('.checkInCollapse:visible #nav-doc #number_document').removeClass('checkMeDoc');$('.checkInCollapse:visible #nav-doc #release_date_d').removeClass('checkMeDoc');$('.checkInCollapse:visible #nav-doc #release_date_m').removeClass('checkMeDoc');$('.checkInCollapse:visible #nav-doc #release_date_y').removeClass('checkMeDoc');$('.checkInCollapse:visible #nav-doc .checkRequired').removeClass('d-inline-flex').addClass('d-none')} 248else{$('.checkInCollapse:visible #nav-doc #cod_personal_doc_type').addClass('checkMeDoc');$('.checkInCollapse:visible #nav-doc #number_document').addClass('checkMeDoc');$('.checkInCollapse:visible #nav-doc #release_date_d').addClass('checkMeDoc');$('.checkInCollapse:visible #nav-doc #release_date_m').addClass('checkMeDoc');$('.checkInCollapse:visible #nav-doc #release_date_y').addClass('checkMeDoc');$('.checkInCollapse:visible #nav-doc .checkRequired').addClass('d-inline-flex').removeClass('d-none')}}} 249if($('.checkInCollapse.show #nav-doc .row').html()==''){$('.checkInCollapse.show #formPrevButton').removeClass('d-none');CheckInNext2()}else{$('.checkInCollapse.show #nav-doc-tab').removeClass('disabled').trigger('click');$('.checkInCollapse.show #formNextButton').attr('onclick','CheckInNext2()');$('.checkInCollapse.show #formPrevButton').removeClass('d-none');checkDoc()} 250if(typeof openCheckInId!='undefined'&&$(window).width()<1024){scrollTopObj('#checkIn'+openCheckInId)}} 251function CheckInNext2(){$('.checkInCollapse.show #nav-rec-tab').removeClass('disabled').trigger('click') 252$('.checkInCollapse.show #formNextButton').addClass('d-none');$('.checkInCollapse.show #formPrevButton').attr('onclick','CheckInPrev2()');$('.checkInCollapse.show #btn-save-edit').removeClass('d-none');checkRec();if(typeof openCheckInId!='undefined'&&$(window).width()<1024){scrollTopObj('#checkIn'+openCheckInId)}} 253function CheckInPrev1(){$('.checkInCollapse.show #nav-dati-tab').trigger('click');$('.checkInCollapse.show #formNextButton').attr('onclick','CheckInNext1()');$('.checkInCollapse.show #formPrevButton').addClass('d-none');if(typeof openCheckInId!='undefined'&&$(window).width()<1024){scrollTopObj('#checkIn'+openCheckInId)}} 254function CheckInPrev2(){if($('.checkInCollapse.show #nav-doc .row').html()==''){CheckInPrev1()}else{$('.checkInCollapse.show #nav-doc-tab').trigger('click');$('.checkInCollapse.show #formNextButton').attr('onclick','CheckInNext2()');$('.checkInCollapse.show #formPrevButton').removeClass('d-none');$('.checkInCollapse.show #formNextButton').removeClass('d-none');$('.checkInCollapse.show #btn-save-edit').addClass('d-none')} 255if(typeof openCheckInId!='undefined'&&$(window).width()<1024){scrollTopObj('#checkIn'+openCheckInId)}};var kross_map;var markers=[];var map_providers={'osm':'https://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png','lima':'https://cdn.lima-labs.com/{z}/{x}/{y}.png?api=7aJehcYAewLaa8bBEukOHHABMRolA00001'};function addMarker(lat,lon,icon,anchor,height){var marker_icon=L.icon({iconUrl:icon,iconAnchor:[anch
255or,height],});var marker=L.marker([lat,lon],{icon:marker_icon});markers.push(marker)} 256function addMarkerOnce(lat,lon,icon,anchor,height){addMarker(lat,lon,icon,anchor,height);var featureGroup=L.featureGroup(markers).addTo(kross_map);kross_map.setView([lat,lon],mapZoomDetail)} 257function initMapDetail(){var latlng=L.latLng(mapLatLng1,mapLatLng2);if($('#guest_map').length==0){return} 258kross_map=L.map('guest_map',{zoom:10,zoomSnap:0.1,maxZoom:19});var tile_default=L.maplibreGL({style:'https://tiles.openfreemap.org/styles/bright'});if(kross_map_satellite){var tile_satellite=L.tileLayer('http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',{maxZoom:20,subdomains:['mt0','mt1','mt2','mt3']});var tiles={"Default":tile_default,"Satellite":tile_satellite};L.control.layers(tiles).addTo(kross_map)} 259tile_default.addTo(kross_map)} 260var kross_maps=[];function initMapCms(map_id,initialLat,initialLng,initialZoom,markers){latlng=L.latLng(initialLat,initialLng);kross_maps[map_id]=L.map(map_id,{zoom:initialZoom,zoomSnap:0.1,maxZoom:19,scrollWheelZoom:!1});var tile_default=L.maplibreGL({style:'https://tiles.openfreemap.org/styles/bright'});if(kross_map_satellite){var tile_satellite=L.tileLayer('http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',{maxZoom:20,subdomains:['mt0','mt1','mt2','mt3']});var tiles={"Default":tile_default,"Satellite":tile_satellite};L.control.layers(tiles).addTo(kross_maps[map_id])} 261tile_default.addTo(kross_maps[map_id]);markersL=L.markerClusterGroup({showCoverageOnHover:!1,polygonOptions:{fillColor:markerClusterColor,color:'#412451',},maxClusterRadius:30,spiderfyDistanceMultiplier:3,iconCreateFunction:function(cluster){var childCount=cluster.getChildCount();var c=' marker-cluster-';if(childCount<10){c+='small'}else if(childCount<100){c+='medium'}else{c+='large'} 262return new L.DivIcon({html:'<div><span>'+childCount+'</span></div>',className:'marker-cluster'+c,iconSize:new L.Point(40,40)})},});markersL.on('clusterclick',function(a){kross_maps[map_id].fitBounds(a.layer.getBounds().pad(0.8))});kross_maps[map_id].setView(latlng,initialZoom);markerArray=new Array();markerFullArray=new Array();for(var i_marker in markers){markerArray.push([markers[i_marker].lat,markers[i_marker].lon,'marker-'+map_id+'-'+i_marker])};markersL.clearLayers();for(var i=0;i<markerArray.length;i++){var a=markerArray[i];var marker_icon=L.icon({iconUrl:markerIconUrl,iconSize:[24,35],iconAnchor:markerIconAnchor,});var marker=L.marker(new L.LatLng(a[0],a[1]),{customId:a[2],icon:marker_icon});markerFullArray.push(marker)} 263markersL.addLayers(markerFullArray,{chunkedLoading:!0,chunkInterval:100});kross_maps[map_id].addLayer(markersL)} 264function initMapDEPR(){latlng=L.latLng(mapLatLng1,mapLatLng2);tiles=L.maplibreGL({style:'https://tiles.openfreemap.org/styles/bright'});if($('#kross_map').length==0){return} 265kross_map=L.map('kross_map',{layers:[tiles],zoom:10,zoomSnap:0.1});markers=L.markerClusterGroup({showCoverageOnHover:!1,polygonOptions:{fillColor:markerClusterColor,color:'#412451',},maxClusterRadius:30,spiderfyDistanceMultiplier:3,iconCreateFunction:function(cluster){var childCount=cluster.getChildCount();var c=' marker-cluster-';if(childCount<10){c+='small'}else if(childCount<100){c+='medium'}else{c+='large'} 266return new L.DivIcon({html:'<div><span>'+childCount+'</span></div>',className:'marker-cluster'+c,iconSize:new L.Point(40,40)})},});markers.on('clusterclick',function(a){kross_map.fitBounds(a.layer.getBounds().pad(0.8))});markers.on('click',function(a){var scelta=$('div[data-id='+a.layer.options.customId+'] .listing-outer');var parentScelta=scelta.parent();var priceshown;var priceshownVal;if(parentScelta.data('calcpricefrom')){priceshownVal=parentScelta.data('calcpricefrom')}else{priceshownVal=parentScelta.data('shortterm')} 267priceshown=pr(priceshownVal,0);var guests=parentScelta.data('guests');var beds=parentScelta.data('beds');var baths=parentScelta.data('baths');var photoDiv=scelta.find('.divimg');var coverPhoto='<div class="img-not-available"></div>';var name=scelta.find('.name-apt h4').html();var url=scelta.find('.name-apt').attr('href');var address=scelta.find('.address-apt').html();if(typeof address==='undefined'){address='';scelta.find('.address-apt').addClass('d-none')} 268if(!photoDiv.hasClass('img-not-available')){var photoUrl=photoDiv.css('background-image').replace(/^url\(['"]?/,'').replace(/['"]?\)$/,'');if(photoUrl){coverPhoto='<a href="'+url+'"><img class="img-fluid border-top" src="'+photoUrl+'"></a>'}} 269var popupContent='<div class="position-relative inner-marker-popup pb-2">';popupContent=popupContent+coverPhoto;if(priceshownVal>0){popupContent=popupContent+'<div class="position-absolute text-left overlay-marker-popup-price shadow-lg py-2 pl-3 pr-3">
269'+priceshown+'</div>'} 270popupContent=popupContent+'<div class=" text-left overlay-marker-popup">';popupContent=popupContent+'<h6 class="px-3"><a class="name-apt" href="'+url+'">'+name+'</a><br><small class="text-muted"><i>'+address+'</i></small></h6>';popupContent=popupContent+'</div>';if(beLayout!='pr'){popupContent=popupContent+'<div class="px-3"><i class="fal fa-fw fa-users"></i> '+guests+'<i class="ml-3 fal fa-fw fa-bed"></i> '+beds+'<i class="ml-3 fal fa-fw fa-bath"></i> '+baths+'</div>'} 271popupContent=popupContent+'</div>';$('.listings-wrapper .listing-item .listing-outer').removeClass('selectedProperty');a.layer.bindPopup(popupContent,{minWidth:300,closeButton:!1,offset:new L.Point(6,-6)}).openPopup();mapMarkerScroll(a)});if(typeof kross_map=='undefined'){return} 272kross_map.on("moveend",function(s){filterListByBounds()});kross_map.setView(latlng,mapZoom)};function kross_cal_cb3(obj,start,end){if(typeof start!=='undefined'){if(typeof end=='undefined'){end=start} 273$('.arrival').html(start.format('DD MMMM YYYY'));$('.departure').html(end.format('DD MMMM YYYY'));$('.arrival-short').html('<span class="big">'+start.format('DD')+'</span><br>'+start.format('MMMM'));$('.departure-short').html('<span class="big">'+end.format('DD')+'</span><br>'+end.format('MMMM'));$('.arrival-long').html(start.format('DD/MM/YYYY'));$('.departure-long').html(end.format('DD/MM/YYYY'));$('.kross-calendar input[name=from]').val(start.format('YYYY-MM-DD'));$('.kross-calendar input[name=to]').val(end.format('YYYY-MM-DD'));$('.cal-res-top-nights').css("visibility","visible");var nights=end.diff(start,'days');if(typeof nonric_calendar_1day!='undefined'&&nonric_calendar_1day){nights+=1;$('.nights').html(nights);if(nights>1) 274$('.calendarNightsCircleText').html(t('giorni'));else $('.calendarNightsCircleText').html(t('giorno'))}else{$('.nights').html(nights);if(nights>1) 275$('.calendarNightsCircleText').html(t('notti'));else $('.calendarNightsCircleText').html(t('notte'))} 276$('.cal-res').show();if($("#roomsGeneral").children().length==1){$('#roomsGeneral').show();$('#roomsGeneralAdd').show()} 277$('#checkAvailabilityBtn a').removeClass('disabled');if(nonric_calendar_1day){end.add(1,'day')} 278kross_from=start.format('YYYY-MM-DD');kross_to=end.format('YYYY-MM-DD')}else{$('.arrival').html('-');$('.departure').html('-');$('.arrival-short').html('<span class="big">-</span><br> ');$('.departure-short').html('<span class="big">-</span><br> ');$('.arrival-long').html('-');$('.departure-long').html('-');$('.kross-calendar input[name=from]').val('');$('.kross-calendar input[name=to]').val('');kross_from='';kross_to=''}} 279function cb_long(obj,start,end){cb(obj,start,end,!0)} 280function cb_short(obj,start,end){cb(obj,start,end,!1)} 281function cb3(obj,start,end,format){var fr='MMMM YYYY';if($(window).width()<800) 282fr='MMM YY';if(start==''||!start.isValid()) 283return;if(obj.find('.kb-select-dates')) 284obj.find('.kb-select-dates').hide();obj.find('.kb-d1').show();obj.find('.kb-d2').show();switch(format){case 1:var element_checkin=`<span itemprop="checkinTime" content="${start.format('YYYY-MM-DD')}">${start.format('D MMM')}</span>`;var element_checkout=`<span itemprop="checkoutTime" content="${end.format('YYYY-MM-DD')}">${end.format('D MMM')}</span>`;obj.find('.kb-d1').html(element_checkin);obj.find('.kb-d2').html(element_checkout);break;case 2:var element_checkin=`<span itemprop="checkinTime" content="${start.format('YYYY-MM-DD')}">${start.format('D MMMM')}</span>`;var element_checkout=`<span itemprop="checkoutTime" content="${end.format('YYYY-MM-DD')}">${end.format('D MMMM')}</span>`;obj.find('.kb-d1').html(element_checkin);obj.find('.kb-d2').html(element_checkout);break;default:var start_label=start.format('ddd')+" "+start.format('DD')+" "+start.format('MMM');var end_label=end.format('ddd')+" "+end.format('DD')+" "+end.format('MMM');var current_year=new Date().getFullYear();if(current_year!=end.format('YYYY')){start_label=start.format('DD')+" "+start.format('MMM')+" "+start.format('YYYY');end_label=end.format('DD')+" "+end.format('MMM')+" "+end.format('YYYY')} 285obj.find('.kb-d1').html(start_label+" - "+end_label)} 286$('#kross_period').val(start.format('DD/MM/YYYY')+' - '+end.format('DD/MM/YYYY'));$('#kross_from').val(start.format('YYYY-MM-DD'));$('#kross_to').val(end.format('YYYY-MM-DD'));$('#kross_from_mobile').val(start.format('YYYY-MM-DD')).change();$('#kross_to_mobile').val(end.format('YYYY-MM-DD'));$('#kross_period_mobile').val(start.format('DD/MM/YYYY')+' - '+end.format('DD/MM/YYYY'));kross_from=start.format('YYYY-MM-DD');kross_to=end.format('YYYY-MM-DD');if(typeof refreshLocations!=='undefined'){switch(refreshLocations){case 'city':loadRemoteCities(kross_lang,'',kross_from,kross_to);break;case 'group':loadRemoteBeGroups(kross_lang,'');break;case 'collection':loadRemoteCollections(kross_lang,'');break;case 'id_room_type_category':loadRemoteRoomTypeCategories(kross_lang,'');break;case 'area':loadRemoteAreasPr(kross_lang,'');break;case 'district':loadRemoteDistrictsPr(kross_lang,'');break}} 287if(typeof panelAvailability!='undefined'){panelAvailability()}} 288function cb3_long(obj,start,end){cb3(obj,start,end,!0)} 289function cb3_short(obj,start,end){cb3(obj,start,end,!1)} 290function cb3_auto(obj,start,end){cb3(obj,start,end,$(window).width()>=1400?2:1)};jQuery(document).ready(function(){(function($,moment){var DateRangePicker=function(element,options,cb){this.parentEl='body';this.element=$(element);this.startDate=null;this.endDate=null;this.minDate=!1;this.maxDate=!1;this.maxSpan=!1;this.autoApply=!1;this.singleDatePicker=!1;this.showDropdowns=!1;this.minYear=moment().subtract(100,'year').format('YYYY');this.maxYear=moment().add(100,'year').format('YYYY');this.showWeekNumbers=!1;this.showISOWeekNumbers=!1;this.showCustomRangeLabel=!0;this.timePicker=!1;this.timePicker24Hour=!1;this.timePickerIncrement=1;this.timePickerSeconds=!1;this.linkedCalendars=!0;this.autoUpdateInput=!0;this.alwaysShowCalendars=!1;this.ranges={};this.opens='right';if(this.element.hasClass('pull-right')) 291this.opens='left';this.drops='down';if(this.element.hasClass('dropup')) 292this.drops='up';
292this.buttonClasses='btn btn-sm';this.applyButtonClasses='btn-primary';this.cancelButtonClasses='btn-default';this.locale={direction:'ltr',format:moment.localeData().longDateFormat('L'),separator:' - ',applyLabel:'Apply',cancelLabel:'Cancel',weekLabel:'W',customRangeLabel:'Custom Range',daysOfWeek:moment.weekdaysMin(),monthNames:moment.months(),firstDay:moment.localeData().firstDayOfWeek()};this.callback=function(){};this.isShowing=!1;this.leftCalendar={};this.rightCalendar={};if(typeof options!=='object'||options===null) 293options={};options=$.extend(this.element.data(),options);if(typeof options.template!=='string'&&!(options.template instanceof $)) 294options.template='<div class="daterangepicker">'+'<div class="ranges"></div>'+'<div class="drp-calendar left">'+'<div class="calendar-table"></div>'+'<div class="calendar-time"></div>'+'</div>'+'<div class="drp-calendar right">'+'<div class="calendar-table"></div>'+'<div class="calendar-time"></div>'+'</div>'+'<div class="drp-buttons">'+'<span class="drp-selected"></span>'+'<button class="cancelBtn" type="button"></button>'+'<button class="applyBtn" disabled="disabled" type="button"></button> '+'</div>'+'</div>';this.parentEl=(options.parentEl&&$(options.parentEl).length)?$(options.parentEl):$(this.parentEl);this.container=$(options.template).appendTo(this.parentEl);this.singleMonth=!1;this.popupMode=!0;if(typeof options.singleMonth==='boolean') 295this.singleMonth=options.singleMonth;if(typeof options.popupMode==='boolean') 296this.popupMode=options.popupMode;if(typeof options.locale==='object'){if(typeof options.locale.direction==='string') 297this.locale.direction=options.locale.direction;if(typeof options.locale.format==='string') 298this.locale.format=options.locale.format;if(typeof options.locale.separator==='string') 299this.locale.separator=options.locale.separator;if(typeof options.locale.daysOfWeek==='object') 300this.locale.daysOfWeek=options.locale.daysOfWeek.slice();if(typeof options.locale.monthNames==='object') 301this.locale.monthNames=options.locale.monthNames.slice();if(typeof options.locale.firstDay==='number') 302this.locale.firstDay=options.locale.firstDay;if(typeof options.locale.applyLabel==='string') 303this.locale.applyLabel=options.locale.applyLabel;if(typeof options.locale.cancelLabel==='string') 304this.locale.cancelLabel=options.locale.cancelLabel;if(typeof options.locale.weekLabel==='string') 305this.locale.weekLabel=options.locale.weekLabel;if(typeof options.locale.customRangeLabel==='string'){var elem=document.createElement('textarea');elem.innerHTML=options.locale.customRangeLabel;var rangeHtml=elem.value;this.locale.customRangeLabel=rangeHtml}} 306this.container.addClass(this.locale.direction);if(typeof options.startDate==='string') 307this.startDate=moment(options.startDate,this.locale.format);if(typeof options.endDate==='string') 308this.endDate=moment(options.endDate,this.locale.format);if(typeof options.minDate==='string') 309this.minDate=moment(options.minDate,this.locale.format);if(typeof options.maxDate==='string') 310this.maxDate=moment(options.maxDate,this.locale.format);if(typeof options.startDate==='object') 311this.startDate=moment(options.startDate);if(typeof options.endDate==='object') 312this.endDate=moment(options.endDate);if(typeof options.minDate==='object') 313this.minDate=moment(options.minDate);if(typeof options.maxDate==='object') 314this.maxDate=moment(options.maxDate);if(this.minDate&&this.startDate!=null&&this.startDate.isBefore(this.minDate)) 315this.startDate=this.minDate.clone();if(this.maxDate&&this.endDate.isAfter(this.maxDate)) 316this.endDate=this.maxDate.clone();if(typeof options.applyButtonClasses==='string') 317this.applyButtonClasses=options.applyButtonClasses;if(typeof options.applyClass==='string') 318this.applyButtonClasses=options.applyClass;if(typeof options.cancelButtonClasses==='string') 319this.cancelButtonClasses=options.cancelButtonClasses;if(typeof options.cancelClass==='string') 320this.cancelButtonClasses=options.cancelClass;if(typeof options.maxSpan==='object') 321this.maxSpan=options.maxSpan;if(typeof options.dateLimit==='object') 322this.maxSpan=options.dateLimit;if(typeof options.opens==='string') 323this.opens=options.opens;if(typeof options.drops==='string') 324this.drops=options.drops;if(typeof options.showWeekNumbers==='boolean') 325this.showWeekNumbers=options.showWeekNumbers;if(typeof options.showISOWeekNumbers==='boolean') 326this.showISOWeekNumbers=options.showISOWeekNumbers;
326if(typeof options.buttonClasses==='string') 327this.buttonClasses=options.buttonClasses;if(typeof options.buttonClasses==='object') 328this.buttonClasses=options.buttonClasses.join(' ');if(typeof options.showDropdowns==='boolean') 329this.showDropdowns=options.showDropdowns;if(typeof options.minYear==='number') 330this.minYear=options.minYear;if(typeof options.maxYear==='number') 331this.maxYear=options.maxYear;if(typeof options.showCustomRangeLabel==='boolean') 332this.showCustomRangeLabel=options.showCustomRangeLabel;if(typeof options.singleDatePicker==='boolean'){this.singleDatePicker=options.singleDatePicker;if(this.startDate&&this.singleDatePicker) 333this.endDate=this.startDate.clone()} 334if(typeof options.timePicker==='boolean') 335this.timePicker=options.timePicker;if(typeof options.timePickerSeconds==='boolean') 336this.timePickerSeconds=options.timePickerSeconds;if(typeof options.timePickerIncrement==='number') 337this.timePickerIncrement=options.timePickerIncrement;if(typeof options.timePicker24Hour==='boolean') 338this.timePicker24Hour=options.timePicker24Hour;if(typeof options.autoApply==='boolean') 339this.autoApply=options.autoApply;if(typeof options.autoUpdateInput==='boolean') 340this.autoUpdateInput=options.autoUpdateInput;if(typeof options.linkedCalendars==='boolean') 341this.linkedCalendars=options.linkedCalendars;if(typeof options.isInvalidDate==='function') 342this.isInvalidDate=options.isInvalidDate;if(typeof options.isCustomDate==='function')
343this.isCustomDate=options.isCustomDate;if(typeof options.alwaysShowCalendars==='boolean') 344this.alwaysShowCalendars=options.alwaysShowCalendars;if(this.locale.firstDay!=0){var iterator=this.locale.firstDay;while(iterator>0){this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift());iterator--}} 345var start,end,range;if(typeof options.startDate==='undefined'&&typeof options.endDate==='undefined'){if($(this.element).is(':text')){var val=$(this.element).val(),split=val.split(this.locale.separator);start=end=null;if(split.length==2){start=moment(split[0],this.locale.format);end=moment(split[1],this.locale.format)}else if(this.singleDatePicker&&val!==""){start=moment(val,this.locale.format);end=moment(val,this.locale.format)} 346if(start!==null&&end!==null){this.setStartDate(start);this.setEndDate(end)}}} 347if(typeof options.ranges==='object'){for(range in options.ranges){if(typeof options.ranges[range][0]==='string') 348start=moment(options.ranges[range][0],this.locale.format);else start=moment(options.ranges[range][0]);if(typeof options.ranges[range][1]==='string') 349end=moment(options.ranges[range][1],this.locale.format);else end=moment(options.ranges[range][1]);if(this.minDate&&start.isBefore(this.minDate)) 350start=this.minDate.clone();var maxDate=this.maxDate;if(this.maxSpan&&maxDate&&start.clone().add(this.maxSpan).isAfter(maxDate)) 351maxDate=start.clone().add(this.maxSpan);if(maxDate&&end.isAfter(maxDate)) 352end=maxDate.clone();if((this.minDate&&end.isBefore(this.minDate,this.timepicker?'minute':'day'))||(maxDate&&start.isAfter(maxDate,this.timepicker?'minute':'day'))) 353continue;var elem=document.createElement('textarea');elem.innerHTML=range;var rangeHtml=elem.value;this.ranges[rangeHtml]=[start,end]} 354var list='<ul>';for(range in this.ranges){list+='<li data-range-key="'+range+'">'+range+'</li>'} 355if(this.showCustomRangeLabel){list+='<li data-range-key="'+this.locale.customRangeLabel+'">'+this.locale.customRangeLabel+'</li>'} 356list+='</ul>';this.container.find('.ranges').prepend(list)} 357if(typeof cb==='function'){this.callback=cb} 358if(!this.timePicker&&this.startDate!=null){this.startDate=this.startDate.startOf('day')} 359if(!this.timePicker&&this.endDate!=null){this.endDate=this.endDate.endOf('day')} 360if(!this.timePicker){this.container.find('.calendar-time').hide()} 361if(this.timePicker&&this.autoApply) 362this.autoApply=!1;if(this.autoApply){this.container.addClass('auto-apply')} 363if(typeof options.ranges==='object') 364this.container.addClass('show-ranges');if(this.singleDatePicker||this.singleMonth){this.container.addClass('single');this.container.find('.drp-calendar.left').addClass('single');this.container.find('.drp-calendar.left').show();this.container.find('.drp-calendar.right').hide();if(!this.timePicker&&this.autoApply){this.container.addClass('auto-apply')}} 365if((typeof options.ranges==='undefined'&&!this.singleDatePicker)||this.alwaysShowCalendars){this.container.addClass('show-calendar')} 366this.container.addClass('opens'+this.opens);this.container.find('.applyBtn, .cancelBtn').addClass(this.buttonClasses);if(this.applyButtonClasses.length) 367this.container.find('.applyBtn').addClass(this.applyButtonClasses);if(this.cancelButtonClasses.length) 368this.container.find('.cancelBtn').addClass(this.cancelButtonClasses);this.container.find('.applyBtn').html(this.locale.applyLabel);this.container.find('.cancelBtn').html(this.locale.cancelLabel);this.container.find('.drp-calendar').on('click.daterangepicker','.prev',$.proxy(this.clickPrev,this)).on('click.daterangepicker','.next',$.proxy(this.clickNext,this)).on('mousedown.daterangepicker','td.available',$.proxy(this.clickDate,this)).on('mouseenter.daterangepicker','td.available',$.proxy(this.hoverDate,this)).on('change.daterangepicker','select.yearselect',$.proxy(this.monthOrYearChanged,this)).on('change.daterangepicker','select.monthselect',$.proxy(this.monthOrYearChanged,this)).on('change.daterangepicker','select.hourselect,select.minuteselect,select.secondselect,select.ampmselect',$.proxy(this.timeChanged,this));this.container.find('.ranges').on('click.daterangepicker','li',$.proxy(this.clickRange,this));this.container.find('.drp-buttons').on('click.daterangepicker','button.applyBtn',$.proxy(this.clickApply,this)).on('click.daterangepicker','button.cancelBtn',$.proxy(this.clickCancel,this));if(this.element.is('input')||this.element.is('button')){this.element.on({'click.daterangepicker':$.proxy(this.show,this),'focu
368s.daterangepicker':$.proxy(this.show,this),'keyup.daterangepicker':$.proxy(this.elementChanged,this),'keydown.daterangepicker':$.proxy(this.keydown,this)})}else if(this.popupMode){this.element.on('click.daterangepicker',$.proxy(this.toggle,this));this.element.on('keydown.daterangepicker',$.proxy(this.toggle,this))} 369this.updateElement();if(!this.popupMode){this.show()}};DateRangePicker.prototype={constructor:DateRangePicker,setStartDate:function(startDate){if(typeof startDate==='undefined'){this.startDate=undefined}else{if(typeof startDate==='string') 370this.startDate=moment(startDate,this.locale.format);if(typeof startDate==='object') 371this.startDate=moment(startDate);if(!this.timePicker) 372this.startDate=this.startDate.startOf('day');if(this.timePicker&&this.timePickerIncrement) 373this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement);if(this.minDate&&this.startDate.isBefore(this.minDate)){this.startDate=this.minDate.clone();if(this.timePicker&&this.timePickerIncrement) 374this.startDate.minute(Math.round(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement)} 375if(this.maxDate&&this.startDate.isAfter(this.maxDate)){this.startDate=this.maxDate.clone();if(this.timePicker&&this.timePickerIncrement) 376this.startDate.minute(Math.floor(this.startDate.minute()/this.timePickerIncrement)*this.timePickerIncrement)}} 377if(!this.isShowing) 378this.updateElement();this.updateMonthsInView()},setEndDate:function(endDate){if(typeof endDate==='undefined'){this.endDate=undefined}else{if(typeof endDate==='string') 379this.endDate=moment(endDate,this.locale.format);if(typeof endDate==='object') 380this.endDate=moment(endDate);if(!this.timePicker) 381this.endDate=this.endDate.endOf('day');if(this.timePicker&&this.timePickerIncrement) 382this.endDate.minute(Math.round(this.endDate.minute()/this.timePickerIncrement)*this.timePickerIncrement);if(this.endDate.isBefore(this.startDate)) 383this.endDate=this.startDate.clone();if(this.maxDate&&this.endDate.isAfter(this.maxDate)) 384this.endDate=this.maxDate.clone();if(this.maxSpan&&this.startDate.clone().add(this.maxSpan).isBefore(this.endDate)) 385this.endDate=this.startDate.clone().add(this.maxSpan);this.previousRightTime=this.endDate.clone();this.container.find('.drp-selected').html(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format))} 386if(!this.isShowing) 387this.updateElement();this.updateMonthsInView()},isInvalidDate:function(){return!1},isCustomDate:function(){return!1},clearCalendar:function(){this.setEndDate(undefined);this.setStartDate(undefined);this.renderCalendar('left');this.renderCalendar('right')},updateView:function(){if(this.timePicker){this.renderTimePicker('left');this.renderTimePicker('right');if(!this.endDate){this.container.find('.right .calendar-time select').prop('disabled',!0).addClass('disabled')}else{this.container.find('.right .calendar-time select').prop('disabled',!1).removeClass('disabled')}} 388if(this.endDate) 389this.container.find('.drp-selected').html(this.startDate.format(this.locale.format)+this.locale.separator+this.endDate.format(this.locale.format));this.updateMonthsInView();this.updateCalendars();this.updateFormInputs()},updateMonthsInView:function(){if(this.endDate){if(!this.singleDatePicker&&this.leftCalendar.month&&this.rightCalendar.month&&(this.startDate.format('YYYY-MM')==this.leftCalendar.month.format('YYYY-MM')||this.startDate.format('YYYY-MM')==this.rightCalendar.month.format('YYYY-MM'))&&(this.endDate.format('YYYY-MM')==this.leftCalendar.month.format('YYYY-MM')||this.endDate.format('YYYY-MM')==this.rightCalendar.month.format('YYYY-MM'))){return} 390this.leftCalendar.month=this.startDate.clone().date(2);if(!this.linkedCalendars&&(this.endDate.month()!=this.startDate.month()||this.endDate.year()!=this.startDate.year())){this.rightCalendar.month=this.endDate.clone().date(2)}else{this.rightCalendar.month=this.startDate.clone().date(2).add(1,'month')}}else{if(this.startDate!=null&&this.leftCalendar.month.format('YYYY-MM')!=this.startDate.format('YYYY-MM')&&this.rightCalendar.month.format('YYYY-MM')!=this.startDate.format('YYYY-MM')){this.leftCalendar.month=this.startDate.clone().date(2);this.rightCalendar.month=this.startDate.clone().date(2).add(1,'month')}else if(this.startDate==null){this.leftCalendar.month=moment().date(2);this.rightCalendar.month=moment().date(2).add(1,'month')}} 391if(this.maxDate&&this.linkedCalendars&&!this.singleDatePicker&&this.rightCalendar.month>this.maxDate){this.rightCalendar.month=this.maxDate.clone().date(2);this.leftCalendar.month=this.maxDate.clone().date(2).subtract(1,'month')}},updateCalendars:function(){if(this.timePicker){var hour,minute,second;if(this.endDate){hour=parseInt(this.container.find('.left .hourselect').val(),10);minute=parseInt(this.container.find('.left .minuteselect').val(),10);if(isNaN(minute)){minute=parseInt(this.container.find('.left .minuteselect option:last').val(),10)} 392second=this.timePickerSeconds?parseInt(this.container.find('.left .secondselect').val(),10):0;if(!this.timePicker24Hour){var ampm=this.container.find('.left .ampmselect').val();if(ampm==='PM'&&hour<12) 393hour+=12;if(ampm==='AM'&&hour===12) 394hour=0}}else{hour=parseInt(this.container.find('.right .hourselect').val(),10);minute=parseInt(this.container.find('.right .minuteselect').val(),10);if(isNaN(minute)){minute=parseInt(this.container.find('.right .minuteselect option:last').val(),10)} 395second=this.timePickerSeconds?parseInt(this.container.find('.right .secondselect').val(),10):0;if(!this.timePicker24Hour){var ampm=this.container.find('.right .ampmselect').val();if(ampm==='PM'&&hour<12) 396hour+=12;if(ampm==='AM'&&hour===12) 397hour=0}} 398this.leftCalendar.month.hour(hour).minute(minute).second(second);this.rightCalendar.month.hour(hour).minute(minute).second(second)} 399this.renderCalendar('left');this.renderCalendar('right');this.container.find('.ranges li').removeClass('active');if(this.endDate==null)return;this.calculateChosenLabel()},renderCalendar:function(side){var calendar=side=='left'?this.leftCalendar:this.rightCalendar;var month=calendar.month.month();var year=calendar.month.year();var hour=calendar.month.hour();var minute=calendar.month.minute();var second=calendar.month.second();var daysInMonth=moment([year,month]).daysInMonth();var firstDay=moment([year,month,1]);var lastDay=moment([year,month,daysInMonth]);var lastMonth=moment(firstDay).subtract(1,'month').month();var lastYear=moment(firstDay).subtract(1,'month').year();var daysInLastMonth=moment([lastYear,lastMonth]).daysInMonth();var dayOfWeek=firstDay.day();var calendar=[];calendar.firstDay=firstDay;calendar.lastDay=lastDay;for(var i=0;i<6;i++){calendar[i]=[]} 400var startDay=daysInLastMonth-dayOfWeek+this.locale.firstDay+1;if(startDay>daysInLastMonth) 401startDay-=7;if(dayOfWeek==this.locale.firstDay) 402startDay=daysInLastMonth-6;var curDate=moment([lastYear,lastMonth,startDay,12,minute,second]);var col,row;for(var i=0,col=0,row=0;i<42;i++,col++,curDate=moment(curDate).add(24,'hour')){if(i>0&&col%7===0){col=0;row++} 403calendar[row][col]=curDate.clone().hour(hour).minute(minute).second(second);curDate.hour(12);if(this.minDate&&calendar[row][col].format('YYYY-MM-DD')==this.minDate.format('YYYY-MM-DD')&&calendar[row][col].isBefore(this.minDate)&&side=='left'){calendar[row][col]=this.minDate.clone()} 404if(this.maxDate&&calendar[row][col].format('YYYY-MM-DD')==this.maxDate.format('YYYY-MM-DD')&&calendar[row][col].isAfter(this.maxDate)&&side=='right'){calendar[row][col]=this.maxDate.clone()}} 405if(side=='left'){this.leftCalendar.calendar=calendar}else{this.rightCalendar.calendar=calendar} 406var minDate=side=='left'?this.minDate:this.startDate;var maxDate=this.maxDate;var selected=side=='left'?this.startDate:this.endDate;var arrow=this.locale.direction=='ltr'?{left:'chevron-left',right:'chevron-right'}:{left:'chevron-right',right:'chevron-left'};var html='<table class="table-condensed">';html+='<thead>';html+='<tr>';if(this.showWeekNumbers||this.showISOWeekNumbers) 407html+='<th></th>';if((!minDate||minDate.isBefore(calendar.firstDay))&&(!this.linkedCalendars||side=='left')){html+='<th class="prev available"><span></span></th>'}else{html+='<th></th>'} 408var dateHtml=this.locale.monthNames[calendar[1][1].month()]+calendar[1][1].format(" YYYY");if(this.showDropdowns){var currentMonth=calendar[1][1].month();var currentYear=calendar[1][1].year();var maxYear=(maxDate&&maxDate.year())||(this.maxYear);var minYear=(minDate&&minDate.year())||(this.minYear);var inMinYear=currentYear==minYear;var inMaxYear=currentYear==maxYear;var monthHtml='<select class="monthselect">';
408for(var m=0;m<12;m++){if((!inMinYear||(minDate&&m>=minDate.month()))&&(!inMaxYear||(maxDate&&m<=maxDate.month()))){monthHtml+="<option value='"+m+"'"+(m===currentMonth?" selected='selected'":"")+">"+this.locale.monthNames[m]+"</option>"}else{monthHtml+="<option value='"+m+"'"+(m===currentMonth?" selected='selected'":"")+" disabled='disabled'>"+this.locale.monthNames[m]+"</option>"}} 409monthHtml+="</select>";var yearHtml='<select class="yearselect">';for(var y=minYear;y<=maxYear;y++){yearHtml+='<option value="'+y+'"'+(y===currentYear?' selected="selected"':'')+'>'+y+'</option>'} 410yearHtml+='</select>';dateHtml=monthHtml+yearHtml} 411html+='<th colspan="5" class="month">'+dateHtml+'</th>';if((!maxDate||maxDate.isAfter(calendar.lastDay))&&(!this.linkedCalendars||side=='right'||this.singleDatePicker||this.singleMonth)){html+='<th class="next available"><span></span></th>'}else{html+='<th></th>'} 412html+='</tr>';html+='<tr>';if(this.showWeekNumbers||this.showISOWeekNumbers) 413html+='<th class="week">'+this.locale.weekLabel+'</th>';$.each(this.locale.daysOfWeek,function(index,dayOfWeek){html+='<th>'+dayOfWeek+'</th>'});html+='</tr>';html+='</thead>';html+='<tbody>';if(this.endDate==null&&this.maxSpan){var maxLimit=this.startDate.clone().add(this.maxSpan).endOf('day');if(!maxDate||maxLimit.isBefore(maxDate)){maxDate=maxLimit}} 414for(var row=0;row<6;row++){html+='<tr>';if(this.showWeekNumbers) 415html+='<td class="week">'+calendar[row][0].week()+'</td>';else if(this.showISOWeekNumbers) 416html+='<td class="week">'+calendar[row][0].isoWeek()+'</td>';for(var col=0;col<7;col++){var classes=[];if(calendar[row][col].isSame(new Date(),"day")) 417classes.push('today');if(calendar[row][col].isoWeekday()>5) 418classes.push('weekend');if(calendar[row][col].month()!=calendar[1][1].month()){classes.push('ends');if(this.popupMode){classes.push('off','disabled')}} 419if(this.minDate&&calendar[row][col].isBefore(this.minDate,'day')) 420classes.push('off','disabled');if(maxDate&&calendar[row][col].isAfter(maxDate,'day')) 421classes.push('off','disabled');if(this.isInvalidDate(calendar[row][col])) 422classes.push('off','disabled');if(this.startDate!=null&&calendar[row][col].format('YYYY-MM-DD')==this.startDate.format('YYYY-MM-DD')) 423classes.push('active','start-date');if(this.endDate!=null&&calendar[row][col].format('YYYY-MM-DD')==this.endDate.format('YYYY-MM-DD')) 424classes.push('active','end-date');
424if(this.endDate!=null&&this.startDate!=null&&calendar[row][col]>this.startDate&&calendar[row][col]<this.endDate) 425classes.push('in-range');var isCustom=this.isCustomDate(this,calendar[row][col]);var tooltip='';var tooltipElems=[];if(isCustom!==!1){if(typeof isCustom.classes==='string') 426classes.push(isCustom.classes);else Array.prototype.push.apply(classes,isCustom.classes);if(typeof isCustom.msg_restriction==='string'&&isCustom.msg_restriction){tooltipElems.push(isCustom.msg_restriction)} 427if(typeof isCustom.msg_stay==='string'&&isCustom.msg_stay){tooltipElems.push(isCustom.msg_stay)} 428if(tooltipElems.length>0){tooltip=' title="'+tooltipElems.join('<br>')+'" data-toggle="tooltip"'}} 429var cname='',disabled=!1;for(var i=0;i<classes.length;i++){cname+=classes[i]+' ';if(classes[i]=='disabled') 430disabled=!0} 431if(!disabled) 432cname+='available';html+='<td class="'+cname.replace(/^\s+|\s+$/g,'')+'" '+tooltip+' data-title="'+'r'+row+'c'+col+'"><div class="KB-daterangepicker3-circle">'+calendar[row][col].date()+'</div></td>'} 433html+='</tr>'} 434html+='</tbody>';html+='</table>';this.container.find('.drp-calendar.'+side+' .calendar-table').html(html);var dr_type=this.container.attr('data-type');if(typeof dr_type!='undefined'){dr_type+='-'} 435$(".tooltip").tooltip("hide");$('.KB-daterangepicker3 [data-toggle="tooltip"]').tooltip({template:'<div class="tooltip KB-daterangepicker3-'+dr_type+'tooltip" role="tooltip"><div class="arrow"></div><div class="tooltip-inner"></div></div>',html:!0})},renderTimePicker:function(side){if(side=='right'&&!this.endDate)return;var html,selected,minDate,maxDate=this.maxDate;if(this.maxSpan&&(!this.maxDate||this.startDate.clone().add(this.maxSpan).isBefore(this.maxDate))) 436maxDate=this.startDate.clone().add(this.maxSpan);if(side=='left'){selected=this.startDate.clone();minDate=this.minDate}else if(side=='right'){selected=this.endDate.clone();minDate=this.startDate;var timeSelector=this.container.find('.drp-calendar.right .calendar-time');if(timeSelector.html()!=''){selected.hour(!isNaN(selected.hour())?selected.hour():timeSelector.find('.hourselect option:selected').val());selected.minute(!isNaN(selected.minute())?selected.minute():timeSelector.find('.minuteselect option:selected').val());selected.second(!isNaN(selected.second())?selected.second():timeSelector.find('.secondselect option:selected').val());if(!this.timePicker24Hour){var ampm=timeSelector.find('.ampmselect option:selected').val();if(ampm==='PM'&&selected.hour()<12) 437selected.hour(selected.hour()+12);if(ampm==='AM'&&selected.hour()===12) 438selected.hour(0)}} 439if(selected.isBefore(this.startDate)) 440selected=this.startDate.clone();if(maxDate&&selected.isAfter(maxDate)) 441selected=maxDate.clone()} 442html='<select class="hourselect">';var start=this.timePicker24Hour?0:1;var end=this.timePicker24Hour?23:12;for(var i=start;i<=end;i++){var i_in_24=i;if(!this.timePicker24Hour) 443i_in_24=selected.hour()>=12?(i==12?12:i+12):(i==12?0:i);var time=selected.clone().hour(i_in_24);var disabled=!1;if(minDate&&time.minute(59).isBefore(minDate)) 444disabled=!0;if(maxDate&&time.minute(0).isAfter(maxDate)) 445disabled=!0;if(i_in_24==selected.hour()&&!disabled){html+='<option value="'+i+'" selected="selected">'+i+'</option>'}else if(disabled){html+='<option value="'+i+'" disabled="disabled" class="disabled">'+i+'</option>'}else{html+='<option value="'+i+'">'+i+'</option>'}} 446html+='</select> ';html+=': <select class="minuteselect">';for(var i=0;i<60;i+=this.timePickerIncrement){var padded=i<10?'0'+i:i;var time=selected.clone().minute(i);var disabled=!1;if(minDate&&time.second(59).isBefore(minDate)) 447disabled=!0;if(maxDate&&time.second(0).isAfter(maxDate)) 448disabled=!0;if(selected.minute()==i&&!disabled){html+='<option value="'+i+'" selected="selected">'+padded+'</option>'}else if(disabled){html+='<option value="'+i+'" disabled="disabled" class="disabled">'+padded+'</option>'}else{html+='<option value="'+i+'">'+padded+'</option>'}} 449html+='</select> ';if(this.timePickerSeconds){html+=': <select class="secondselect">';for(var i=0;i<60;i++){var padded=i<10?'0'+i:i;var time=selected.clone().second(i);var disabled=!1;if(minDate&&time.isBefore(minDate)) 450disabled=!0;if(maxDate&&time.isAfter(maxDate)) 451disabled=!0;if(selected.second()==i&&!disabled){html+='<option value="'+i+'" selected="selected">'+padded+'</option>'}else if(disabled){html+='<option value="'+i+'" disabled="disabled" class="disabled">'+padded+'</option>'}else{html+='<option value="'+i+'">
451'+padded+'</option>'}} 452html+='</select> '} 453if(!this.timePicker24Hour){html+='<select class="ampmselect">';var am_html='';var pm_html='';if(minDate&&selected.clone().hour(12).minute(0).second(0).isBefore(minDate)) 454am_html=' disabled="disabled" class="disabled"';if(maxDate&&selected.clone().hour(0).minute(0).second(0).isAfter(maxDate)) 455pm_html=' disabled="disabled" class="disabled"';if(selected.hour()>=12){html+='<option value="AM"'+am_html+'>AM</option><option value="PM" selected="selected"'+pm_html+'>PM</option>'}else{html+='<option value="AM" selected="selected"'+am_html+'>AM</option><option value="PM"'+pm_html+'>PM</option>'} 456html+='</select>'} 457this.container.find('.drp-calendar.'+side+' .calendar-time').html(html)},updateFormInputs:function(){if(this.singleDatePicker||(this.endDate&&(this.startDate.isBefore(this.endDate)||this.startDate.isSame(this.endDate)))){this.container.find('button.applyBtn').prop('disabled',!1)}else{this.container.find('button.applyBtn').prop('disabled',!0)}},move:function(){var parentOffset={top:0,left:0},containerTop,drops=this.drops;var parentRightEdge=$(window).width();if(!this.parentEl.is('body')){parentOffset={top:this.parentEl.offset().top-this.parentEl.scrollTop(),left:this.parentEl.offset().left-this.parentEl.scrollLeft()};parentRightEdge=this.parentEl[0].clientWidth+this.parentEl.offset().left} 458switch(drops){case 'auto':containerTop=this.element.offset().top+this.element.outerHeight()-parentOffset.top;if(containerTop+this.container.outerHeight()>=this.parentEl[0].scrollHeight){containerTop=this.element.offset().top-this.container.outerHeight()-parentOffset.top;drops='up'} 459break;case 'up':containerTop=this.element.offset().top-this.container.outerHeight()-parentOffset.top;break;default:containerTop=this.element.offset().top+this.element.outerHeight()-parentOffset.top;break} 460this.container.css({top:0,left:0,right:'auto'});var containerWidth=this.container.outerWidth();this.container.toggleClass('drop-up',drops=='up');if(this.opens=='left'){var containerRight=parentRightEdge-this.element.offset().left-this.element.outerWidth();if(containerWidth+containerRight>$(window).width()){this.container.css({top:containerTop,right:'auto',left:9})}else{this.container.css({top:containerTop,right:containerRight,left:'auto'})}}else if(this.opens=='center'){var containerLeft=this.element.offset().left-parentOffset.left+this.element.outerWidth()/2-containerWidth/2;if(containerLeft<0){this.container.css({top:containerTop,right:'auto',left:9})}else if(containerLeft+containerWidth>$(window).width()){this.container.css({top:containerTop,left:'auto',right:0})}else{this.container.css({top:containerTop,left:containerLeft,right:'auto'})}}else{var containerLeft=this.element.offset().left-parentOffset.left;if(containerLeft+containerWidth>$(window).width()){this.container.css({top:containerTop,left:'auto',right:0})}else{this.container.css({top:containerTop,left:containerLeft,right:'auto'})}}},show:function(e){if(this.isShowing)return;this._outsideClickProxy=$.proxy(function(e){this.outsideClick(e)},this);$(document).on('mousedown.daterangepicker',this._outsideClickProxy).on('touchend.daterangepicker',this._outsideClickProxy).on('click.daterangepicker','[data-toggle=dropdown]',this._outsideClickProxy).on('focusin.daterangepicker',this._outsideClickProxy);$(window).on('resize.daterangepicker',$.proxy(function(e){this.move(e)},this));this.oldStartDate=null;if(this.startDate!=null){this.oldStartDate=this.startDate.clone()} 461this.oldEndDate=null;this.previousRightTime=null;if(this.startDate!=null){this.oldEndDate=this.endDate.clone();this.previousRightTime=this.endDate.clone()} 462this.updateView();this.container.show();this.move();this.element.trigger('show.daterangepicker',this);this.isShowing=!0},hide:function(e){if(!this.isShowing)return;if(!this.endDate){this.startDate=this.oldStartDate?this.oldStartDate.clone():undefined;this.endDate=this.oldEndDate?this.oldEndDate.clone():undefined} 463if(this.startDate){if(!this.startDate.isSame(this.oldStartDate)||!this.endDate.isSame(this.oldEndDate)) 464this.callback(this.startDate.clone(),this.endDate.clone(),this.chosenLabel)} 465this.oldStartDate=this.startDate?.clone();this.oldEndDate=this.endDate?.clone();this.updateElement();if(this.popupMode){$(document).off('.daterangepicker');$(window).off('.daterangepicker');this.container.hide();this.element.trigger('hide.daterangepicker',this);this.isShowing=!1} 466$(".tooltip").tooltip("hide")},toggle:function(e){if(this.isShowing){this.hide()}else{this.show()}},outsideClick:function(e){var target=$(e.target);if(e.type=="focusin"||target.closest(this.element).length||target.closest(this.container).length||target.closest('.calendar-table').length)return;this.hide();this.element.trigger('outsideClick.daterangepicker',this)},showCalendars:function(){this.container.addClass('show-calendar');this.move();this.element.trigger('showCalendar.daterangepicker',this)},hideCalendars:function(){this.container.removeClass('show-calendar');this.element.trigger('hideCalendar.daterangepicker',this)},clickRange:function(e){var label=e.target.getAttribute('data-range-key');this.chosenLabel=label;if(label==this.locale.customRangeLabel){this.showCalendars()}else{var dates=this.ranges[label];this.startDate=dates[0];this.endDate=dates[1];if(!this.timePicker){this.startDate.startOf('day');this.endDate.endOf('day')} 467if(!this.alwaysShowCalendars) 468this.hideCalendars();this.clickApply()}},clickPrev:function(e){var cal=$(e.target).parents('.drp-calendar');
468if(cal.hasClass('left')){this.leftCalendar.month.subtract(1,'month');if(this.linkedCalendars) 469this.rightCalendar.month.subtract(1,'month')}else{this.rightCalendar.month.subtract(1,'month')} 470this.updateCalendars()},clickNext:function(e){var cal=$(e.target).parents('.drp-calendar');if(cal.hasClass('left')){this.leftCalendar.month.add(1,'month')}else{this.rightCalendar.month.add(1,'month');if(this.linkedCalendars) 471this.leftCalendar.month.add(1,'month')} 472this.updateCalendars()},hoverDate:function(e){if($(e.target).is('div')) 473e.target=$(e.target).parent();if(!$(e.target).hasClass('available'))return;var title=$(e.target).attr('data-title');var row=title.substr(1,1);var col=title.substr(3,1);var cal=$(e.target).parents('.drp-calendar');var date=cal.hasClass('left')?this.leftCalendar.calendar[row][col]:this.rightCalendar.calendar[row][col];var leftCalendar=this.leftCalendar;var rightCalendar=this.rightCalendar;var startDate=this.startDate;if(this.startDate&&!this.endDate){this.container.find('.drp-calendar tbody td').each(function(index,el){if($(el).hasClass('week'))return;var title=$(el).attr('data-title');var row=title.substr(1,1);var col=title.substr(3,1);var cal=$(el).parents('.drp-calendar');var dt=cal.hasClass('left')?leftCalendar.calendar[row][col]:rightCalendar.calendar[row][col];if((dt.isAfter(startDate)&&dt.isBefore(date))||dt.isSame(date,'day')){$(el).addClass('in-range')}else{$(el).removeClass('in-range')}})}},clickDate:function(e){if($(e.target).is('div')) 474e.target=$(e.target).parent();if(!$(e.target).hasClass('available'))return;var title=$(e.target).attr('data-title');var row=title.substr(1,1);var col=title.substr(3,1);var cal=$(e.target).parents('.drp-calendar');var date=cal.hasClass('left')?this.leftCalendar.calendar[row][col]:this.rightCalendar.calendar[row][col];if(this.startDate&&date.isSame(this.startDate,'day')&&!this.endDate&&!nonric_calendar_1day){this.startDate=this.oldStartDate;this.endDate=this.oldEndDate;this.updateView()}else if(this.startDate==null||this.endDate||date.isBefore(this.startDate,'day')){if(this.timePicker){var hour=parseInt(this.container.find('.left .hourselect').val(),10);if(!this.timePicker24Hour){var ampm=this.container.find('.left .ampmselect').val();if(ampm==='PM'&&hour<12) 475hour+=12;if(ampm==='AM'&&hour===12) 476hour=0} 477var minute=parseInt(this.container.find('.left .minuteselect').val(),10);if(isNaN(minute)){minute=parseInt(this.container.find('.left .minuteselect option:last').val(),10)} 478var second=this.timePickerSeconds?parseInt(this.container.find('.left .secondselect').val(),10):0;date=date.clone().hour(hour).minute(minute).second(second)} 479this.endDate=null;this.setStartDate(date.clone())}else if(!this.endDate&&date.isBefore(this.startDate)){this.setEndDate(this.startDate.clone())}else{if(this.timePicker){var hour=parseInt(this.container.find('.right .hourselect').val(),10);if(!this.timePicker24Hour){var ampm=this.container.find('.right .ampmselect').val();if(ampm==='PM'&&hour<12) 480hour+=12;if(ampm==='AM'&&hour===12) 481hour=0} 482var minute=parseInt(this.container.find('.right .minuteselect').val(),10);if(isNaN(minute)){minute=parseInt(this.container.find('.right .minuteselect option:last').val(),10)} 483var second=this.timePickerSeconds?parseInt(this.container.find('.right .secondselect').val(),10):0;date=date.clone().hour(hour).minute(minute).second(second)} 484this.setEndDate(date.clone());if(this.autoApply){this.calculateChosenLabel();this.clickApply()}} 485if(this.singleDatePicker){this.setEndDate(this.startDate);if(!this.timePicker&&this.autoApply) 486this.clickApply()} 487this.updateView();e.stopPropagation()},calculateChosenLabel:function(){var customRange=!0;var i=0;for(var range in this.ranges){if(this.timePicker){var format=this.timePickerSeconds?"YYYY-MM-DD HH:mm:ss":"YYYY-MM-DD HH:mm";if(this.startDate.format(format)==this.ranges[range][0].format(format)&&this.endDate.format(format)==this.ranges[range][1].format(format)){customRange=!1;this.chosenLabel=this.container.find('.ranges li:eq('+i+')').addClass('active').attr('data-range-key');break}}else{if(this.startDate.format('YYYY-MM-DD')==this.ranges[range][0].format('YYYY-MM-DD')&&this.endDate.format('YYYY-MM-DD')==this.ranges[range][1].format('YYYY-MM-DD')){customRange=!1;this.chosenLabel=this.container.find('.ranges li:eq('+i+')').addClass('active').attr('data-range-key');break}} 488i++} 489if(customRange){if(this.showCustomRangeLabel){this.chosenLabel=this.container.find('.ranges li:last').addClass('active').attr('data-range-key')}else{this.chosenLabel=null} 490this.showCalendars()}},clickApply:function(e){this.hide();this.element.trigger('apply.daterangepicker',this)},clickCancel:function(e){this.startDate=this.oldStartDate;this.endDate=this.oldEndDate;this.hide();this.element.trigger('cancel.daterangepicker',this)},monthOrYearChanged:function(e){var isLeft=$(e.target).closest('.drp-calendar').hasClass('left'),leftOrRight=isLeft?'left':'right',cal=this.container.find('.drp-calendar.'+leftOrRight);var month=parseInt(cal.find('.monthselect').val(),10);var year=cal.find('.yearselect').val();if(!isLeft){if(year<this.startDate.year()||(year==this.startDate.year()&&month<this.startDate.month())){month=this.startDate.month();year=this.startDate.year()}} 491if(this.minDate){if(year<this.minDate.year()||(year==this.minDate.year()&&month<this.minDate.month())){month=this.minDate.month();year=this.minDate.year()}} 492if(this.maxDate){if(year>this.maxDate.year()||(year==this.maxDate.year()&&month>this.maxDate.month())){month=this.maxDate.month();year=this.maxDate.year()}} 493if(isLeft){this.leftCalendar.month.month(month).year(year);if(this.linkedCalendars) 494this.rightCalendar.month=this.leftCalendar.month.clone().add(1,'month')}else{this.rightCalendar.month.month(month).year(year);if(this.linkedCalendars) 495this.leftCalendar.month=this.rightCalendar.month.clone().subtract(1,'month')} 496this.updateCalendars()},timeChanged:function(e){var cal=$(e.target).closest('.drp-calendar'),isLeft=cal.hasClass('left');var hour=parseInt(cal.find('.hourselect').val(),10);var minute=parseInt(cal.find('.minuteselect').val(),10);if(isNaN(minute)){minute=parseInt(cal.find('.minuteselect option:last').val(),10)} 497var second=this.timePickerSeconds?parseInt(cal.find('.secondselect').val(),10):0;
497if(!this.timePicker24Hour){var ampm=cal.find('.ampmselect').val();if(ampm==='PM'&&hour<12) 498hour+=12;if(ampm==='AM'&&hour===12) 499hour=0} 500if(isLeft){var start=this.startDate.clone();start.hour(hour);start.minute(minute);start.second(second);this.setStartDate(start);if(this.startDate&&this.singleDatePicker){this.endDate=this.startDate.clone()}else if(this.endDate&&this.endDate.format('YYYY-MM-DD')==start.format('YYYY-MM-DD')&&this.endDate.isBefore(start)){this.setEndDate(start.clone())}}else if(this.endDate){var end=this.endDate.clone();end.hour(hour);end.minute(minute);end.second(second);this.setEndDate(end)} 501this.updateCalendars();this.updateFormInputs();this.renderTimePicker('left');this.renderTimePicker('right')},elementChanged:function(){if(!this.element.is('input'))return;if(!this.element.val().length)return;var dateString=this.element.val().split(this.locale.separator),start=null,end=null;if(dateString.length===2){start=moment(dateString[0],this.locale.format);end=moment(dateString[1],this.locale.format)} 502if(this.singleDatePicker||start===null||end===null){start=moment(this.element.val(),this.locale.format);end=start} 503if(!start.isValid()||!end.isValid())return;this.setStartDate(start);this.setEndDate(end);this.updateView()},keydown:function(e){if((e.keyCode===9)||(e.keyCode===13)){this.hide()} 504if(e.keyCode===27){e.preventDefault();e.stopPropagation();this.hide()}},updateElement:function(){if(this.element.is('input')&&this.autoUpdateInput){var newValue=this.startDate.format(this.locale.format);if(!this.singleDatePicker){newValue+=this.locale.separator+this.endDate.format(this.locale.format)} 505if(newValue!==this.element.val()){this.element.val(newValue).trigger('change')}}},remove:function(){this.container.remove();this.element.off('.daterangepicker');this.element.removeData()}};$.fn.daterangepicker=function(options,callback){var implementOptions=$.extend(!0,{},$.fn.daterangepicker.defaultOptions,options);this.each(function(){var el=$(this);if(el.data('daterangepicker')) 506el.data('daterangepicker').remove();el.data('daterangepicker',new DateRangePicker(el,implementOptions,callback))});return this};return DateRangePicker})(jQuery,moment)});var kb_dr3_template_singolo=` 507<div class="KB-daterangepicker3 KB-daterangepicker3-singolo daterangepicker" data-type="singolo"> 508 <div class="drp-calendar left"> 509 <div class="calendar-table"></div> 510 <div class="calendar-time"></div> 511 </div> 512</div>`;var kb_dr3_template_doppio_light=`
513<div class="KB-daterangepicker3 KB-daterangepicker3-doppio-light daterangepicker" data-type="doppio-light"> 514 <div class="drp-calendar left"> 515 <div class="calendar-table"></div> 516 <div class="calendar-time"></div> 517 </div> 518 <div class="drp-calendar right"> 519 <div class="calendar-table"></div> 520 <div class="calendar-time"></div> 521 </div> 522</div>`;var kb_dr3_template_doppio=` 523<div class="KB-daterangepicker3 KB-daterangepicker3-doppio daterangepicker" data-type="doppio"> 524 <div class="drp-calendar left"> 525 <div class="calendar-table"></div> 526 <div class="calendar-time"></div> 527 </div> 528 <div class="drp-calendar right"> 529 <div class="calendar-table"></div> 530 <div class="calendar-time"></div> 531 </div> 532</div>`;jQuery(document).ready(function(){(function($,moment,kross_config){moment.locale(kross_lang);jQuery('.kross-calendar').each(function(){console.log('kross-calendar init new');var start=kross_from?moment(kross_from):undefined;var end=kross_to?moment(kross_to):undefined;var options={parentEl:$(this),autoApply:!0,popupMode:!1,template:kb_dr3_template_singolo,startDate:start,endDate:end,opens:(kross_lang=='he'?'left':'right'),isCustomDate:dr3_customDate,minDate:moment(),singleMonth:!0};var obj=jQuery(this);obj.daterangepicker(options,function(start,end,label){kross_cal_cb3(obj,start,end)});kross_cal_cb3(obj,start,end)});jQuery('.kross-calendar-single').each(function(){console.log('kross-calendar-single init new');var start=kross_from?moment(kross_from):undefined;var end=kross_to?moment(kross_to):undefined;var options={parentEl:$(this),autoApply:!0,popupMode:!1,template:kb_dr3_template_singolo,startDate:start,endDate:end,singleDatePicker:!0,opens:(kross_lang=='he'?'left':'right'),isCustomDate:dr3_customDate,minDate:moment(),singleMonth:!0};var obj=jQuery(this);obj.daterangepicker(options,function(start,end,label){kross_cal_cb3(obj,start,end)});kross_cal_cb3(obj,start,end)});jQuery('.kross-calendar-top-full').each(function(){console.log('kross-calendar-top-full init new');var start=kross_from?moment(kross_from):undefined;var end=kross_to?moment(kross_to):undefined;var options={parentEl:$(this),autoApply:!0,popupMode:!1,template:kb_dr3_template_doppio_light,startDate:start,endDate:end,opens:(kross_lang=='he'?'left':'right'),isCustomDate:dr3_customDate,minDate:moment(),singleMonth:$(window).width()<1200};var obj=jQuery(this);obj.daterangepicker(options,function(start,end,label){cb3_long(obj,start,end)})});jQuery('.kross-calendar-popup').each(function(){console.log('kross-calendar-popup init new');var start=$('#kross_from').val()?moment($('#kross_from').val()):moment();var end=$('#kross_to').val()?moment($('#kross_to').val()):moment().add($('#kross_min_stay_def').val(),'days');var startLabel=$('#kross_from').val()?moment($('#kross_from').val()):'';var endLabel=$('#kross_to').val()?moment($('#kross_to').val()):'';var options={autoApply:!0,template:kb_dr3_template_doppio,startDate:start,endDate:end,opens:(kross_lang=='he'?'left':'right'),isCustomDate:dr3_customDate,minDate:moment(),singleMonth:$(window).width()<1200};var obj=jQuery(this);obj.daterangepicker(options,function(start,end,label){cb3_long(obj,start,end)});cb3_long(obj,startLabel,endLabel)});jQuery('.kross-calendar-double').each(function(){console.log('kross-calendar-double init new');var start=$('#kross_from').val()?moment($('#kross_from').val()):undefined;var end=$('#kross_to').val()?moment($('#kross_to').val()):undefined;var startLabel=$('#kross_from').val()?moment($('#kross_from').val()):'';var endLabel=$('#kross_to').val()?moment($('#kross_to').val()):'';var options={autoApply:!0,template:kb_dr3_template_doppio,startDate:start,endDate:end,opens:(kross_lang=='he'?'right':'left'),isCustomDate:dr3_customDate,minDate:moment(),singleMonth:$(window).width()<1200};var obj=jQuery(this);obj.daterangepicker(options,function(start,end,label){cb3_auto(obj,start,end)});cb3_auto(obj,startLabel,endLabel)});$('#roomsDetailsAva .kross-calendar-double').on('apply.daterangepicker',function(){$('.loading').show();$('#roomsDetailsAva').submit()})})(jQuery,moment)});function loadEnquiryCalendar(){console.log('kross-calendar-popup MODAL init new');var start=$('#kross_from').val()?moment($('#kross_from').val()):moment();var end=$('#kross_to').val()?moment($('#kross_to').val()):moment().add($('#kross_min_stay_def').val(),'days');
532var startLabel=$('#kross_from').val()?moment($('#kross_from').val()):'';var endLabel=$('#kross_to').val()?moment($('#kross_to').val()):'';var options={autoApply:!0,template:kb_dr3_template_doppio,startDate:start,endDate:end,opens:(kross_lang=='he'?'left':'right'),isCustomDate:dr3_customDate,minDate:moment(),singleMonth:$(window).width()<1200};var obj=$('#formEnquiry .kross-calendar-popup');obj.daterangepicker(options,function(start,end,label){cb3_long(obj,start,end)});cb3_long(obj,startLabel,endLabel)} 533if(!1){var dr3_ava_debug='444444000000444445554444446666664444447777774444444444444444444444444444444444470000000000000000000000000000000';var dr3_stay_debug=[];for(i=0;i<=110;i++){if(i<80){dr3_stay_debug.push(["3","1","999","999"])}else{dr3_stay_debug.push(["2","1","999","999"])}}} 534function dr3_minMax(day){if(typeof dr3_stay=='undefined'||day>=dr3_stay.length){return!1} 535var stay=dr3_stay[day];return{min:parseInt(stay[0]),min_arr:parseInt(stay[1]),max:parseInt(stay[2]),max_arr:parseInt(stay[3])}} 536const NOTAV_NORES='0';const NOTAV_CA='1';const NOTAV_CD='2';const NOTAV_CA_CD='3';const AVAIL_NORES='4';const AVAIL_CA='5';const AVAIL_CD='6';const AVAIL_CA_CD='7';function dr3_is_closed_arr(day){return[NOTAV_NORES,NOTAV_CA,NOTAV_CD,NOTAV_CA_CD,AVAIL_CA,AVAIL_CA_CD].indexOf(dr3_ava.charAt(day))>-1} 537function dr3_is_closed_dep_preno(day){return day==0||dr3_is_not_available(day-1)} 538function dr3_is_closed_dep_restr(day){return[NOTAV_CD,NOTAV_CA_CD,AVAIL_CD,AVAIL_CA_CD].indexOf(dr3_ava.charAt(day))>-1} 539function dr3_is_closed_dep(day){return dr3_is_closed_dep_preno(day)||dr3_is_closed_dep_restr(day)} 540function dr3_is_available(day){return dr3_ava.charAt(day)>=AVAIL_NORES} 541function dr3_is_not_available(day){return dr3_ava.charAt(day)<AVAIL_NORES} 542function dr3_minMaxEffettivo(day,los){var minMaxStayArr=dr3_minMax(day);var minStayEffettivo=1;var maxStayEffettivo=999;if(minMaxStayArr&&!dr3_is_closed_arr(day)){var minStayArr=Math.max(minMaxStayArr.min_arr,minMaxStayArr.min);var maxStayArr=Math.min(minMaxStayArr.max_arr,minMaxStayArr.max);minStayEffettivo=minStayArr;maxStayEffettivo=maxStayArr;for(var i=1;i<=minStayEffettivo||(typeof los!='undefined'&&i<=los);i++){var date_i=day+i;var minMaxStay=dr3_minMax(date_i);var minStay=minMaxStay.min;var maxStay=minMaxStay.max;if(i<minStayEffettivo){if(maxStay<maxStayEffettivo){maxStayEffettivo=maxStay} 543if(minStay>minStayEffettivo){minStayEffettivo=minStay}} 544var closedByPreno=dr3_is_closed_dep_preno(date_i);var closedByRestr=dr3_is_closed_dep_restr(date_i);if(closedByPreno||i>maxStayEffettivo){return{valid:!1,min:minStayEffettivo,max:maxStayEffettivo,}} 545if(closedByRestr&&i==minStayEffettivo){minStayEffettivo++;if(maxStay<maxStayEffettivo){maxStayEffettivo=maxStay} 546if(minStay>minStayEffettivo){minStayEffettivo=minStay}}}} 547return{valid:!0,min:minStayEffettivo,max:maxStayEffettivo,}} 548function dr3_customDate(dr,date){if(typeof dr3_ava=='undefined'){return!1} 549if(typeof dr3_ava_debug!='undefined'){dr3_ava=dr3_ava_debug;dr3_stay=dr3_stay_debug;dr3_ava_debug=undefined} 550var today=moment().startOf('day');var days=date.diff(today,'days') 551if(days<0||date.isBefore(today)){return!1} 552var classes=[];var msg_restriction='';var msg_stay='';var day_flag=dr3_ava.charAt(days);if(dr.startDate==null||dr.endDate!=null){var minMaxEffettivo=dr3_minMaxEffettivo(days);if(minMaxEffettivo.valid===!1){if(day_flag==AVAIL_NORES){day_flag=AVAIL_CA} 553if(day_flag==AVAIL_CD){day_flag=AVAIL_CA_CD}}else if(minMaxEffettivo.min>1){msg_stay=t('js_kbcal_min_stay').replace('@',minMaxEffettivo.min)} 554var prevcheckin=!0;if(days>0&&(dr3_is_closed_arr(days)||day_flag==AVAIL_CA||day_flag==AVAIL_CA_CD)){for(ck=days-1;ck>=0;ck--){if(!dr3_is_closed_arr(ck)&&dr3_minMaxEffettivo(ck).valid!==!1){break} 555if(dr3_is_closed_arr(ck)&&!dr3_is_available(ck)){classes.push('off','disabled','kb-cal-a1');msg_stay='';prevcheckin=!1;break}}} 556if(prevcheckin){switch(day_flag){case NOTAV_NORES:case NOTAV_CA:if(!dr3_is_closed_dep(days)){classes.push('ca','disabled','kb-disabled','kb-cal-a10a');msg_restriction=t('js_kbcal_ca')}else{classes.push('off','disabled','kb-cal-a10b');msg_stay=''} 557break;
557case NOTAV_CD:case NOTAV_CA_CD:classes.push('off','disabled','kb-cal-a11');msg_stay='';break;case AVAIL_CA_CD:classes.push('ca cd','disabled','kb-disabled','kb-cal-a12');msg_restriction=t('js_kbcal_ca_cd');break;case AVAIL_CA:classes.push('ca','disabled','kb-disabled','kb-cal-a13');msg_restriction=t('js_kbcal_ca');break;case AVAIL_CD:classes.push('cd','kb-cal-a14');break;case AVAIL_NORES:break;default:classes.push('off','disabled','kb-cal-a10b');msg_stay='';break}}}else{var cursorStart=dr.startDate.diff(today,'days');var los=days-cursorStart;var firstNA=-1;for(var cursor=cursorStart;cursor<dr3_ava.length;cursor++){if(dr3_is_not_available(cursor)){firstNA=cursor;break}};if(los>0){var minMaxEffettivo=dr3_minMaxEffettivo(cursorStart,los);var min_dep=cursorStart+minMaxEffettivo.min;var max_dep=cursorStart+minMaxEffettivo.max} 558if(date.isSame(dr.startDate)){msg_restriction=t('js_kbcal_arrival')}else if(date.isBefore(dr.startDate)){classes.push('off','disabled','kb-cal-d1');msg_stay=''}else if(dr3_is_closed_dep_preno(days)){classes.push('off','disabled','kb-cal-d2');msg_stay=''}else if(days>firstNA&&firstNA>-1){classes.push('off','disabled','kb-cal-d3');msg_stay=''}else if(days<min_dep){classes.push('off','disabled','kb-disabled','kb-cal-d6');msg_stay=t('js_kbcal_min_stay').replace('@',minMaxEffettivo.min)}else if(days>max_dep){classes.push('off','disabled','kb-disabled','kb-cal-d7');msg_stay=t('js_kbcal_max_stay').replace('@',minMaxEffettivo.max)}else{switch(day_flag){case NOTAV_NORES:case NOTAV_CA:classes.push('kb-cal-d10');break;case NOTAV_CD:case NOTAV_CA_CD:classes.push('cd','disabled','kb-disabled','kb-cal-d11');msg_restriction=t('js_kbcal_out_cd');break;case AVAIL_CA_CD:classes.push('ca cd','disabled','kb-disabled','kb-cal-d12');msg_restriction=t('js_kbcal_out_cd');break;case AVAIL_CA:classes.push('ca','kb-cal-d13');break;case AVAIL_CD:classes.push('cd','disabled','kb-disabled','kb-cal-d14');msg_restriction=t('js_kbcal_out_cd');break;case AVAIL_NORES:default:break} 559msg_stay=''}} 560return{classes:classes,msg_restriction:msg_restriction,msg_stay:msg_stay}};if(guests===undefined||typeof(guests)==='undefined')guests=0;function guestsNumber(operation){} 561function adultsChildrenNumber(){} 562function guestsNumberReset(){} 563function guestsNumbersRefresh(){};$(function(){$.validator.addMethod('emailNoOta',function(value,element,param){var validEmail=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value);var otaEmail=/(@guest.booking.com|@guest.airbnb.com|expediapartnercentral.com)$/.test(value) 564var acceptedEmail=validEmail&&!otaEmail;return this.optional(element)||acceptedEmail})});var kb_min=1;var kb_max=20;function kbGuestsCountBE(id,inc,min,max,room,drops='down'){var g;if(room==undefined){g=parseInt(jQuery('input#'+id).val())}else{g=parseInt(jQuery('input#'+id+'_'+room).val())} 565g=g+inc;if(g<min) 566g=min;if(g>max) 567g=max;if(room==undefined){jQuery('input#'+id).val(g);jQuery('div.'+id+'_m').html(g)}else{jQuery('input#'+id+'_'+room).val(g);jQuery('div.'+id+'_'+room+'_m').html(g)} 568if(id=='kb_rooms'){jQuery('.kb-room').hide();for(var r=0;r<g;r++){jQuery('#kb-room-'+r).show()}} 569if(id=='kb_children'){if(g>0){jQuery('#kb_children_cont_'+room).show()}else{jQuery('#kb_children_cont_'+room).hide()} 570jQuery('#kb-room-'+room+' .kb-child-ages select').attr('disabled','disabled').hide();for(var c=0;c<g;c++){jQuery('#kb_children_'+c+'_'+room+'_m').removeAttr('disabled').show()}} 571jQuery('.gotoNextStepButton .btn').addClass('disabled').attr('disabled','disabled');if(typeof panelAvailability!='undefined'){panelAvailability()} 572kbGuestsRoomsBE();return!1} 573$(function(){$('#guestsDiv').on('change paste keyup',function(){console.log('change');console.log($('#guestsDiv').val())})}) 574function kbGuestsApplyBE(guests_rooms){var total_guests=0;var rooms=guests_rooms.replace(/;$/,'').split(';');$('#kb_rooms').val(rooms.length);$('.kb_rooms_m').html(rooms.length);for(r in rooms){$('#kb-room-'+r).show();var elems=rooms[r].split(',');adults=parseInt(elems[0]);children=parseInt(elems[1]);childrenAge=elems.slice(2);if(adults>0){$('#kb_adults_'+r).val(adults);$('.kb_adults_'+r+'_m').html(adults)}else{$('#kb_adults_'+r).val(2);$('.kb_adults_'+r+'_m').html('2')} 575if(children>0){$('#kb_children_'+r).val(children);$('.kb_children_'+r+'_m').html(children)}else{$('#kb_children_'+r).val(0);$('.kb_children_'+r+'_m').html('0')} 576if(childrenAge.length>0){$('#kb_children_cont_'+r).show();for(k in childrenAge){$('#kb_children_'+k+'_'+r).val(childrenAge[k]);$('#kb_children_'+k+'_'+r+'_m').val(childrenAge[k]);$('#kb_children_'+k+'_'+r+'_m').removeAttr('disabled').show()}} 577total_guests+=adults+children} 578jQuery('#kb_guests_rooms').val(guests_rooms);jQuery('#kb_guests').val(total_guests);jQuery('#guestsDiv').val(total_guests+' '+(total_guests==1?t('js_be_ospite'):t('js_be_ospiti')));jQuery('#guestsDiv .qtguests').html(`<span itemprop="numAdults">${total_guests}</span>`+' '+(total_guests==1?t('js_be_ospite'):t('js_be_ospiti')))} 579function kbGuestsChildrenBE(children,room){jQuery('#kb_children_'+children+'_'+room).val(jQuery('#kb_children_'+children+'_'+room+'_m').val());kbGuestsRoomsBE()} 580function kbGuestsRoomsBE(){var rooms=jQuery('#kb_rooms').val();var guests_rooms='';var total_guests=0;var adults,children,agesArr,ages;for(var i=0;i<rooms;
580i++){adults=parseInt(jQuery('#kb_adults_'+i).val());children=parseInt(jQuery('#kb_children_'+i).val());agesArr=[];for(var c=0;c<children;c++){agesArr.push(jQuery('#kb_children_'+c+'_'+i).val())} 581ages=agesArr.join(',');guests_rooms+=adults+','+children;if(ages.length>0){guests_rooms+=','+ages} 582guests_rooms+=';';total_guests+=adults+children} 583jQuery('#kb_guests_rooms').val(guests_rooms);jQuery('#kb_guests').val(total_guests);jQuery('#guestsDiv').val(total_guests+' '+(total_guests==1?t('js_be_ospite'):t('js_be_ospiti')));jQuery('#guestsDiv .qtguests').html(`<span itemprop="numAdults">${total_guests}</span>`+' '+(total_guests==1?t('js_be_ospite'):t('js_be_ospiti')))} 584function validGuestsRooms(guests_rooms_str){return guests_rooms_str.match(/^(?:([0-9]+),([0-9]+)([,0-9]*);)+$/)} 585function guestsRoomsDivContent(applicaBtn){if(typeof applicaBtn=='undefined'){applicaBtn=!1} 586var message='';if(withRoomsNumber){message+=` 587 <div class="guestsActionCalcContainer adultsCalcContainer d-flex justify-content-between pt-4 pb-4"> 588 <div class="font-weight-bold mr-3">`+camere_label+`</div> 589 <div class="d-flex align-items-center"> 590 <div class="guestsActionCalc sub" onclick="kbGuestsCountBE(\'kb_rooms\',-1,1,10,undefined);"> 591 <i class="guestsActionCalcButton fal fa-minus-circle fa-fw fa-lg"></i> 592 </div> 593 <div class="px-2 font-weight-bold kb_rooms_m">`+$('#kb_rooms').val()+`</div> 594 <div class="add" onclick="kbGuestsCountBE(\'kb_rooms\',1,1,10,undefined);"> 595 <i class="guestsActionCalcButton fal fa-plus-circle fa-fw fa-lg"></i> 596 </div> 597 </div> 598 </div>`} 599for(var r=0;r<max_rooms;r++){message+='<div id="kb-room-'+r+'" class="kb-room" '+(r>=parseInt($('#kb_rooms').val())?'style="display:none"':'')+'>';if(max_rooms>1){message+='<hr>';message+='<div class="room-title">'+camera_label+' '+(r+1)+'</div>'} 600message+=` 601 <div class="guestsActionCalcContainer d-flex align-items-center justify-content-between pt-4 pb-4"> 602 <div class="font-weight-bold mr-3">`+(withChildren?t('Adulti'):t('Ospiti'))+`</div> 603 <div class="d-flex align-items-center"> 604 <div class="guestsActionCalc sub" onclick="kbGuestsCountBE(\'kb_adults\',-1,1,`+max_adults+`,`+r+`);"> 605 <i class="guestsActionCalcButton fal fa-minus-circle fa-fw fa-lg"></i> 606 </div> 607 <div class="px-2 font-weight-bold kb_adults_`+r+`_m">`+$('#kb_adults_'+r).val()+`</div> 608 <div class="add" onclick="kbGuestsCountBE(\'kb_adults\',1,1,`+max_adults+`,`+r+`);"> 609 <i class="guestsActionCalcButton fal fa-plus-circle fa-fw fa-lg"></i> 610 </div> 611 </div> 612 </div>`;if(withChildren){message+=` 613 <div class="guestsActionCalcContainer childrenCalcContainer d-flex justify-content-between pt-0 pb-4"> 614 <div class="font-weight-bold mr-3">`+t('Bambini')+`</div> 615 <div class="d-flex align-items-center"> 616 <div class="guestsActionCalc sub" onclick="kbGuestsCountBE(\'kb_children\',-1,0,`+max_children+`,`+r+`);"> 617 <i class="guestsActionCalcButton fal fa-minus-circle fa-fw fa-lg"></i> 618 </div> 619 <div class="px-2 font-weight-bold kb_children_`+r+`_m">`+$('#kb_children_'+r).val()+`</div> 620 <div class="add" onclick="kbGuestsCountBE(\'kb_children\',1,0,`+max_children+`,`+r+`);"> 621 <i class="guestsActionCalcButton fal fa-plus-circle fa-fw fa-lg"></i> 622 </div> 623 </div> 624 </div> 625 <div class="pt-0 pb-4 childrenAgeSelectionContainer d-none"> 626 <ul class="list-unstyled childrenAges mb-0"> 627 </ul> 628 </div>`;message+='<div style="clear:both"></div>';message+='<div class="kb-child-age pb-4" id="kb_children_cont_'+r+'" '+(parseInt($('#kb_children_'+r).val())==0?'style="display:none':'')+'">'+'<label>'+t('Eta bambini')+'</label><div class="kb-child-ages">';for(var k=0;k<max_children;k++){message+='<select class="mb-1 mr-1" onchange="kbGuestsChildrenBE('+k+','+r+')" id="kb_children_'+k+'_'+r+'_m" '+(k>=parseInt($('#kb_children_'+r).val())?'style="display:none" disabled':'')+'>';for(var i=min_age;i<=max_age;i++){message+='<option value="'+i+'" '+($('#kb_children_'+k+'_'+r).val()==i?'selected':'')+' > '+i+' '+t('anni')+'</option>'} 629message+='</select>'} 630message+='</div>';message+='</div>';message+='</div>'}} 631if(applicaBtn){message+=` 632 <div class="d-flex justify-content-end pb-4"> 633 <button type="button" class="btn btn-primary btn-block applyGuestsBtn" style="border-radius:10rem" id="bt
633nApplyGuests"> 634 ${t('Applica')} 635 </button> 636 </div> 637 `} 638return message} 639$(function(){if((guests===undefined)||(parseInt(guests)<1)){$('#guestsDiv').val('')} 640if(!withRoomsNumber){max_rooms=1} 641var messageInputs='';if(beLayout=='pr'&&!withRoomsNumber&&!withChildren){messageInputs='<input type="hidden" id="kb_rooms" value="1" />'+'<input type="hidden" name="guests" id="kb_guests" value="'+def_guests+'" />'+'<input type="hidden" id="kb_guests_rooms" value="'+def_guests+',0;" />'}else{messageInputs='<input type="hidden" id="kb_rooms" value="1" />'+'<input type="hidden" id="kb_guests" value="'+def_guests+'" />'+'<input type="hidden" name="guests_rooms" id="kb_guests_rooms" value="'+def_guests+',0;" />'} 642for(var r=0;r<max_rooms;r++){messageInputs+='<input type="hidden" id="kb_adults_'+r+'" value="'+def_guests+'" />'+'<input type="hidden" id="kb_children_'+r+'" value="0" />';for(var k=0;k<max_children;k++){messageInputs+='<input type="hidden" id="kb_children_'+k+'_'+r+'" value="0" />'}} 643$('#guestsDiv').after(messageInputs);$('#guestsDiv').popover({animation:!1,html:!0,trigger:'manual',placement:'bottom',template:` 644 <div class="popover guestPopoverTemplate opensright shadow" role="tooltip"> 645 <h3 class="popover-header"></h3> 646 <div class="popover-body"></div> 647 </div>`,sanitize:!1,content:function(){var message=guestsRoomsDivContent($('body').hasClass('details'));return message}});$('#guestsDiv').click(function(){if($('#guestsDiv').attr('data-static')!='1'){$('#guestsDiv').val($('#kb_guests').val()+' '+($('#kb_guests').val()==1?t('js_be_ospite'):t('js_be_ospiti')));$('#guestsDiv .qtguests').html(`<span itemprop="numAdults">${$('#kb_guests').val()}</span>`+' '+($('#kb_guests').val()==1?t('js_be_ospite'):t('js_be_ospiti')));$('#guestsDiv').popover("show")}});document.addEventListener('click',function(event){var container1=document.getElementsByClassName('guestPopoverTemplate')[0];var container2=document.getElementById('guestsDiv');var container3=document.getElementById('btnApplyGuests');if((typeof container1!='undefined'&&container1!==event.target&&!container1.contains(event.target)&&typeof container2!='undefined'&&container2!==event.target&&!container2.contains(event.target))||typeof container3!='undefined'&&container3===event.target){if($("#guestsDiv").hasClass('reloadWhenChange')&&$(window).width()>991&&oldGuestsRooms!=$('#kb_guests_rooms').val()){$(".loading").show();$("#guestsDiv").closest('form').submit()}else{closePopover=!0;$('#guestsDiv').popover("hide")}}});var closePopover;var oldGuestsRooms;$("#guestsDiv").on('shown.bs.popover',function(){oldGuestsRooms=$('#kb_guests_rooms').val();closePopover=!1});$('#guestsDiv').on('hide.bs.popover',function(event){return closePopover})});function openEnquiryModal(type,id,from,to,guests_rooms){$('#enquiryModal').modal();var url=BASE_PATH+'/enquiry?ajax=true&enquiry_type='+type+'&ts='+moment().format('X')+'&apt='+id;if(from&&to){url+='&from='+from+'&to='+to} 648if(guests_rooms){url+='&guests_rooms='+guests_rooms} 649$('#enquiryModal .modal-body').html('');$.get(url,function(data){$('#enquiryModal .modal-body').html(data);loadEnquiryCalendar()})} 650function showChildren(r){var children=$('#children_'+r).val();$('#room_'+r+' .children_container').hide() 651for(i=0;i<children;i++){$('#children_container_'+(i+1)+'_'+r).show()}} 652function showRooms(){var rooms=$('#kb-rooms').val();$('.enq_room').hide();for(r=0;r<rooms;r++){$('#room_'+r).show()}} 653function kbGuestsEnquiry(guests_rooms){var total_guests=0;var rooms=guests_rooms.replace(/;$/,'').split(';');$('#kb-rooms').val(rooms.length);$('.enq_room').hide();for(r in rooms){$('#room_'+r).show();var elems=rooms[r].split(',');adults=parseInt(elems[0]);children=parseInt(elems[1]);childrenAge=elems.slice(2);if(adults>0){$('#adults_'+r).val(adults)} 654if(children>0){$('#children_'+r).val(children)} 655console.warn({childrenAge});if(childrenAge.length>0){for(k in childrenAge){$('#children_container_'+k+'_'+r).show();$('#children_age_'+k+'_'+r).val(childrenAge[k])}} 656total_guests+=adults+children}};var files=[];$(function(){$('input[type=file]').on('change',prepareUpload)}) 657function prepareUpload(event){files[event.target.getAttribute('name')]=event.target.files} 658function submitForm(id){var flds=new FormData();
658$('#'+id).find('input:not([type=file]), textarea, select').each(function(){flds.append($(this).attr('name'),$(this).val())}) 659var i_file=0;for(fld in files){var fldFiles=files[fld];$.each(fldFiles,function(key,value){flds.append(fld+'__'+key,value)})} 660$.ajax({url:BASE_PATH+'/contents/submitForm',method:'POST',data:flds,cache:!1,contentType:!1,processData:!1}).done(function(data){cf_success();$('#'+id).find('input:not([type=hidden]), textarea, select').val('');$('#'+id).find('input[type=checkbox]').prop('checked',!1);if(typeof grecaptcha!='undefined'){grecaptcha.reset()}}).fail(function(jqXHR,textStatus){alert(cf_fail)})} 661function submitMcForm(id){var flds=new FormData();$('#'+id).find('input:not([type=file]), textarea, select').each(function(){flds.append($(this).attr('name'),$(this).val())}) 662$.ajax({url:BASE_PATH+'/contents/submitForm',method:'POST',data:flds,cache:!1,contentType:!1,processData:!1}).done(function(data){cf_mc_success();$('#'+id).find('input:not([type=hidden]), textarea, select').val('');$('#'+id).find('input[type=checkbox]').prop('checked',!1);if(typeof dataLayerNewsletterSignup!='undefined'){dataLayerNewsletterSignup()}}).fail(function(jqXHR,textStatus){alert(cf_mc_fail)})};var filtersBreakpoint='lg';var filtersCheckboxTemplate;var filtersContainerTemplate;var filtersContainerTemplateLeft;var filtersItemCheckboxTemplate;var filtersItemPriceTemplateBefore;var filtersItemPriceTemplate;var filtersItemTextTemplateBefore;var filtersItemTextTemplate;var filtersActiveTemplate;filtersCheckboxTemplate=`<div class="renderedFilterGroup ml-`+filtersBreakpoint+`-auto mr-2 mb-4 mb-lg-0" data-filter-type="@name"> 663 <div class="custom-control custom-switch custom-switch-lg"> 664 <input type="checkbox" class="custom-control-input" id="filter_@name" name="filter_@name" onchange="filtersToggle('@name', '1');listingHideAndShow();" @disabled /> 665 <label for="filter_@name" class="custom-control-label">@label</label> 666 </div> 667</div>`;filtersContainerTemplate=`<div class="renderedFilterGroup dropdown mr-2 mb-4 mb-`+filtersBreakpoint+`-0" data-filter-type="@name"> 668 <button class="btn btn-light dropdown-toggle rounded-pill d-none d-`+filtersBreakpoint+`-block" type="button" id="dropdownMenuButton-@name" data-toggle="dropdown" aria-haspopup="true" data-display="static">@label</button> 669 <h4 class="d-`+filtersBreakpoint+`-none">@label</h4> 670 <div class="dropdown-menu my-2 my-`+filtersBreakpoint+`-0 p-`+filtersBreakpoint+`-4 text-muted" style="transition: none"> 671 @filterItems 672 </div> 673</div>`;filtersContainerTemplateLeft=`<div class="renderedFilterGroup mb-4" data-filter-type="@name"> 674 <h6 class="mobileFilterTitles">@label</h4> 675 <div class="my-2 text-muted" style="transition: none"> 676 @filterItems 677 </div> 678</div>`;filtersItemCheckboxTemplate=`<input id="filter_@name_@id" onchange="filtersToggle('@name', '@val_esc');listingHideAndShow();" type="checkbox" name="@name" value="@val" @disabled> 679<label class="mb-1" for="filter_@name_@id"> 680 <span class="filter-title">@label</span> (<span class="filter-counter" data-value="@val">@num</span>) 681</label>`;filtersItemPriceTemplateBefore='';filtersItemPriceTemplate=`@filtersItemPriceTemplateBefore<p class="mb-1">`+t('Prezzo minimo')+`</p> 682 <div class="input-group mb-2"> 683 <div class="input-group-prepend form-control-prepend"> 684 <span class="input-group-text" id="basic-addon1">`+CURRENCYH+`</span> 685 </div> 686 <input class="form-control" id="filterMinPrice" onchange="filtersPriceInputChange()"> 687 </div> 688 689 <p class="mb-1">`+t('Prezzo massimo')+`</p> 690 <div class="input-group mb-3"> 691 <div class="input-group-prepend form-control-prepend"> 692 <span class="input-group-text" id="basic-addon1">`+CURRENCYH+`</span> 693 </div> 694 <input class="form-control" id="filterMaxPrice" onchange="filtersPriceInputChange()"> 695 </div> 696 697 <div id="filterPrice" class="irs-hidden-input" tabindex="-1"></div> 698 699 <div class="d-none d-`+filtersBreakpoint+`-block mt-3"> 700 <div class="row"> 701 <div class="col-3 pr-0"> 702 <button onclick="filtersPriceReset();filtersPriceToggle();filtersCloseDropdown();listingHideAndShow();" type="button" name="" id="" class="btn btn-outline-danger btn-block" btn-lg btn-block"><i class="fa fa-undo" aria-hidden="true"></i></button> 703 </div> 704 <div class="col-9"> 705 <button onclick="filtersPriceToggle();filtersCloseDropdown();listingHideAndShow();" type="button" name="" id="" class="btn btn-primary btn-block" btn-lg btn-block">`+t('Applica')+`</button> 706 </div> 707 </div> 708 </div> 709 `;filtersItemTextTemplateBefore='';filtersItemTextTemplate=`@filtersItemTextTemplateBefore<div class="input-group mb-2"> 710 <input class="form-control" id="filterText" placeholder="`+t('Cerca...')+`" onchange="filtersTextInputChange()"> 711</div> 712 713<div class="d-none d-`+filtersBreakpoint+`-block mt-3"> 714 <div class="row"> 715 <div class="col-3 pr-0"> 716 <button onclick="filtersTextReset();filtersTextToggle();filtersCloseDropdown();listingHideAndShow();" type="button" name="" id="" class="btn btn-outline-danger btn-block" btn-lg btn-block"><i class="fa fa-undo" aria-hidden="true"></i></button> 717 </div> 718 <div class="col-9"> 719 <button onclick="filtersTextToggle();filtersCloseDropdown();listingHideAndShow();" type="button" name="" id="" class="btn btn-primary btn-block" btn-lg btn-block">`+t('Applica')+`</button> 720 </div> 721 </div> 722</div> 723`;filtersActiveTemplate=`<button onclick="filtersRemoveAll('@name');listingHideAndShow();" class="activeFilterRemove btn btn-outline-secondary rounded-pill btn-sm smaller mr-2" type="button" data-toggle="tooltip" title="Rimuovi filtro"> 724 @label: @val <i class="ml-2 fas fa-times-circle"></i> 725</button>`;if(HOTEL_ID=='altido'){filtersCheckboxTemplate=`<div class="renderedFilterGroup ml-lg-auto mr-2 mb-4 mb-lg-0" data-filter-type="@name"> 726 <div class="custom-control custom-switch custom-switch-lg"> 727 <input type="checkbox" class="custom-control-input" id="filter_@name" name="filter_@name" onchange="filtersToggle('@name', '1');listingHideAndShow();" @disabled /> 728 <label for="filter_@name" class="custom-control-label"><img src="/v6/custom/altido-five/img/filters/[email protected]" style="width:20px;height:20px;vertical-align: text-top;"> @label</label> 729 </div> 730 </div>`;filtersContainerTemplate=`<div class="renderedFilterGroup dropdown mr-2 mb-4 mb-lg-0" data-filter-type="@name"> 731 <button class="btn btn-light dropdown-toggle d-none d-lg-flex align-items-center" type="button" id="dropdownMenuButton-@name" data-toggle="dropdown" aria-haspopup="true" data-display="static"><img src="/v6/custom/altido-five/img/filters/[email protected]" style="width:20px;height:20px;margin-right:5px"><span class="px-1">@label</span></button> 732 <h4 class="d-lg-none"><img src="/v6/custom/altido-five/img/filters/[email protected]" style="width:20px;height:20px;vertical-align: top;"> @label</h4> 733 <div class="dropdown-menu my-2 my-lg-0 p-lg-4 text-muted" style="transition: none"> 734 @filterItems 735 </div> 736 </div>`} 737if(HOTEL_ID=='guesthost'){filtersCheckboxTemplate=`<div class="renderedFilterGroup ml-lg-auto mr-2 mb-4 mb-lg-0" data-filter-type="@name"> 738 <div class="custom-control custom-switch custom-switch-lg"> 739 <input type="checkbox" class="custom-control-input" id="filter_@name" name="filter_@name" onchange="filtersToggle('@name', '1');listingHideAndShow();" @disabled /> 740 <label for="filter_@name" class="custom-control-label"><img src="/v6/custom/altido-five/img/filters/[email protected]" style="width:20px;height:20px;vertical-align: text-top;"> @label</label> 741 </div> 742 </div>`;filtersContainerTemplate=`<div class="renderedFilterGroup dropdown mr-2 mb-4 mb-lg-0" data-filter-type="@name"> 743 <button class="btn btn-light dropdown-toggle d-none d-lg-flex align-items-center" type="button" id="dropdownMenuButton-@name" data-toggle="dropdown" aria-haspopup="true" data-display="static"><span class="px-1">@label</span></button> 744 <h4 class="d-lg-none">@label</h4> 745 <div class="dropdown-menu my-2 my-lg-0 p-lg-4 text-muted" style="transition: none"> 746 @filterItems 747 </div> 748 </div>`};var listingItemTpl;
748var filterSort;$(function(){if(typeof isListingPage!='undefined'&&isListingPage){if(typeof listingItemTpl=='undefined'){listingItemTpl=$('#apt-box-model').html() 749$('#apt-box-model').remove()} 750filterSort=$('#orderDesktop').val();mappaPanelMobileCheck();filtersToArray(!0);filtersBarGenerate();filtersTotalUpdate();filtersPanelMobileCheck();initMap();if(noScrollMap){L.Control.prototype._refocusOnMap=function _refocusOnMap(){}} 751if(window.innerWidth<mapPanelViewportMax){filterListByBounds()} 752filtersHideAndShow(function(){filtersSort(filterSort)},!1)}}) 753function listingReset(){filtersApply();filtersTextApply();filtersPriceUpdate();filtersPriceApply();refreshMap();filtersToArray(!1);filtersBarCalculate();filtersActiveBarReload();filtersTotalUpdate();paginatorReset();showMore()} 754function listingQuery(dataListings){filtersHideAndShow(function(){$('.listings-wrapper').html(dataListings);$('#apt-box-model').remove() 755filtersToArray(!0);filtersBarGenerate();filtersActiveBarReload();filtersTotalUpdate();filtersPanelMobileCheck();refreshMap();if(typeof filterSort!='undefined'&&filterSort!='relevance'){filtersSort(filterSort)}else{paginatorReset();showMore()}},!1)} 756function filtersCloseDropdown(){$('.renderedFilterGroup.dropdown').each(function(){var toggle=$(this).find('.dropdown-toggle');var menu=$(this).find('.dropdown-menu');if(menu.hasClass('show')){toggle.attr('data-expanded',!1);toggle.removeAttr('style');menu.removeClass('show');$(this).removeClass('show')}})} 757var filtersPanelDesktop=!1;if(HOTEL_ID=='mmega'){filtersPanelDesktop=!0} 758function filtersPanelMobileCheck(){if(filtersPanelDesktop){return}else if(window.innerWidth<992){$('.renderedFilterGroup.dropdown > div').removeClass('dropdown-menu')}else{if($("[name=filtersToggleBtn]").attr('data-open')=='1'){$("[name=filtersToggleBtn]").attr('data-open',0);$('body').removeClass('overflow-hidden')} 759$('#filtersContainerTop').css('left','');$('.renderedFilterGroup.dropdown > div').addClass('dropdown-menu')}} 760function mappaPanelMobileCheck(){if(window.innerWidth<mapPanelViewportMax){$('body').addClass('mapPanel');mapResetZoomBounds()}else{if($("[name=mapToggleBtn]").attr('data-open')=='1'){$("[name=mapToggleBtn]").attr('data-open',0);$('body').removeClass('overflow-hidden')} 761$('#mapContainer').css('left','');$('body').removeClass('mapPanel')}} 762$(window).on('resize',function(){filtersCloseDropdown();filtersPanelMobileCheck();mappaPanelMobileCheck()});function listingBuild(elem){if(elem.hasClass('flexFareItem')){return elem} 763if(!elem.empty()){return elem} 764var id=elem.attr('data-id');var additionalDataThis=additional_data['apt-'+id];var priceshown=0;if(additionalDataThis.overflow){priceshown=0}else if(elem.data('calcpricefrom')){priceshown=pr(elem.data('calcpricefrom'),0)}else if(elem.data('shortterm')){priceshown=pr(elem.data('shortterm'),0)} 765var listingItemThis=listingItemTpl.replaceAll('@id',id).replaceAll('@url_detail',additionalDataThis.url).replaceAll('@price_pr',priceshown).replaceAll('@price_window',additionalDataThis.price_window).replaceAll('@name',additionalDataThis.name).replaceAll('@rtcategory',elem.data('rtcategory')).replaceAll('@stars',additionalDataThis.stars).replaceAll('@address',additionalDataThis.address).replaceAll('@city',additionalDataThis.city).replaceAll('@description',additionalDataThis.description).replaceAll('@amenities_list',additionalDataThis.amenities_list).replaceAll('@max_occupancy_str',additionalDataThis.max_occupancy_str).replaceAll('@max_n_bedrooms_str',additionalDataThis.max_n_bedrooms_str).replaceAll('@max_n_bathrooms_str',additionalDataThis.max_n_bathrooms_str).replaceAll('@max_occupancy',elem.data('guests')).replaceAll('@max_n_bedrooms',elem.data('beds')).replaceAll('@max_n_bathrooms',elem.data('baths')).replaceAll('@max_size_sqm',additionalDataThis.max_size_sqm).replaceAll('@cod_type',additionalDataThis.cod_type);var listingItemObj=$(listingItemThis);var pricetpl=`<div class="minprice align-self-end mt-auto text-right" onclick="document.location.href='@url_detail';"> 766 <span class="mealplan">@mp</span> 767 <span class="price-SM">`+t('da')+`</span> <span class="price-LG">@price</span> 768 <i class="fa fa-info-circle" aria-hidden="true" data-html="true" data-toggle="tooltip" title="@tooltip"></i> 769 </div>`;
769var pricetplOverflow=`<div class="minprice price-overflow align-self-end mt-auto text-right" onclick="document.location.href='@url_detail';"> 770 <u>`+t('Piu soluzioni disponibili')+`</u> <span class="fa fa-arrow-right" aria-hidden="true"></span> 771 </div>`;pricesMpFull='';if(typeof additionalDataThis.overflow!='undefined'&&additionalDataThis.overflow){pricesMpFull=pricetplOverflow.replaceAll('@url_detail',additionalDataThis.url)}else{for(i in additionalDataThis.prices_with_mp){var pmp=additionalDataThis.prices_with_mp[i];var priceMpStr=pricetpl.replaceAll('@mp',pmp.mp).replaceAll('@price',pr(pmp.price)).replaceAll('@tooltip',pmp.tooltip.replaceAll('"',"")).replaceAll('@url_detail',additionalDataThis.url);pricesMpFull+=priceMpStr}} 772listingItemObj.find('.prices-with-mealplans').html(pricesMpFull);listingItemObj.find('.prices-with-mealplans').find('i[data-toggle="tooltip"][title=""]').remove();if(typeof additionalDataThis.images!='undefined'&&additionalDataThis.images.length>0){listingItemObj.find('.img-not-available').remove();for(var i in additionalDataThis.images){var image=additionalDataThis.images[i];var elemSlick=listingItemObj.find('.slickdo');var url="window.open('"+additionalDataThis.url+"');";var noblankAttr=elemSlick.attr('data-noblank');if(typeof noblankAttr!='undefined'&&noblankAttr=="true"){url="document.location.href = '"+additionalDataThis.url+"';"} 773if(i==0){elemSlick.append(`<div onclick="`+url+` return false;"> 774 <div class="divimg" style="background-image: url('`+image+`'); "></div> 775 </div>`)}else{elemSlick.append(`<div onclick="`+url+` return false;"> 776 <div class="divimg lazy-bg-img" data-lazy="`+image+`"></div> 777 </div>`)}}}else{listingItemObj.find('.slickdo').remove()} 778if(priceshown==0){listingItemObj.find('.overlay-aptbox-popup-price').remove();listingItemObj.find('.hide-no-price').remove()} 779if(elem.attr('data-instant_booking')!="1"){listingItemObj.find('.instant_booking_badge').remove()} 780if(elem.attr('data-free_cancellation')!="1"){listingItemObj.find('.free_cancellation_badge').remove()} 781if(elem.attr('data-promo')!="1"){listingItemObj.find('.promo_badge').remove()} 782if(additionalDataThis.max_size_sqm==''||parseInt(additionalDataThis.max_size_sqm)==0){listingItemObj.find('.info_sqm').remove()} 783if(parseInt(additionalDataThis.n_rooms)==1){listingItemObj.find('.info_multi_room').remove()}else{listingItemObj.find('.info_single_room').remove()} 784if(additionalDataThis.max_size_sqm==null){listingItemObj.find('.info_sqm').remove()} 785elem.append(listingItemObj);initFavRt(listingItemObj.find('.favouriteContainer'));$('*[data-toggle="tooltip"]').tooltip();return listingItemObj};var paginatorInc=10;function paginatorReset(){$('.listing-item:not(.flexFareItem)').addClass('paginator-hidden')} 786function paginatorIncrement(){var paginatorI=0;var impressions=[];$('.show-more-container').hide();$('.listing-item.paginator-hidden:not(.filtered-filter):not(.filtered-price):not(.filtered-text):not(.filtered-map)').each(function(){if(paginatorI++<paginatorInc){$(this).removeClass('paginator-hidden');var listingItemObj;if($(this).children().length==0){listingItemObj=listingBuild($(this))}else{listingItemObj=$(this)} 787impressions.push(listingItemObj)}else{$('.show-more-container').show();return!1}});if(typeof dataLayerUnitImpression!='undefined'){dataLayerUnitImpression(impressions)}} 788function showMore(){paginatorIncrement();refreshSlick();scrollFromMarker=!1} 789function showMoreBottom(){var filtersOpen=parseInt($("[name=filtersToggleBtn]").attr('data-open'));if(window.innerWidth<992&&filtersOpen){return}else if(scrollFromMarker){return}else if($(window).scrollTop()+$(window).height()<$(document).height()-(window.innerWidth<992?750:500)){return}else if($('.show-more-container').is(':hidden')){return} 790showMore()} 791$(function(){$(window).scroll(function(){showMoreBottom()})});var filtersArray=[];var filtersEnabled=[];function filtersReset(){filtersArray=[];for(var i in filtersShown){switch(filtersShown[i].name){case 'text':filtersArray[filtersShown[i].name]='';break;case 'price_range':filtersArray[filtersShown[i].name]={};break;default:filtersArray[filtersShown[i].name]=[];break}}} 792function filtersInc(filter,value){if(typeof value=='undefined'||(value==0&&filter!='beds')||value.length==0){return} 793if(typeof filtersArray[filter][value]=='undefined'){filtersArray[filter][value]=1}else{filtersArray[filter][value]++}} 794function filtersToArray(init){if(init){filtersEnabled=[];for(var i in filtersShown){if(filtersShown[i].name=='price_range'){filtersEnabled[filtersShown[i].name]={}}else if(filtersShown[i].name=='text'){filtersEnabled[filtersShown[i].name]=''}else{filtersEnabled[filtersShown[i].name]=[]}}} 795filtersReset();$('.listing-item:not(.filtered-price):not(.filtered-text)').each(function(){for(var i in filtersShown){var filter=filtersShown[i].name;if(filtersCheckElem($(this),filter)){switch(filter){case 'amenities':case 'locations':case 'mealplans':if(typeof $(this).data(filter)!='undefined'){var elemStr=$(this).data(filter).toString();var elem=elemStr.split(' ');for(var am in elem){filtersInc(filter,elem[am].toString())}} 796break;case 'text':;case 'price_range':;break;default:filtersInc(filter,$(this).data(filter))}}}})} 797function filtersCheckElem(elem,ignoreFilter){var aptDetails=$(elem).data();for(var filter in filtersEnabled){if(ignoreFilter==filter&&ignoreFilter!='amenities'){continue} 798if(filtersEnabled[filter].length>0){switch(filter){case 'beds':case 'baths':case 'group':case 'rtcategory':case 'district':case 'stars':case 'instant_booking':case 'free_cancellation':case 'promo':if(filtersEnabled[filter].indexOf(aptDetails[filter].toString())==-1){return!1} 799break;case 'amenities':var aptDetailsExpl;if(aptDetails[filter].toString().length){aptDetailsExpl=aptDetails[filter].toString().split(' ')}else{return!1} 800var filterSelected=filtersEnabled[filter];for(var i in filterSelected){if(aptDetailsExpl.indexOf(filterSelected[i].toString())==-1){return!1}} 801break;case 'locations':case 'mealplans':var aptDetailsExpl;if(aptDetails[filter].toString().length){aptDetailsExpl=aptDetails[filter].toString().split(' ')}else{return!1} 802var filterSelected=filtersEnabled[filter];var almenouno=!1;for(var i in filterSelected){if(aptDetailsExpl.indexOf(filterSelected[i].toString())>-1){almenouno=!0;break}}
803if(!almenouno){return!1} 804break;case 'price_range':case 'text':;default:break}}} 805return!0} 806function filtersCombinations(){var filtersEnabledComb=[];for(var filter in filtersEnabled){if(['amenities','price_range','text'].indexOf(filter)==-1){filtersEnabledComb[filter]=filtersEnabled[filter]}} 807var ret=Object.entries(filtersEnabledComb) 808ret=ret.filter(x=>x[1].length>0);ret=ret.reduce((r,[k,v])=>{var temp=[];r.forEach(s=>(Array.isArray(v)?v:[v]).forEach(w=>(w&&typeof w==='object'?getCartesian(w):[w]).forEach(x=>temp.push(Object.assign({},s,{[k]:x})))));return temp},[{}]);if(typeof filtersEnabled.amenities!='undefined'&&filtersEnabled.amenities.length>0){for(var i in ret){ret[i].amenities=filtersEnabled.amenities}} 809return ret} 810function filtersToggle(filter,value){var index=filtersEnabled[filter].indexOf(value);if(index>-1){filtersEnabled[filter].splice(index,1)}else{filtersEnabled[filter].push(value)}} 811function filtersRemoveAll(filter){if(filter=='price_range'){filtersPriceReset()}else if(filter=='text'){filtersTextReset()}else{filtersEnabled[filter]=[];$('.renderedFilterGroup[data-filter-type="'+filter+'"] input').prop('checked',!1)}}
812function filtersPurge(){for(var filter in filtersEnabled){switch(filter){case 'price_range':filtersPriceReset();break;case 'text':filtersTextReset();break;case 'instant_booking':case 'free_cancellation':case 'promo':filtersEnabled[filter]=[];if($('#filter_'+filter).prop('checked')){$('#filter_'+filter).prop('checked',!1)} 813break;default:if(filtersEnabled[filter].length>0){filtersRemoveAll(filter)} 814break}}} 815function filtersApply(){var atLeastOne=!1;for(var filter in filtersEnabled){if(filter!='price_range'&&filter!='text'&&filtersEnabled[filter].length>0){atLeastOne=!0}} 816if(atLeastOne){$('.listing-item').addClass('filtered-filter');var filtersCombs=filtersCombinations();for(var i in filtersCombs){var selector='.listing-item';for(var filter in filtersCombs[i]){switch(filter){case 'amenities':for(var am in filtersCombs[i][filter]){selector+='[data-'+filter+'~="'+filtersCombs[i][filter][am]+'"]'} 817break;case 'locations':case 'mealplans':selector+='[data-'+filter+'~="'+filtersCombs[i][filter]+'"]';break;default:selector+='[data-'+filter+'="'+filtersCombs[i][filter]+'"]'}} 818$(selector).removeClass('filtered-filter')}}else{$('.listing-item').removeClass('filtered-filter')}};function filtersPriceCalcMinMax(){var prices=$('.listing-item:not(.filtered-filter):not(.filtered-text)').map(function(){var val=parseFloat($(this).attr('data-calcpricefrom'));if(val>0){return val} 819return null}).get();var min=Math.min.apply(null,prices);var max=Math.max.apply(null,prices);if(min!=Infinity){min=Math.floor(min)} 820if(max!=Infinity){max=Math.ceil(max)} 821return{min:min,max:max}} 822function filtersPriceInit(){if($("#filterPrice").length==0){return} 823res=filtersPriceCalcMinMax();$("#filterMinPrice").val(res.min);$("#filterMaxPrice").val(res.max);$("#filterPrice").ionRangeSlider({type:"double",from:res.min,min:res.min,max:res.max,to:res.max,step:1,hide_from_to:!0,skin:"round",prefix:CURRENCYH,onChange:function(){filtersPriceChange()},onFinish:function(){if(window.innerWidth<992){filtersPriceToggle();listingReset()}}});$("#filterPrice").data('min',res.min);$("#filterPrice").data('max',res.max)} 824function filtersPriceChange(){var filter=$("#filterPrice");var min=filter.data("min");var from=filter.data("from");var to=filter.data("to");var max=filter.data("max");$("#filterMinPrice").val(from);$("#filterMaxPrice").val(to)} 825function filtersPriceInputChange(){if($("#filterPrice").length==0){return} 826var filter=$("#filterPrice");var min=filter.data("min");var from=filter.data("from");var to=filter.data("to");var max=filter.data("max");var newFrom=parseFloat($("#filterMinPrice").val());var newTo=parseFloat($("#filterMaxPrice").val());var validFrom=newFrom>=min&&newFrom<newTo;var validTo=newTo<=max;if(validFrom&&validTo){$("#filterMinPrice").val(newFrom);$("#filterMaxPrice").val(newTo);filter.data("ionRangeSlider").update({from:newFrom,to:newTo,});if(window.innerWidth<992){filtersPriceToggle();listingReset()}}else{$("#filterMinPrice").val(from);$("#filterMaxPrice").val(to)}} 827function filtersPriceToggle(){if($("#filterPrice").length==0){return} 828var filter=$("#filterPrice");var min=filter.data("min");var from=filter.data("from");var to=filter.data("to");var max=filter.data("max");if(min!=from||max!=to){filtersEnabled.price_range={min:parseInt(from),max:parseInt(to)}}else{filtersEnabled.price_range={}}} 829function filtersPriceReset(){if($("#filterPrice").length==0){return} 830var filter=$("#filterPrice");var min=filter.data("min");var max=filter.data("max");filtersEnabled.price_range={};filter.data("ionRangeSlider").update({from:min,to:max,});$("#filterMinPrice").val(min);$("#filterMaxPrice").val(max)} 831function filtersPriceApply(){if($("#filterPrice").length==0){return} 832var filter=$("#filterPrice");var min=filter.data("min");var from=filter.data("from");var to=filter.data("to");var max=filter.data("max");if(min!=from||max!=to){$('.listing-item').addClass('filtered-price');var elements=$('.listing-item').filter(function(){var price=0;if(typeof $(this).attr('data-shortterm')!='undefined'&&parseFloat($(this).attr('data-shortterm'))>0){price=parseFloat($(this).attr('data-shortterm'))} 833if(typeof $(this).attr('data-calcpricefrom')!='undefined'&&parseFloat($(this).attr('data-calcpricefrom'))>0){price=parseFloat($(this).attr('data-calcpricefrom'))} 834return price>=from&&price<=to});elements.removeClass('filtered-price')}else{$('.listing-item').removeClass('filtered-price')}} 835function filtersPriceUpdate(){if($("#filterPrice").length==0){return} 836res=filtersPriceCalcMinMax();var filter=$("#filterPrice");if(res.min==Infinity){filter.data("ionRangeSlider").update({min:0,from:0,to:0,max:0,block:!0});$("#filterPrice").data('min',0);$("#filterPrice").data('max',0);$("#filterMinPrice").val('');$("#filterMaxPrice").val('');$("#filterMinPrice").attr('disabled','disabled');$("#filterMaxPrice").attr('disabled','disabled')}else{var min=filter.data("min");var from=filter.data("from");var to=filter.data("to");var max=filter.data("max");if(typeof filtersEnabled.price_range.min!='undefined'&&typeof filtersEnabled.price_range.max!='undefined'){if(filtersEnabled.price_range.min>res.min){from=filtersEnabled.price_range.min}else{from=res.min} 837if(filtersEnabled.price_range.max<res.max){to=filtersEnabled.price_range.max}else{to=res.max} 838filtersEnabled.price_range={min:from,max:to}}else{from=res.min 839to=res.max} 840filter.data("ionRangeSlider").update({min:res.min,from:from,to:to,max:res.max,block:res.min==res.max});$("#filterPrice").data('min',res.min);$("#filterPrice").data('max',res.max);$("#filterMinPrice").val(from);$("#filterMaxPrice").val(to);$("#filterMinPrice").removeAttr('disabled');$("#filterMaxPrice").removeAttr('disabled')}} 841function filtersPriceGetCurrentValues(){};function filtersTextInputChange(){if(window.innerWidth<992){filtersTextToggle();listingReset()}} 842function filtersTextToggle(){var value=$('.renderedFilterGroup[data-filter-type="text"]
842input').val();filtersEnabled.text=value} 843function filtersTextReset(){$('.renderedFilterGroup[data-filter-type="text"] input').val('');filtersEnabled.text=''} 844function filtersTextApply(){var filter=$("#filterText");if(filter.length==0){return} 845var text=filter.val().toLowerCase();if(text.length>0){$('.listing-item').addClass('filtered-text');var elements=$('.listing-item').filter(function(){var name_apt=additional_data['apt-'+$(this).data('id')].name;var name_apt_text=name_apt.trim().toLowerCase();return name_apt_text.includes(text)});elements.removeClass('filtered-text')}else{$('.listing-item').removeClass('filtered-text')}};function filtersBarGenerate(){var filterBarLeft='';var filterBarRight='';var priceSliderInit=!1;var numCheckbox=0;for(i in filtersShown){var n=0;var filter=filtersShown[i].name;var labels=[];var nums=filtersArray[filter];switch(filter){case 'amenities':case 'locations':case 'group':labels=filtersShown[i].options;break;default:for(var key in nums){if(filter=='beds'&&key=='0'){labels[key]=t('Monolocale')}else{labels[key]=key}} 846break} 847switch(filtersShown[i].type){case 'multicheckbox':var filterItems='';for(var key in labels){var num;if(typeof nums[key]=='undefined'){if(filter=='group'){num=0}else{continue}}else{num=nums[key]} 848var disabled='';if(num==0){disabled='disabled'} 849var label=labels[key];var filterItem=filtersItemCheckboxTemplate.replace(/@name/g,filter).replace(/@val_esc/g,key.replace(/'/g,"\\'")).replace(/@val/g,key).replace(/@label/g,label).replace(/@id/g,n++).replace(/@num/g,num).replace(/@disabled/g,disabled);filterItems+=filterItem} 850if(filterItems==''){break} 851var filterContainer;if(typeof listingLayout!='undefined'&&listingLayout=='top'){filterContainer=filtersContainerTemplate}else{filterContainer=filtersContainerTemplateLeft} 852filterContainer=filterContainer.replace(/@name/g,filter).replace(/@label/g,filtersShown[i].label).replace(/@filterItems/,filterItems);filterBarLeft+=filterContainer;break;case 'text':if($('.listing-item').length==0){break} 853priceSliderInit=!0;var filtersItemTextTemplateThis=filtersItemTextTemplate.replace(/@filtersItemTextTemplateBefore/g,filtersItemTextTemplateBefore);var filterContainer;if(typeof listingLayout!='undefined'&&listingLayout=='top'){filterContainer=filtersContainerTemplate}else{filterContainer=filtersContainerTemplateLeft} 854filterContainer=filterContainer.replace(/@name/g,filter).replace(/@label/g,filtersShown[i].label).replace(/@filterItems/,filtersItemTextTemplateThis);filterBarLeft+=filterContainer;break;case 'price-slider':if($('.listing-item').length==0){break} 855var minMax=filtersPriceCalcMinMax();if(minMax.min==Infinity){break} 856priceSliderInit=!0;var filtersItemPriceTemplateThis=filtersItemPriceTemplate.replace(/@filtersItemPriceTemplateBefore/g,filtersItemPriceTemplateBefore);var filterContainer;if(typeof listingLayout!='undefined'&&listingLayout=='top'){filterContainer=filtersContainerTemplate}else{filterContainer=filtersContainerTemplateLeft} 857filterContainer=filterContainer.replace(/@name/g,filter).replace(/@label/g,filtersShown[i].label).replace(/@filterItems/,filtersItemPriceTemplateThis);filterBarLeft+=filterContainer;break;case 'checkbox':numCheckbox++;var disabled='';if($('.listing-item[data-'+filter+'=1]').length==0){disabled='disabled'} 858var filterContainer=filtersCheckboxTemplate.replace(/@name/g,filter).replace(/@label/g,filtersShown[i].label).replace(/@disabled/g,disabled);filterBarRight+=filterContainer;break;default:break}} 859$('#filtersBarAvailable #filtersBarLeft').html(filterBarLeft);if(numCheckbox>=2){$('#filtersBarAvailable #filtersBarRight').addClass('multiple-checkboxes')} 860$('#filtersBarAvailable #filtersBarRight').html(filterBarRight);$('#filtersBarAvailable .renderedFilterGroup[data-filter-type=price_range] .dropdown-menu').on('click',function(e){e.stopPropagation()}) 861$('#filtersBarAvailable .renderedFilterGroup[data-filter-type=period] .dropdown-menu').on('click',function(e){e.stopPropagation()}) 862$('#filtersBarAvailable .renderedFilterGroup[data-filter-type=guests] .dropdown-menu').on('click',function(e){e.stopPropagation()}) 863$('#filtersBarAvailable .renderedFilterGroup[data-filter-type=omnibar] .dropdown-menu').on('click',function(e){e.stopPropagation()}) 864if(priceSliderInit){filtersPriceInit()}} 865function filtersBarCalculate(){for(var i in filtersShown){var filter=filtersShown[i].name;var vals;switch(filter){case 'text':case 'price_range':continue;case 'instant_booking':case 'free_cancellation':case 'promo':if(typeof filtersArray[filter]['1']!='undefined'&&filtersArray[filter]['1']>0){$('#filter_'+filter).removeAttr('disabled')}else{$('#filter_'+filter).attr('disabled','')} 866continue;case 'amenities':case 'locations':vals=filtersShown[i].options;break;default:vals=filtersArray[filter];break} 867$('.renderedFilterGroup[data-filter-type="'+filter+'"] span.filter-counter').html('0');$('.renderedFilterGroup[data-filter-type="'+filter+'"] input').attr('disabled','');for(var key in vals){var count=filtersArray[filter][key];if(count>0){$('.renderedFilterGroup[data-filter-type="'+filter+'"] span.filter-counter[data-value="'+key+'"]').html(count);$('.renderedFilterGroup[data-filter-type="'+filter+'"] input[value="'+key+'"]').removeAttr('disabled')}}}} 868function filtersActiveBarReload(){var filterBar='';for(var i in filtersShown){var filter=filtersShown[i].name;var label=filtersShown[i].label;var len=filtersEnabled[filter].length;if(len==0){continue} 869var val;switch(filter){case 'text':val=filtersEnabled[filter];break;case 'beds':val='';for(var k in filtersEnabled[filter]){if(val!=''){val+=', '} 870if(filtersEnabled[filter][k]=='0'){val+=t('Monolocale')}else{val+=filtersEnabled[filter][k]}} 871break;case 'baths':val=filtersEnabled[filter].join(', ');break;case 'rtcategory':case 'district':case 'cities':val=filtersEnabled[filter][0];if(len>=2){val+=' + '+(len-1)} 872break;case 'amenities':case 'locations':case 'group':var options=filtersShown[i].options 873val=options[filtersEnabled[filter][0]];if(len>=2){val+=' + '+(len-1)} 874break;case 'price_range':if(typeof filtersEnabled[filter].min=='undefined'||filtersEnabled[filter].min==0){continue} 875val=t('da')+' '+pr(filtersEnabled[filter].min,0)+' '+t('a')+' '+pr(filtersEnabled[filter].max,0) 876break;default:continue} 877var filterItem=filtersActiveTemplate.replace(/@name/g,filter).replace(/@label/g,label).replace(/@val_esc/g,val.replace(/'/g,"\\'")).replace(/@val/g,val);filterBar+=filterItem} 878$('#selectedFiltersValues').html(filterBar);$('.tooltip').hide();filterActiveBarStyleReload()} 879function filterActiveBarStyleReload(){$('.renderedFilterGroup').removeClass('filter-active');$('#filtersBarLeftClear').hide();for(var i in filtersShown){var filter=filtersShown[i].name;switch(filter){case 'price_range':if(typeof filtersEnabled[filter].min!='undefined'&&filtersEnabled[filter].min>0){$('.renderedFilterGroup[data-filter-type='+filter+']').addClass('filter-active');$('#filtersBarLeftClear').show()} 880break;default:var len=filtersEnabled[filter].length;if(len==0){continue} 881$('.renderedFilterGroup[data-filter-type='+filter+']').addClass('filter-active');$('#filtersBarLeftClear').show();break}} 882if($('#kross_from').val()!=''){$('.renderedFilterGroup[data-filter-type=period]').addClass('filter-active');$('.renderedFilterGroup[data-filter-type=guests]').addClass('filter-active');$('#filtersBarLeftClear').show()} 883if($('#kross_omnibar').val()!=''){$('.renderedFilterGroup[data-filter-type=omnibar]').addClass('filter-active');$('#filtersBarLeftClear').show()}} 884function filtersTotalUpdate(){var count=$('.listing-item:not(.filtered-filter):not(.filtered-price):not(.filtered-text)').length;$('#countResultsContainer').attr('count',count);if(count==0){$('.count_results').html(t('Nessuna soluzione disponibile'));$('.flexHeadingTextContainer').show()}else if($('.flexHeadingText').text()!=''&&count==1){$('.count_results').html(t('Una soluzione alt disponibile'));$('.flexHeadingTextContainer').show()}else if($('.flexHeadingText').text()!=''){$('.count_results').html(t('@ soluzioni alt disponibili').replace('@',count));$('.flexHeadingTextContainer').show()}else if(count==1){$('.count_results').html(t('Una soluzione disponibile'));$('.flexHeadingTextContainer').hide()}else{$('.count_results').html(t('@ soluzioni disponibili').replace('@',count));$('.flexHeadingTextContainer').hide()}} 885function filtersSort(sortType){var container=$('.listings-wrapper');var elements=container.children('.listing-item');switch(sortType){case 'price':elements.sort(function(a,b){if($(a).data('calcpricefrom')==''&&$(b).data('calcpricefrom')==''){return 0}else if($(a).data('calcpricefrom')!=''&&$(b).data('calcpricefrom')==''){return-1}else if($(a).data('calcpricefrom')==''&&$(b).data('calcpricefrom')!=''){return 1}else if(parseInt($(a).data('calcpricefrom'))<parseInt($(b).data('calcpricefrom'))){return-1}else if(parseInt($(a).data('calcpricefrom'))>parseInt($(b).data('calcpricefrom'))){return 1}else{return 0}});break;case 'price-desc':elements.sort(function(a,b){if($(a).data('calcpricefrom')==''&&$(b).data('calcpricefrom')==''){return 0}else if($(a).data('calcpricefrom')!=''&&$(b).data('calcpricefrom')==''){return-1}else if($(a).data('calcpricefrom')==''&&$(b).data('calcpricefrom')!=''){return 1}else if(parseInt($(a).data('calcpricefrom'))>parseInt($(b).data('calcpricefrom'))){return-1}else if(parseInt($(a).data('calcpricefrom'))<parseInt($(b).data('calcpricefrom'))){return 1}else{return 0}});break;default:elements.sort(function(a,b){if($(a).data('loop')<$(b).data('loop')){return-1}else if($(a).data('loop')>$(b).data('loop')){return 1}else{return 0}});break} 886container.html(elements);paginatorReset();showMore();turnMarkerInit()} 887function filtersHideAndShow(callback_hide,onPanel=!1){if(window.innerWidth<992&&onPanel){callback_hide()}else{$('.count_results').animate({opacity:0}
887,300);$('.flexHeadingTextContainer').animate({opacity:0},300);$('.sortSelect2Desktop').animate({opacity:0},300);$('#propertiesResultContainer').animate({opacity:0},300,function(){if(typeof callback_hide!='undefined'){callback_hide()} 888setTimeout(function(){$('.intro-text').animate({opacity:1},300);$('#filtersContainerTop').animate({opacity:1},300);$('.show-more-container').animate({opacity:1},300);$('.count_results').animate({opacity:1},300);$('.flexHeadingTextContainer').animate({opacity:1},300);$('.sortSelect2Desktop').animate({opacity:1},300);$('#propertiesResultContainer').animate({opacity:1},300)},150)})}} 889function listingHideAndShow(){filtersHideAndShow(function(){listingReset()},!0)} 890function updateSort(filterType){if(typeof filterType=='undefined'){filterType=$('#orderDesktop').val()}else{$('#orderDesktop').val(filterType)} 891filterSort=filterType;filtersHideAndShow(function(){filtersSort(filterType)})} 892var fixedLayout=!0;var filtersPanelOpensRight=!1;if(HOTEL_ID=='mmega'){filtersPanelOpensRight=!0} 893function filtriToggler2(changeChk){var open=parseInt($("[name=filtersToggleBtn]").attr('data-open'));open=(open+1)%2;$("[name=filtersToggleBtn]").attr('data-open',open);if(open){$('body').addClass('overflow-hidden');if(filtersPanelOpensRight){$('#filtersContainerTop').animate({right:"0%"},300,'swing')}else{$('#filtersContainerTop').animate({left:"0%"},300,'swing')}}else{$('body').removeClass('overflow-hidden');if(filtersPanelOpensRight){$('#filtersContainerTop').animate({right:"-100%"},300,'swing')}else{$('#filtersContainerTop').animate({left:"-100%"},300,'swing')}}} 894function filtriTogglerBackdrop(e){if($(e.target).is("div#filtersContainerTop")){filtriToggler2()}} 895function mappaToggler2(changeChk){var open=parseInt($("[name=mapToggleBtn]").attr('data-open'));open=(open+1)%2;$("[name=mapToggleBtn]").attr('data-open',open);if(open){$('body').addClass('overflow-hidden');$('#mapContainer').animate({left:"0%"},300,'swing')}else{$('body').removeClass('overflow-hidden');$('#mapContainer').animate({left:"100%"},300,'swing')}};var mapPopupHover=!1;var markersL;var mapInit=!1;var mapUpdate=!1;function initMap(){latlng=L.latLng(mapLatLng1,mapLatLng2);if($('#kross_map').length==0){return} 896kross_map=L.map('kross_map',{zoom:10,zoomSnap:0.1,maxZoom:19,scrollWheelZoom:!1});var tile_default=L.maplibreGL({style:'https://tiles.openfreemap.org/styles/bright'});if(kross_map_satellite){var tile_satellite=L.tileLayer('http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}',{maxZoom:20,subdomains:['mt0','mt1','mt2','mt3']});var tiles={"Default":tile_default,"Satellite":tile_satellite};L.control.layers(tiles).addTo(kross_map)} 897tile_default.addTo(kross_map);markersL=L.markerClusterGroup({showCoverageOnHover:!1,polygonOptions:{fillColor:markerClusterColor,color:'#412451',},maxClusterRadius:30,spiderfyDistanceMultiplier:3,iconCreateFunction:function(cluster){var childCount=cluster.getChildCount();var c=' marker-cluster-';if(childCount<10){c+='small'}else if(childCount<100){c+='medium'}else{c+='large'} 898return new L.DivIcon({html:'<div><span>'+childCount+'</span></div>',className:'marker-cluster'+c,iconSize:new L.Point(40,40)})},});markersL.on('clusterclick',function(a){kross_map.fitBounds(a.layer.getBounds().pad(0.8))});if(mapPopupHover){markersL.on('mouseover',function(a){mapMarkerPopup(a)});markersL.on('click',function(a){mapMarkerScroll(a)})}else{markersL.on('click',function(a){mapMarkerPopup(a);mapMarkerScroll(a)})} 899if(typeof kross_map=='undefined'){return} 900kross_map.on("moveend",function(s){if(mapInit&&!mapUpdate){if(!moveFromMarker){var open=parseInt($("[name=mapToggleBtn]").attr('data-open'));if(window.innerWidth>=mapPanelViewportMax||(window.innerWidth<mapPanelViewportMax&&open)){filterListByBounds();paginatorReset();showMore()}}else{moveFromMarker=!1}}else{mapUpdate=!1}});kross_map.setView(latlng,mapZoom);mapInit=!0;refreshMap()} 901function refreshMap(){mapUpdate=!0;markerArray=new Array();markerFullArray=new Array();var priceshown;var markerpos;$('.listings-wrapper .listing-item:not(.filtered-filter):not(.filtered-price):not(.filtered-text)').each(function(){var id=$(this).attr('data-id');var additionalDataThis=additional_data['apt-'+id]||{};if(!$(this).attr('data-lat')||!$(this).attr('data-lon')||$(this).attr('data-lat')==''||$(this).attr('data-lon')==''||$(this).attr('data-lat')=='0'||$(this).attr('data-lon')=='0') 902return;if(additionalDataThis.overflow){priceshown=0}else if($(this).data('calcpricefrom')){priceshown=$(this).data('calcpricefrom')}else{priceshown=$(this).data('shortterm')} 903markerpos=$(this).attr('data-pos');markerArray.push([$(this).data('lat'),$(this).data('lon'),$(this).data('id'),priceshown,markerpos])});markersL.clearLayers();for(var i=0;i<markerArray.length;i++){var a=markerArray[i];var marker_icon=L.divIcon({iconSize:[55,30],bgPos:[0,20]});if(a[3]>0){priceshown=pr(a[3],0);markerpos=a[4];marker_icon.options.html='<div class="mapPricePill py-1 px-2 border border-dark rounded-pill font-weight-bold text-center shadow '+markerpos+'">
903'+priceshown+'</div>'}else{marker_icon.options.html='<div class="mapPricePill py-1 px-2 border border-dark rounded-pill font-weight-bold text-center shadow '+markerpos+'"><i class="fad fa-house"></i></div>'} 904var marker=L.marker(new L.LatLng(a[0],a[1]),{shortTerm:a[3],customId:a[2],icon:marker_icon});markerFullArray.push(marker)} 905markersL.addLayers(markerFullArray,{chunkedLoading:!0,chunkInterval:100});kross_map.addLayer(markersL);mapResetZoomBounds();if(!noScrollMap){$('html').animate({scrollTop:$('#mainContainerUpper').offset().top-$('header').height()-$('#filtersContainerTop').height()-80},'slow','linear')} 906turnMarkerInit()} 907function mapResetZoomBounds(){if(typeof markersL!='undefined'){var bounds=markersL.getBounds();kross_map.setActiveArea({position:'absolute',left:'20px',right:'20px',top:'10px',height:'100%'});if(markerArray.length){kross_map.fitBounds(bounds.pad(0.1))}} 908$('.listing-item').removeClass('filtered-map')} 909function turnMarker(listingItem,transition){var priceshown='';var thatMarker=reverseMarkerFinder(listingItem);var visibleOne=markersL.getVisibleParent(thatMarker);if(visibleOne==null){return} 910if($(visibleOne._icon).hasClass('marker-cluster')){if(transition=='on'){$(visibleOne._icon).find('div').css({"background":markerClusterColorHover,"color":markerClusterColorHoverText})}else{$(visibleOne._icon).find('div').css({"background":markerClusterColor,"color":"white"})}}else{var id=listingItem.data('id');var additionalDataThis=additional_data['apt-'+id];var overflow=additionalDataThis.overflow;if(noPricesMap||overflow){priceshown=0}else if(listingItem.data('calcpricefrom')){priceshown=listingItem.data('calcpricefrom')}else{priceshown=listingItem.data('shortterm')} 911if(priceshown>0){priceshown=pr(priceshown,0);if(transition=='on'){thatMarker.options.icon=L.divIcon({iconSize:[55,30],bgPos:[0,20],html:'<div style="background:'+markerClusterColorHover+'; color:'+markerClusterColorHoverText+';" class="mapPricePill py-1 px-2 border border-'+markerBorderColorHover+' rounded-pill font-weight-bold text-center shadow">
911'+priceshown+'</div>'})}else{thatMarker.options.icon=L.divIcon({iconSize:[55,30],bgPos:[0,20],html:'<div style="" class="mapPricePill py-1 px-2 border border-'+markerBorderColor+' rounded-pill font-weight-bold text-center shadow">'+priceshown+'</div>'})}}else{if(transition=='on'){thatMarker.options.icon=L.divIcon({iconSize:[55,30],bgPos:[0,20],html:'<div style="background:'+markerClusterColorHover+'; color:'+markerClusterColorHoverText+';" class="mapPricePill py-1 px-2 border border-'+markerBorderColorHover+' rounded-pill font-weight-bold text-center shadow"><i class="fad fa-house"></i></div>'})}else{thatMarker.options.icon=L.divIcon({bgPos:[0,20],iconSize:[55,30],html:'<div class="mapPricePill py-1 px-2 border border-dark rounded-pill font-weight-bold text-center shadow"><i class="fad fa-house"></i></div>'})}} 912markersL.removeLayer(thatMarker);markersL.addLayer(thatMarker);kross_map.addLayer(markersL)}} 913function reverseMarkerFinder(hovered){var customId=hovered.data('id');var markerFound=markerLookup(markersL.getLayers(),customId);if(markerFound) 914return markersL.getLayer(markerFound._leaflet_id);return null} 915function markerLookup(array,value){for(var i=0,len=array.length;i<len;i++){if(array[i].options.customId==value){return(array[i])}} 916return null} 917function filterListByBounds(){var mapBounds=kross_map.getBounds().pad(0.1);var listings=[];$('.listing-item').addClass('filtered-map');$('.listing-item').each(function(){if(mapBounds.contains(L.latLng($(this).attr('data-lat'),$(this).attr('data-lon')))){listings.push($(this).attr('id'))}});if(listings.length>0){$.each(listings,function(index,value){$("#"+value).removeClass('filtered-map')})} 918if(!noScrollMap){$('html').animate({scrollTop:$('#mainContainer').offset().top-$('header').height()-$('#filtersContainerTop').height()-80},'slow','linear')}};function mapMarkerPopup(a){if($('div[data-id='+a.layer.options.customId+']').html().trim().length==0){var impressions=[];$('div[data-id='+a.layer.options.customId+']').removeClass('paginator-hidden');var listingItemObj=listingBuild($('div[data-id='+a.layer.options.customId+']'));impressions.push(listingItemObj);if(typeof dataLayerUnitImpression!='undefined'){dataLayerUnitImpression(impressions)}} 919var scelta=$('div[data-id='+a.layer.options.customId+'] .listing-outer');var parentScelta=scelta.parent();var priceshown;var priceshownVal;if(typeof parentScelta.data('calcpricefrom')!='undefined'){priceshownVal=parentScelta.data('calcpricefrom')}else{priceshownVal=parentScelta.data('shortterm')} 920priceshown=pr(priceshownVal,0);var guests=parentScelta.data('guests');var beds=parentScelta.data('beds');var baths=parentScelta.data('baths');var addr=parentScelta.data('address') 921var avatar=parentScelta.data('avatar') 922var photoDiv=scelta.find('.divimg');var coverPhoto='<div class="img-not-available"></div>';var name=scelta.find('.name-apt').html();var url=scelta.find('.name-apt').attr('href');var address=scelta.find('.address-apt').html();if(typeof address==='undefined'){address='';scelta.find('.address-apt').addClass('d-none')} 923if(typeof avatar==='undefined'){avatar=''} 924var targetBlank='';if(typeof mapOpenInNewPage=='undefined'||mapOpenInNewPage){targetBlank=' target="_blank"'} 925if(!photoDiv.hasClass('img-not-available')){var photoUrl=photoDiv.css('background-image').replace(/^url\(['"]?/,'').replace(/['"]?\)$/,'');if(photoUrl){coverPhoto='<a '+targetBlank+' href = "'+url+'" > <img class="img-fluid border-top" src="'+photoUrl+'"></a>'}} 926var popupContent='<div class="position-relative inner-marker-popup pb-2">';popupContent=popupContent+coverPhoto;if(priceshownVal>0){popupContent=popupContent+'<div class="position-absolute text-left overlay-marker-popup-price shadow-lg py-2 pl-3 pr-3">
926'+priceshown+'</div>'} 927popupContent=popupContent+'<div class=" text-left overlay-marker-popup">';popupContent=popupContent+'<h6 class="px-3"><a class="name-apt" '+targetBlank+' href = "'+url+'" > '+name+'</a > <br><small class="text-muted"><i>'+address+'</i></small></h6>';popupContent=popupContent+'</div>';popupContent=popupContent+'</div>';$('.listings-wrapper .listing-item .listing-outer').removeClass('selectedProperty');a.layer.bindPopup(popupContent,{minWidth:300,closeButton:!1,offset:new L.Point(6,-6)}).openPopup()} 928function mapMarkerScroll(a){setTimeout(function(){$('.selectedProperty').removeClass("selectedProperty");scelta=scrollToHouse(a.layer.options.customId);scelta.addClass("selectedProperty");var slickMe=scelta.find(".slickdo").first();slickDo(slickMe)},300)};var scrollFromMarker;var moveFromMarker;function turnMarkerInit(){$('.listing-item').on("mouseenter",function(){turnMarker($(this),'on')}).on("mouseleave",function(){turnMarker($(this),'off')})} 929function turnMarker(listingItem,transition){var priceshown='';var thatMarker=reverseMarkerFinder(listingItem);var visibleOne=markersL.getVisibleParent(thatMarker);if(visibleOne==null){return} 930if($(visibleOne._icon).hasClass('marker-cluster')){if(transition=='on'){$(visibleOne._icon).find('div').css({"background":markerClusterColorHover,"color":markerClusterColorHoverText})}else{$(visibleOne._icon).find('div').css({"background":markerClusterColor,"color":"white"})}}else{var id=listingItem.data('id');var additionalDataThis=additional_data['apt-'+id];var overflow=additionalDataThis.overflow;if(noPricesMap||overflow){priceshown=0}else if(listingItem.data('calcpricefrom')){priceshown=listingItem.data('calcpricefrom')}else{priceshown=listingItem.data('shortterm')} 931if(priceshown>0){priceshown=pr(priceshown,0);if(transition=='on'){thatMarker.options.icon=L.divIcon({iconSize:[55,30],bgPos:[0,20],html:'<div style="background:var(--marker_color_hover); border-color:var(--marker_border_color_hover) !important; color:var(--text_marker_hover_inverse);" class="mapPricePill py-1 px-2 border rounded-pill font-weight-bold text-center shadow">
931'+priceshown+'</div>'})}else{thatMarker.options.icon=L.divIcon({iconSize:[55,30],bgPos:[0,20],html:'<div style="" class="mapPricePill py-1 px-2 border border-'+markerBorderColor+' rounded-pill font-weight-bold text-center shadow">'+priceshown+'</div>'})}}else{if(transition=='on'){thatMarker.options.icon=L.divIcon({iconSize:[55,30],bgPos:[0,20],html:'<div style="background:var(--marker_color_hover); border-color:var(--marker_border_color_hover) !important; color:var(--text_marker_hover_inverse);" class="mapPricePill py-1 px-2 border rounded-pill font-weight-bold text-center shadow"><i class="fad fa-house"></i></div>'})}else{thatMarker.options.icon=L.divIcon({bgPos:[0,20],iconSize:[55,30],html:'<div class="mapPricePill py-1 px-2 border border-dark rounded-pill font-weight-bold text-center shadow"><i class="fad fa-house"></i></div>'})}} 932markersL.removeLayer(thatMarker);markersL.addLayer(thatMarker);kross_map.addLayer(markersL)}} 933function scrollToHouse(aid){var aTag=$("div[data-id='"+aid+"']");if(aTag.hasClass('paginator-hidden')){slickTag=aTag.find('.slickdo');slickDo(slickTag);aTag.removeClass('paginator-hidden')} 934scrollFromMarker=!0;moveFromMarker=!0;var top=aTag.offset().top-$('header').height()-80;if($('#filtersContainerTop').length>0){top-=$('#filtersContainerTop').height()} 935$('html').animate({scrollTop:top},'slow','linear',function(){});return aTag};(function($){$.fn.selectk=function(options){var selectElem=this;var ajaxTimeout;var ajaxRequest;var ajaxCache={};var params={term:''};var results={};if(typeof options=='undefined'){options={}} 936var settings=$.extend({id:null,minimumInputLength:0,searchPlaceholder:null,searchLabel:null,data:[],ajax:{url:null,delay:250,method:'GET',data:function(params){return{q:params.term,}},dataType:'json',processResults:function(results){return results},cache:!0}},options);if(settings.id==null){var selectkId;if(typeof this.attr('id')!='undefined'&&this.attr('id').length>0){selectkId=this.attr('id')}else if(typeof this.attr('name')!='undefined'&&this.attr('name').length>0){selectkId=this.attr('name')}else{selectkId=Math.random()*8999+1000;selectkId=Math.floor(selectkId)} 937settings.id='selectk-'+selectkId} 938if(settings.searchPlaceholder==null){if(settings.minimumInputLength==0){settings.searchPlaceholder=t('js_Write to search')}else if(settings.minimumInputLength==1){settings.searchPlaceholder=t('js_Write at least 1c to search')}else{settings.searchPlaceholder=t('js_Write at least @cs to search').replace('@',settings.minimumInputLength)}} 939if(settings.searchLabel==null){var searchName=selectElem.attr('name');var searchLabel=$('label[for="'+searchName+'"]').html();if(typeof searchLabel!='undefined'&&searchLabel.length>0){settings.searchLabel=searchLabel}} 940if(settings.data.length==0){selectElem.find('option').each(function(){if($(this).val().length==0&&$(this).text()==0){return} 941settings.data.push({id:$(this).val(),text:$(this).text()})})} 942var selectkPosition=function(){var width=$('#'+settings.id).width();var parent=$('#'+settings.id);var offset=parent.offset();$('#selectk-popup').css('left',offset.left);$('#selectk-popup').css('top',offset.top+height-1);$('#selectk-popup').css('width',width)} 943var selectkIsOpen=!1;var selectkOpen=function(e){if(!selectkIsOpen){if(window.innerWidth<576){$('body').addClass('selectk-modal-open')} 944$('body').append(`<div class="selectk-popup" id="selectk-popup"> 945 <div class="selectk-popup-label"> 946 <div class="selectk-popup-label-span"></div> 947 <div class="selectk-popup-label-close"><a href="javascript:;"><i class="fas fa-times"></i></a></div> 948 </div> 949 <div class="selectk-popup-search-cnt"><input type="text" id="selectk-popup-search"></div> 950 <div class="selectk-popup-alert" style="display:none"></div> 951 <div class="selectk-popup-results"><ul></ul></div> 952 </div>`);selectkPosition();if(settings.searchLabel==null||settings.searchLabel.length==0){$('.selectk-popup-label').remove()}else{$('.selectk-popup-label-span').html(settings.searchLabel)} 953$('.selectk-popup-label-close a').on('click',selectkClose);$('#selectk-popup-search').attr('placeholder',settings.searchPlaceholder);$('#selectk-popup-search').focus();$('#selectk-popup-search').on('keyup',selectKFilter);
953selectKPopulate(settings.data);$('#'+settings.id).find('.selectk-arrow .fas').addClass('fa-chevron-up').removeClass('fa-chevron-down');$(document).on('mouseup',selectkClickOutside);$(window).on('resize',selectkPosition);selectkIsOpen=!0}else{selectkClose()}} 954var selectkClose=function(){$(document).off('mouseup',selectkClickOutside);$(window).off('resize',selectkPosition);$('#selectk-popup').remove();$('body').removeClass('selectk-modal-open');$('#'+settings.id).find('.selectk-arrow .fas').addClass('fa-chevron-down').removeClass('fa-chevron-up');selectkIsOpen=!1} 955var selectkPrevW=0;$(window).on('resize',function(){if(selectkPrevW!=window.innerWidth){selectkClose()} 956selectkPrevW=window.innerWidth});var selectkClickOutside=function(e){var container1=$('#selectk-popup');var container2=$('#'+settings.id);if(!container1.is(e.target)&&container1.has(e.target).length===0&&!container2.is(e.target)&&container2.has(e.target).length===0){selectkClose()}} 957var selectKPopulate=function(data){$('.selectk-popup-results ul').html('');for(var i in data){var item=data[i];var el=$('<li class="selectk-option selectk-option-selectable"></li>');el.html(item.text);el.attr('data-val',item.id);$('.selectk-popup-results ul').append(el)} 958$('.selectk-popup-results ul li').on('click',selectKSelect);if(settings.minimumInputLength>0&¶ms.term.length==0){$('.selectk-popup-results ul li').addClass('selectk-filtered')}} 959var selectKFilter=function(){var text=$('#selectk-popup-search').val().toLowerCase();if(text==params.text){return} 960params.term=text;if(settings.minimumInputLength>0&&text.length<settings.minimumInputLength){$('.selectk-popup-results ul li').addClass('selectk-filtered')}else if(settings.ajax.url!=null){if(ajaxTimeout!=null){console.warn('clearing timeout');clearTimeout(ajaxTimeout);ajaxTimeout=null} 961if(ajaxRequest!=null){ajaxRequest.abort()} 962$('.selectk-popup-results ul').html('');if(typeof ajaxCache[text]!='undefined'){$('.selectk-popup-alert').html('');$('.selectk-popup-alert').hide();var objects=settings.ajax.processResults(ajaxCache[text]);selectKPopulate(objects.results)}else{if(!$('.selectk-popup-alert').is(':visible')||!$('.selectk-popup-alert').hasClass('selectk-popup-alert-loading')){$('.selectk-popup-alert').removeClass('selectk-popup-alert-warn').addClass('selectk-popup-alert-loading');$('.selectk-popup-alert').html('<i class="fas fa-spinner-third fa-spin mr-1"></i> Loading search results...');$('.selectk-popup-alert').show()} 963ajaxTimeout=setTimeout(function(){ajaxRequest=$.ajax({url:settings.ajax.url,method:settings.ajax.method,data:settings.ajax.data(params),dataType:settings.ajax.dataType}).done(function(data){ajaxTimeout=null;$('.selectk-popup-alert').html('');$('.selectk-popup-alert').hide();if(settings.ajax.cache){ajaxCache[params.term]=data} 964var objects=settings.ajax.processResults(data);selectKPopulate(objects.results)}).fail(function(jqXHR,textStatus){if(jqXHR.readyState!=0){$('.selectk-popup-alert').removeClass('selectk-popup-alert-loading').addClass('selectk-popup-alert-warn');$('.selectk-popup-alert').html('<i class="fas fa-exclamation-triangle mr-1"></i> An error occurred while retrieving the results. Please try again.')}})},settings.ajax.delay)}}else if(text.length>0){$('.selectk-popup-results ul li').addClass('selectk-filtered');var elements=$('.selectk-popup-results ul li').filter(function(){var name_t=$(this).text();var name_t_text=name_t.trim().toLowerCase();return name_t_text.includes(text)});elements.removeClass('selectk-filtered')}else{$('.selectk-popup-results ul li').removeClass('selectk-filtered')}} 965var selectKSelect=function(e){var option=$(e.target);var value=option.attr('data-val');var text=option.text();if(selectElem.find('option[value="'+value+'"]').length==0){selectElem.append('<option value="'+value+'">'+text+'</option>')} 966selectElem.val(value).trigger('change')} 967var selectKChange=function(){var option=selectElem.find(":selected");var html=option.html();$('#'+settings.id).find('.selectk-selected').html(html);selectkClose()} 968var height=this.height();this.css('display','none');this.addClass('selectk-initialized');this.change(function(){selectKChange()});this.after('<div class="selectk" id="'+settings.id+`"> 969 <div class="selectk-selected"></div> 970 <div class="selectk-arrow"><i class="fas fa-chevron-down"></i></div> 971 `);$('#'+settings.id).css('height',height);
971$('#'+settings.id).on('click',selectkOpen)}}(jQuery));function isIOSDevice(){return!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)} 972function gpLog(func,params){} 973function gpSubmitEnable(){$("button[type='submit']").removeClass('disabled').removeAttr('disabled');return!1} 974function gpSubmitDisable(){$("button[type='submit']").addClass('disabled').attr('disabled','disabled');return!1} 975$(function(){hideSendingMan=!0;hideLoadingMan=!0});var gpMrzModal;var mrzcount=0;var blackLineBarHeight=clipHeight=0;var stream=null;function gpMrzInfoOpen(){$('.mrz-btnbox-info').fadeIn()} 976function gpMrzInfoClose(){$('.mrz-btnbox-info').fadeOut()} 977function gpMrzOpen(){if($('#mrzModal').length==0){$('body').append('<div id="mrzModal" class="modal" role="dialog">'+gpMrzModal+'</div>')} 978$('#mrzModal').modal({backdrop:'static',keyboard:!1},'show').on('hidden.bs.modal',function(){gpMrzStop()});mrzRestart()} 979function gpMrzStopAndClose(){gpMrzInfoClose();$('#mrzModal').modal('hide')} 980function gpMrzStop(){gpMrzInfoClose();if(videoMrzAcquire.srcObject!=null){stopMrz()}} 981var handlerLoadedMetaDataListener=function(){var videoParentHeight=parseInt($('#videoMrzAcquire').parent().outerHeight());blackLineBarHeight=clipHeight=parseInt(videoParentHeight/3);if(!$('#rectangeCapture').length>0){var rectangeCapture=$('<div id="rectangeCapture">').css('position','absolute').css('height',blackLineBarHeight+'px').css('width','100%').css('background-color','transparent').css('top',clipHeight+'px').css('left',0).css('display','flex').css('justify-content','center').css('align-items','center');rectangeCapture.appendTo($('#videoMrzAcquire').parent());var rectangeCaptureBorder=$('<div>').css('height','100%').css('width','95%').css('border','dashed 2px #fff').css('border-radius','8px').css('-webkit-box-shadow','0px 0px 20px 0px rgba(0,0,0,0.5)').css('box-shadow','0px 0px 20px 0px rgba(0,0,0,0.5)').css('background-color','transparent');rectangeCaptureBorder.appendTo(rectangeCapture)} 982canvasMrzAcquire.width=videoMrzAcquire.videoWidth;canvasMrzAcquire.height=parseInt(videoMrzAcquire.videoHeight/3)} 983var handlerPlayListener=function(){var $this=this;startMrz(1,videoMrzAcquire);(function loop(){if(!$this.paused&&!$this.ended){var clipWidth=videoMrzAcquire.videoWidth;ctxMrz.filter="grayscale()";ctxMrz.drawImage($this,0,-1*canvasMrzAcquire.height);const imgData=ctxMrz.getImageData(0,0,canvasMrzAcquire.width,canvasMrzAcquire.height);var d=imgData.data;ctxMrz.putImageData(imgData,0,0);setTimeout(loop,1000/30)}})()} 984var videoMrzAcquire;var canvasMrzAcquire;var ctxMrz;async function mrzRestart(){$('#videoMrzAcquireCnt').html('<video id="videoMrzAcquire" class="sendToOcr" autoplay style="width: 100%" playsinline="true"></video>');$('#canvasMrzAcquireCnt').html('<canvas id="canvasMrzAcquire" style="background-color: black; width: 100%;"></canvas>');videoMrzAcquire=document.querySelector("#videoMrzAcquire");canvasMrzAcquire=document.querySelector("#canvasMrzAcquire");ctxMrz=canvasMrzAcquire.getContext('2d');mrzcount=0;$('.noread').css('display','none');$('#videoMrzAcquire').parent().parent().show();$('#videoMrzAcquire').show();videoMrzAcquire.removeEventListener('loadedmetadata',handlerLoadedMetaDataListener);videoMrzAcquire.addEventListener('loadedmetadata',handlerLoadedMetaDataListener);videoMrzAcquire.removeEventListener('play',handlerPlayListener);videoMrzAcquire.addEventListener('play',handlerPlayListener,0);var constraints={video:{facingMode:'environment',width:window.innerHeight<window.innerWidth?{min:640,ideal:1920}:{min:400,ideal:1080},height:window.innerHeight<window.innerWidth?{min:400,ideal:1080}:{min:640,ideal:1920},aspectRatio:window.innerHeight<window.innerWidth?16/9:9/16}};if(typeof navigator.mediaDevices!='undefined'){await navigator.mediaDevices.getUserMedia(constraints).then((stream)=>{videoMrzAcquire.srcObject=stream}).catch(function(error){console.log("Something went wrong!")})} 985$('#result').val('');$('.loading').css('opacity','0')} 986function handleResult(result){console.warn(result);var birthdate=result.dob.split('/');$('#birthdate_d').val(birthdate[0]);$('#birthdate_m').val(birthdate[1]);$('#birthdate_y').val(birthdate[2]).trigger('change');$('#name').val(result.names.firstName).trigger('change');$('#surname').val(result.names.lastName).trigger('change');if(result.names.lastName1){$('#surname').val(result.names.lastName1).trigger('change')} 987if($('#surname2').length>0&&result.names.lastName2){$('#surname2').val(result.names.lastName2).trigger('change')} 988$('#sex').attr('value',result.sex.abbr);$('#sex').val(result.sex.abbr).trigger('change');var cod_personal_doc_type='';if(result.documentCode=='P'){cod_personal_doc_type='PASOR'} 989if(result.documentCode=='C'||result.documentCode=='I'){cod_personal_doc_type='IDENT'} 990$('#cod_personal_doc_type option[value="'+cod_personal_doc_type+'"]').attr('selected','selected').trigger('change');$('#number_document').val(result.documentNumber).trigger('change');var isos=JSON.parse(getCountry(result.nationality.abbr,result.issuerOrg.abbr,BASE_PATH+'/guest/get-country-from-iso3'),!0);$('#cod_citizenship').val(isos.citizenship.cod_country).trigger('change');if($('#release_place_country').length>0&&isos.release.cod_country){$('#release_place_country').val(isos.release.cod_country).trigger('change')} 991$('#mrzAlert').hide();gpCheckinDataEnableSubmit();gpMrzStopAndClose()} 992function startMrz(ts){if(!ts)ts=1000;setTimeout(function(){mrzcount++;$('#mrz_status').addClass('bg-info').removeClass('bg-danger');$.post('https://mrz.krbo.eu/camera/mrz.php?hid='+HOTEL_ID_QUERY+'&otp=156578&df=ymd',{'photo':canvasMrzAcquire.toDataURL()}).fail(function(){$('#mrz_status').addClass('bg-danger').removeClass('bg-info');$('#mrzAlert').show();if(mrzcount>9){if(videoMrzAcquire.srcObject!=null){stopMrz()} 993$('#result').replaceWith('Cannot read MRZ')}else startMrz(1000)}).done(function(data){if(data.mrz){ajaxBind();$('#mrz_status').addClass('bg-info').removeClass('bg-danger');handleResult(JSON.parse(data.mrz));if(videoMrzAcquire.srcObject!=null){stopMrz()}}else{$('#mrz_status').addClass('bg-danger').removeClass('bg-info');$('#mrzAlert').show();if(mrzcount>9){if(videoMrzAcquire.srcObject!=null){stopMrz()} 994$('#result').replaceWith('Cannot read MRZ')}else startMrz(1000)}})},ts)} 995function stopMrz(){videoMrzAcquire.srcObject.getVideoTracks().forEac
995h(track=>track.stop());videoMrzAcquire.srcObject=null;$('#videoMrzAcquireCnt').html('');$('#canvasMrzAcquireCnt').html('');$('.sendToOcr').hide();$('.noread').css('display','flex')} 996function getCountry(citizenship,release,url){var ret=null;$(".loading").show();$.ajax({url:url,data:{citizenship:citizenship,release:release},type:'get',async:!1,success:function(data){ret=data;$(".loading").hide()}});return ret};function gpSelectAndUpload(tag,id,type){gpLog('gpCheckinDocRearSubmit',{tag,id,type});var backtorecap=$('#backtorecap').val();$(".loading").hide();var acceptedFiles;if(type=='s'){acceptedFiles='image/jpeg, image/jpg, image/png, image/heic'}else{acceptedFiles='image/jpeg, image/jpg, image/png, image/heic, application/pdf'} 997var dropDoc=$('#dropDoc'+type+id);if(!dropDoc.length)return;var existingDz=dropDoc[0].dropzone;if(existingDz){if(existingDz.hiddenFileInput){existingDz.hiddenFileInput.click()} 998return} 999Dropzone.autoDiscover=!1;var dz=new Dropzone(dropDoc[0],{url:BASE_PATH+'/guest/upload-checkin?ajax=true&tag='+tag+'&type='+type+'&id='+id+'&step='+gpCheckinStepFromType(type)+'&backtorecap='+backtorecap,paramName:"file",maxFilesize:8,acceptedFiles:acceptedFiles,dictDefaultMessage:'File upload',init:function(){this.on('addedfile',function(file){$('.loading').show()});this.on('success',function(file,response){if(response=='ok'){gpCheckinClose();if(typeof gpCheckinMarkOk!='undefined')gpCheckinMarkOk(id,type)}else{$('#guest-informations').html(response);$('.loading').hide()}});this.on('error',function(file,errorMessage){console.log(file,errorMessage);$(".loading").hide();if(file&&file.accepted===!1){alert('Cannot upload this file. Please select images or PDF documents only, with max size 8 Mb.')}else{alert('An error occurred, please try again. If this error persists, contact the host.')}})},renameFilename:function(filename){var name=filename||'';var lastDot=name.lastIndexOf('.');var fileName=lastDot!==-1?name.substring(0,lastDot):name;var extension=lastDot!==-1?name.substring(lastDot):'';var sanitizedName=fileName.replace(/\s+/g,'_').replace(/[^A-Za-z0-9_-]/g,'');if(sanitizedName.length==0){sanitizedName='file'} 1000var sanitizedExtension=extension.replace(/[^A-Za-z0-9.]/g,'');return sanitizedName+sanitizedExtension}});dz.hiddenFileInput.click()} 1001function gpCheckinStepFromType(type){gpLog('gpCheckinStepFromType',{type});switch(type){case 'f':return 'docfront';case 'r':return 'docrear';case 's':return 'selfie';default:return ''}} 1002var cameraContainerType;function gpTakePicture(type){cameraContainerType=type;$('#camera-container').removeClass('d-none');$('#main-document-container').addClass('d-none');if(typeof cameraContainerType!='undefined'){$('#camera-container .video-label').removeClass('d-flex');$('#camera-container .video-label').addClass('d-none');$('#camera-container .upload-button').removeClass('d-flex');$('#camera-container .upload-button').addClass('d-none');$('#camera-container .upload-selfie-help').hide();if(cameraContainerType=='s'){$('#camera-container .video-label-selfie').addClass('d-flex');$('#camera-container .video-label-selfie').removeClass('d-none');$('#camera-container .upload-selfie-help').show()}else{$('#camera-container .video-label-doc').addClass('d-flex');$('#camera-container .video-label-doc').removeClass('d-none');$('#camera-container .upload-button').addClass('d-flex');$('#camera-container .upload-button').removeClass('d-none')}} 1003gpCameraStart()} 1004var videoAcquire;var canvasAcquire;async function gpCameraStart(){videoAcquire=document.querySelector("#videoAcquire");canvasAcquire=document.querySelector("#canvasAcquire");var constraints;if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge|maemo|midp|mmp|netfront|opera m(ob|in)i|palm(os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp(i|ip)|hs\-c|ht(c(\-||_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac(|\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
1004sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))){var facingMode;if(cameraContainerType=='s'){facingMode='user'}else{facingMode='environment'} 1005constraints={video:{width:{ideal:1920},height:{ideal:1920},facingMode:{exact:facingMode}},audio:!1} 1006$('#videoAcquire').css('width','100%').css('height','auto');$('#canvasAcquire').attr('width','1920px').attr('height','1920px')}else{constraints={video:{width:{ideal:1920},height:{ideal:1080},},audio:!1};$('#videoAcquire').css('width','50%')} 1007if(typeof navigator.mediaDevices!='undefined'){await navigator.mediaDevices.getUserMedia(constraints).then((stream)=>{videoAcquire.srcObject=stream}).catch((error)=>{alert('Unable to find a camera. Please check your hardware and permissions, and try again');console.error(error);gpCameraStop();if(cameraContainerType=='f'&&typeof gpCheckinDocFrontModalOpen!='undefined'){setTimeout(()=>{gpCheckinDocFrontModalOpen(gpCheckinGuestId)},300)} 1008if(cameraContainerType=='r'&&typeof gpCheckinDocRearModalOpen!='undefined'){setTimeout(()=>{gpCheckinDocRearModalOpen(gpCheckinGuestId)},300)} 1009if(cameraContainerType=='s'&&typeof gpCheckinSelfieModalOpen!='undefined'){setTimeout(()=>{gpCheckinSelfieModalOpen(gpCheckinGuestId,!0)},300)}})}else{$('#video-overlay').removeClass('d-none').addClass('d-flex');$('#video-overlay').css('top',$('#videoAcquire').offset().top).css('left',$('#videoAcquire').offset().left).css('height',$('#videoAcquire').height()).css('width',$('#videoAcquire').width())}} 1010function gpCameraStop(){if(videoAcquire!=null&&videoAcquire.srcObject!=null&&typeof videoAcquire.srcObject!='undefined'){videoAcquire.srcObject.getVideoTracks().forEach(track=>track.stop())} 1011$('#camera-button').removeClass('d-none');$('.upload-button').removeClass('d-none').addClass('d-flex');$('#videoAcquire').removeClass('d-none');$('#picture-buttons').addClass('d-none').removeClass('d-flex');$('#camera-container').addClass('d-none');$('#main-document-container').removeClass('d-none');$('#pictureAcquired').html('').addClass('d-none')} 1012var image_data_url;function gpCameraAcquire(){if(canvasAcquire!=null&&videoAcquire!=null&&videoAcquire.srcObject!=null&&typeof videoAcquire.srcObject!='undefined'){canvasAcquire.getContext('2d').drawImage(videoAcquire,0,0,canvasAcquire.width,canvasAcquire.height);image_data_url=canvasAcquire.toDataURL('image/jpeg');$('#pictureAcquired').removeClass('d-none').html('').append('<img class="img-fluid" src="'+image_data_url+'" style="border-radius: 8px">');videoAcquire.srcObject.getVideoTracks().forEach(track=>track.stop())}else{$('#pictureAcquired').removeClass('d-none')} 1013$('.video-label').removeClass('d-flex').addClass('d-none');$('#videoAcquire').addClass('d-none');$('#picture-buttons').removeClass('d-none').addClass('d-flex');$('#camera-button').addClass('d-none');$('.upload-button').addClass('d-none').removeClass('d-flex');$('#video-overlay').addClass('d-none').removeClass('d-flex')};function gpCameraRetry(){if(typeof cameraContainerType!='undefined'){if(cameraContainerType=='s'){$('#camera-container .video-label-selfie').addClass('d-flex');$('#camera-container .video-label-selfie').removeClass('d-none')}else{$('#camera-container .video-label-doc').addClass('d-flex');$('#camera-container .video-label-doc').removeClass('d-none');$('#camera-container .upload-button').addClass('d-flex');$('#camera-container .upload-button').removeClass('d-none')}} 1014$('#camera-container').removeClass('d-none');$('#camera-button').removeClass('d-none');$('#videoAcquire').removeClass('d-none');$('#picture-buttons').addClass('d-none').removeClass('d-flex');$('#pictureAcquired').html('').addClass('d-none');gpCameraStart()};function gpCameraUpload(tag,id,type){gpLog('gpCameraUpload',{tag,id,type,image_data_url});var backtorecap=$('#backtorecap').val();$(".loading").show();$.ajax({type:'POST',url:BASE_PATH+'/guest/upload-checkin?ajax=true&tag='+tag+'&type='+type+'&id='+id+'&step='+gpCheckinStepFromType(type)+'&backtorecap='+backtorecap,data:{b64:image_data_url},error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},success:function(response){videoAcquire.srcObject.getVideoTracks().forEac
1014h(track=>track.stop());if(response=='ok'){gpCheckinClose();if(typeof gpCheckinMarkOk!='undefined'){gpCheckinMarkOk(id,type)}}else{$('#guest-informations').html(response);$('.loading').hide()}}})};function gpCheckinDataVisible(fld,rules){gpLog('gpCheckinDataVisible',{fld,rules});var show=!1;var fldval='';if($('#'+fld+'cnt').attr('data-field-type')=='date_full'){var day=$('#'+fld+'_d').val();var mon=$('#'+fld+'_m').val();var yea=$('#'+fld+'_y').val();if(day!=''&&mon!=''&&yea!=''){fldval=yea+'-'+mon+'-'+day}}else{fldval=$('#'+fld).val()} 1015console.log({fld:fld,type:$('#'+fld+'cnt').attr('data-field-type'),fldval:fldval});for(fld_mod in rules){var rule=rules[fld_mod];var cond=!1;if(rule.op=='=='){cond=(fldval==rule.val)} 1016if(rule.op!='=='){cond=(fldval!=rule.val)} 1017if(rule.op=='!='){cond=(fldval!=rule.val)} 1018if(rule.op=='>='){cond=(fldval>=rule.val)} 1019if(rule.op=='<='){cond=(fldval<=rule.val)} 1020if(rule.op=='cb'){cond=window[rule.val]()} 1021if(cond){$('#'+fld_mod+'cnt').show()}else{$('#'+fld_mod+'cnt').hide();if($('#'+fld_mod).hasClass('select2-hidden-accessible')){$('#'+fld_mod).val([]).trigger('change')}else{$('#'+fld_mod).val('').trigger('change')}}} 1022if(typeof gpCheckinDataPageVisibilityCheck!='undefined'){gpCheckinDataPageVisibilityCheck()}} 1023function isLeapYear(year){year=parseInt(year);if(year%4===0&&(year%100!==0||year%400===0)){return!0}else{return!1}} 1024function gpCheckinDataDateCheck(fld){gpLog('gpCheckinDataDateCheck',{fld});var day=$('#'+fld+'_d').val();var mon=$('#'+fld+'_m').val();var yea=$('#'+fld+'_y').val();$('#'+fld+'_d option').removeAttr('disabled') 1025$('#'+fld+'_m option').removeAttr('disabled') 1026$('#'+fld+'_y option').removeAttr('disabled') 1027if(day=='29'&&yea!=''&&!isLeapYear(yea)){$('#'+fld+'_m option[value="02"]').attr('disabled','disabled')} 1028if(day=='30'){$('#'+fld+'_m option[value="02"]').attr('disabled','disabled')} 1029if(day=='31'){$('#'+fld+'_m option[value="02"]').attr('disabled','disabled') 1030$('#'+fld+'_m option[value="04"]').attr('disabled','disabled') 1031$('#'+fld+'_m option[value="06"]').attr('disabled','disabled') 1032$('#'+fld+'_m option[value="09"]').attr('disabled','disabled') 1033$('#'+fld+'_m option[value="11"]').attr('disabled','disabled')} 1034if(mon=='02'){if(yea!=''&&!isLeapYear(yea)){$('#'+fld+'_d option[value="29"]').attr('disabled','disabled')} 1035$('#'+fld+'_d option[value="30"]').attr('disabled','disabled') 1036$('#'+fld+'_d option[value="31"]').attr('disabled','disabled')} 1037if(mon=='04'||mon=='06'||mon=='09'||mon=='11'){$('#'+fld+'_d option[value="31"]').attr('disabled','disabled')} 1038if(day=='29'&&mon=='02'){for(y=1920;y<2050;y++){if(!isLeapYear(y)){$('#'+fld+'_y option[value="'+y+'"]').attr('disabled','disabled')}}} 1039var today=new Date();var currDay=today.getDate();var currMonth=today.getMonth()+1;var currYear=today.getFullYear();var maxDateAttr=$('#'+fld+'cnt').attr('data-max-date');if(maxDateAttr){var parts=maxDateAttr.split('-');if(parts.length===3){currYear=parseInt(parts[0],10);currMonth=parseInt(parts[1],10);currDay=parseInt(parts[2],10)}} 1040for(var y=currYear+1;y<=2050;y++){$('#'+fld+'_y option[value="'+y+'"]').remove()} 1041if(yea==currYear){if(mon==currMonth){for(var d=currDay+1;d<=31;d++){var dStr=d<10?'0'+d:''+d;$('#'+fld+'_d option[value="'+dStr+'"]').attr('disabled','disabled')}} 1042for(var m=currMonth+1;m<=12;m++){var mStr=m<10?'0'+m:''+m;$('#'+fld+'_m option[value="'+mStr+'"]').attr('disabled','disabled')} 1043if(day>currDay){var currMonthStr=currMonth<10?'0'+currMonth:''+currMonth;$('#'+fld+'_m option[value="'+currMonthStr+'"]').attr('disabled','disabled')}} 1044if(mon>currMonth||mon==currMonth&&day>currDay){$('#'+fld+'_y option[value="'+currYear+'"]').attr('disabled','disabled')}} 1045function isLocal(cod){return cod==room_cod_country_code} 1046function isEU(cod){switch(cod){case '100000203':case '100000206':case '100000209':case '100000315':case '100000246':case '100000250':case '100000212':case '100000247':case '100000214':case '100000215':case '100000216':case '100000220':case '100000221':case '100000223':case '100000100':case '100000248':case '100000225':case '100000249':case '100000226':case '100000227':case '100000229':case '100000231':case '100000232':case '100000233':case '100000234':case '100000257':case '100000255':case '100000235':case '100000236':case '100000251':case '100000239':case '100000240':case '100000241':case '100000244':return!0;break;case '100000202':return room_cod_country_code=='es';break;default:return!1;break}} 1047function gpDocTypeByCitizenship(){var docs=[];var cod_citizenship='';if($('#cod_citizenship').length>0){cod_citizenship=$('#cod_citizenship').val()}else if($('#cod_country').length>0){cod_citizenship=$('#cod_country').val()} 1048if(isLocal(cod_citizenship)){if(docsLocal.length>0){docs=docsLocal}else{docs=docsDefLocal}}else if(isEU(cod_citizenship)){if(docsUe.length>0){docs=docsUe}else{docs=docsDefUe}}else{if(docsExtraUe.length>0){docs=docsExtraUe}else{docs=docsDefExtraUe}} 1049$('#cod_personal_doc_type option').hide();$('#cod_personal_doc_type option').attr('disabled','disabled');$('#cod_personal_doc_type option[value=""]').show();$('#cod_personal_doc_type option[value=""]').removeAttr('disabled');for(var i in docs){$('#cod_personal_doc_type option[value="'+docs[i]+'"]').show();$('#cod_personal_doc_type option[value="'+docs[i]+'"]').removeAttr('disabled')}};function gpRuleCbSoporte(){var day=$('#birthdate_d').val();var mon=$('#birthdate_m').val();var yea=$('#birthdate_y').val();if(typeof day=='undefined'||typeof mon=='undefined'||typeof yea=='undefined'){return!1} 1050var date;if(day!=''&&mon!=''&&yea!=''){date=yea+'-'+mon+'-'+day}else{return!1} 1051var maggiorenne=moment(date)<moment().subtract('14','years');if(!maggiorenne){return!1} 1052var cod_citizenship=$('#cod_citizenship').val();var residenza_country=$('#residenza_country').val();var cod_personal_doc_type=$('#cod_personal_doc_type').val();if(typeof cod_citizenship=='undefined'||typeof residenza_country=='undefined'||typeof cod_personal_doc_type=='undefined'){return!1} 1053return(cod_citizenship=='100000239'&&cod_personal_doc_type=='IDENT')||cod_personal_doc_type=='PRMES'};function gpChecklistQuestionValidation(elem){if(elem.attr('data-disabled')=='0'&&elem.attr('data-required')=='1'){switch(elem.attr('data-type')){case 'FOTO':case 'TEXT':var val=elem.find('input').val();val=val.trim();if(val.length==0){return!1} 1054return!0;case 'SELECT':var val=elem.find('select').val();if(val.length==0){return!1} 1055return!0;case 'BOOL':case 'MULTI':var chk=elem.find('input');var checked=0;chk.each(function(){if($(this).prop('checked')){checked++}}) 1056if(checked==0){return!1} 1057return!0;default:return!0}} 1058return!0};function gpExtraPayAlert(gpToPay){var gpShowAlert=!1;$('.qt-service').each(function(){if(parseInt($(this).val())){if(gpToPay){gpShowAlert=!0}else{var pr=parseFloat(parseFloat($(this).val())*parseFloat($(this).attr('data-price')));if(pr>0){gpShowAlert=!0}}}});if(gpShowAlert){$('#gpPayAlert').slideDown()}else{$('#gpPayAlert').slideUp()}};function gpValidateEmail(text){return/^(?:[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/.test(text)} 1059function gpValidateCfIta(text){return/^\d{11}$/.test(text)||/^(?:[A-Z][AEIOUX][AEIOUX]|[B-DF-HJ-NP-TV-Z]{2}[A-Z]){2}(?:[\dLMNP-V]{2}(?:[A-EHLMPR-T](?:[04LQ][1-9MNP-V]|[15MR][\dLMNP-V]|[26NS][0-8LMNP-U])|[DHPS][37PT][0L]|[ACELMRT][37PT][01LM]|[AC-EHLMPR-T][26NS][9V])|(?:[02468LNQSU][048LQU]|[13579MPRTV][26NS])B[26NS][9V])(?:[A-MZ][1-9MNP-V][\dLMNP-V]{2}|[A-M][0L](?:[1-9MNP-V][\dLMNP-V]|[0L][1-9MNP-V]))[A-Z]$/i.test(text)} 1060function gpValidateIdentityCard(country_code,text){switch(country_code){case '100000100':return!0;case '100000239':if(!/^[0-9]{8}[A-Z]$/i.test(text)){return!1} 1061var idChars='TRWAGMYFPDXBNJZSQVHLCKE';var idNumber=text.substring(0,8);var expectedChar=idChars[parseInt(idNumber)%23];return text.charAt(8).toUpperCase()===expectedChar;default:return!0}} 1062function gpValidateVISA(country_code,text){switch(country_code){case '100000239':if(!/^[XYZ][0-9]{7}[A-Z]$/i.test(text)){return!1} 1063var nieChars='TRWAGMYFPDXBNJZSQVHLCKE';var nieNumber=text.substring(0,8).replace(/[XYZ]/i,function(c){return c.toUpperCase()==='X'?'0':c.toUpperCase()==='Y'?'1':'2'});var expectedChar=nieChars[parseInt(nieNumber)%23];return text.charAt(8).toUpperCase()===expectedChar;default:return!0}} 1064function gpValidateSoporte(text){return/^([A-Z]{3}[0-9]{6}|E[0-9]{8})$/i.test(text)} 1065function gpValidateVatCountryCode(country_code,text){var vat_prefixes={'100000203':'AT','100000206':'BE','100000209':'BG','100000250':'HR','100000315':'CY','100000257':'CZ','100000216':'DE','100000212':'DK','100000247':'EE','100000220':['EL','GR'],'100000239':'ES','100000214':'FI','100000215':'FR','100000219':['GB','XI'],'100000244':'HU','100000221':'IE','100000100':'IT','100000249':'LT','100000226':'LU','100000248':'LV','100000227':'MT','100000232':'NL','100000233':'PL','100000234':'PT','100000235':'RO','100000240':'SE','100000251':'SI','100000255':'SK'};
1065if(typeof vat_prefixes[country_code]=='undefined'){return!0} 1066var prefix=String(text).substring(0,2).toUpperCase();return[].concat(vat_prefixes[country_code]).indexOf(prefix)!==-1} 1067function gpValidateVat(country_code,text){if(HOTEL_ID_QUERY=='airus'){if(!gpValidateVatCountryCode(country_code,text)){return!1} 1068text=text.substring(2)} 1069switch(country_code){case '100000203':return/^U[0-9]{8}$/.test(text);case '100000206':return/^[01][0-9]{9}$/.test(text);case '100000209':return/^[0-9]{9,10}$/.test(text);case '100000250':return/^[0-9]{11}$/.test(text);case '100000315':return/^[0-9]{8}[A-Z]$/.test(text);case '100000257':return/^[0-9]{8,10}$/.test(text);case '100000216':return/^[0-9]{9}$/.test(text);case '100000212':return/^[0-9]{8}$/.test(text);case '100000247':return/^[0-9]{9}$/.test(text);case '100000220':return/^[0-9]{9}$/.test(text);case '100000239':return/^[A-Z0-9][0-9]{7}[A-Z0-9]$/.test(text);case '100000214':return/^[0-9]{8}$/.test(text);case '100000215':return/^[0-9A-Z]{2}[0-9]{9}$/.test(text);case '100000219':return/^([0-9]{9}([0-9]{3})?|GD[0-4][0-9]{2}|HA[5-9][0-9]{2})$/.test(text);case '100000244':return/^[0-9]{8}$/.test(text);case '100000221':return/^([0-9]{7}[A-W]|[0-9][A-Z+*][0-9]{5}[A-W]|[0-9]{7}[A-W][AH])$/.test(text);case '100000100':return/^[0-9]{11}$/.test(text);case '100000249':return/^([0-9]{9}|[0-9]{12})$/.test(text);case '100000226':return/^[0-9]{8}$/.test(text);case '100000248':return/^[0-9]{11}$/.test(text);case '100000227':return/^[0-9]{8}$/.test(text);case '100000232':return/^[0-9]{9}B[0-9]{2}$/.test(text);case '100000233':return/^[0-9]{10}$/.test(text);case '100000234':return/^[0-9]{9}$/.test(text);case '100000235':return/^[0-9]{2,10}$/.test(text);case '100000240':return/^[0-9]{12}$/.test(text);case '100000251':return/^[0-9]{8}$/.test(text);case '100000255':return/^[0-9]{10}$/.test(text);default:return!0}};var gpVer=1;function gpPageOpen(tag,step,params){if(typeof step=='undefined'){step=''} 1070if(typeof params=='undefined'){params={}} 1071var data={'tag':tag,'step':step};for(i in params){data[i]=params[i]} 1072$(".loading").show();$.ajax({type:'POST',url:BASE_PATH+'/guest/get-step?ajax=true',data:data,error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){$('#guest-portal-page').html(data);$(".loading").hide()}})};function gpPreviousStep(){if($('#gpStep').val()=='welcome'){return} 1073$(".loading").show();$.ajax({type:"POST",url:BASE_PATH+'/guest/previous-step?ajax=true',data:{current:$('#gpStep').val(),tag:$('#gpTag').val()},error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){$('#guest-portal-page').html(data);$(".loading").hide();$('html, body').animate({scrollTop:0},600)}})} 1074function gpConditionsValid(){if($('#email').length>0){if($('#email').attr('required')=='required'&&$('#email').val().length==0){return!1} 1075if($('#email').val().length>0){var email=$('#email').val();var validEmail=/^(?:[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/.test(email);var otaEmail=/(@guest.booking.com|@guest.airbnb.com|expediapartnercentral.com)$/.test(email) 1076var acceptedEmail=validEmail&&!otaEmail;if(!acceptedEmail){return!1}}} 1077if($('#phone').length>0){if($('#phone').attr('required')=='required'&&$('#phone').val().length==0){return!1} 1078if($('#phone').val().length>0){var phone=$('#phone').val().match(/(9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)\d{1,14}$/);var acceptedPhone=phone 1079if(!acceptedPhone){return!1}}} 1080if(!$('#termsconditions').prop('checked')){return!1} 1081if($('#termsconditions2').length>0&&!$('#termsconditions2').prop('checked')){return!1} 1082return!0} 1083function gpConditionsEnableSubmit(){gpConditionsValid()?gpSubmitEnable():gpSubmitDisable();return!1} 1084function gpConditionsSubmit(){if(gpConditionsValid()){$(".loading").show();$.ajax({type:"POST",url:$('#formContacts').attr('data-action')+'?ajax=true',data:$('#formContacts').seri
1084alize(),error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){$('#guest-portal-page').html(data);$('.loading').hide();$('html, body').animate({scrollTop:0},600)}})}} 1085function gpArrivalValid(){if($('#id_motivo_viaggio').length>0&&$('#id_motivo_viaggio').val()==''){return!1} 1086if($('#arrival_time').val()==''){return!1} 1087if($('#departure_time').length>0&&$('#departure_time').val()==''){return!1} 1088return!0} 1089var gpArrivalRequired=!0;function gpArrivalEnableSubmit(){if(gpArrivalRequired){gpArrivalValid()?gpSubmitEnable():gpSubmitDisable()}else{gpSubmitEnable()} 1090return!1} 1091function gpArrivalSubmit(){if(!gpArrivalRequired||gpArrivalValid()){$(".loading").show();$.ajax({type:"POST",url:$('#formArrival').attr('data-action')+'?ajax=true',data:$('#formArrival').serialize(),error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){if(data=='ok'){gpPageClose()}else{$('#guest-portal-page').html(data);$('.loading').hide();$('html, body').animate({scrollTop:0},600)}}})}} 1092function gpCheckinValid(){gpLog('gpCheckinValid',{});if($('.guestportal-guest[data-index=11] .checkInFormBtn:first-of-type').hasClass('btn-inverse')){$('.checkInFormBtn.btn-inverse').addClass('disabled disabled-no-main-guest-data');$('.checkInInfoNoMainGuestData').show();$('.guestportal-guest[data-index=11] .checkInFormBtn.btn-inverse').removeClass('disabled disabled-no-main-guest-data')}else{$('.checkInInfoNoMainGuestData').hide();$('.checkInFormBtn.disabled-no-main-guest-data').removeClass('disabled disabled-no-main-guest-data')} 1093if($('.guest-data-buttons .btn-inverse[data-required=1]').length>0){return!1} 1094var valido=!0;$('select.numguests').each(function(){if($(this).attr('required')&&$(this).val()==''){valido=!1;return}}) 1095return valido} 1096function gpCheckinEnableSubmit(){gpLog('gpCheckinEnableSubmit',{});gpCheckinValid()?gpSubmitEnable():gpSubmitDisable();return!1} 1097function gpCheckinSubmit(){gpLog('gpCheckinSubmit',{});if(gpCheckinValid()){$(".loading").show();$.ajax({type:"POST",url:$('#formCheckin').attr('data-action')+'?ajax=true',data:$('#formCheckin').serialize(),error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){if(data=='ok'){gpPageClose()}else{$('#guest-portal-page').html(data);$('.loading').hide();$('html, body').animate({scrollTop:0},600)}}})}} 1098function gpChecklistValid(){var valido=!0;$('.checklist_question').each(function(){if(!gpChecklistQuestionValidation($(this))){valido=!1;return}}) 1099return valido} 1100function gpChecklistEnableSubmit(){gpChecklistValid()?gpSubmitEnable():gpSubmitDisable();return!1} 1101function gpChecklistSubmit(){if(gpChecklistValid()){$(".loading").show();var formData=new FormData($('#formChecklist')[0]);$.ajax({type:"POST",url:$('#formChecklist').attr('data-action')+'?ajax=true',data:formData,contentType:!1,processData:!1,error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){if(data=='ok'){gpPageClose()}else{$('#guest-portal-page').html(data);$('.loading').hide();$('html, body').animate({scrollTop:0},600)}}})}} 1102function gpExtraValid(){return!0} 1103function gpExtraEnableSubmit(){gpExtraValid()?gpSubmitEnable():gpSubmitDisable();return!1} 1104function gpExtraSubmit(){$(".loading").show();$.ajax({type:"POST",url:$('#formExtra').attr('data-action')+'?ajax=true',data:$('#formExtra').serialize(),error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){if(data=='ok'){gpPageClose()}else{$('#guest-portal-page').html(data);$('.loading').hide();$('html, body').animate({scrollTop:0},600)}}})} 1105var gpInvoiceRequired=!0;function gpInvoiceValid(){var valido=!0;if($('#cod_user_typeMAIN').prop('checked')){return valido} 1106var formVuoto=!0;$('#formInvoice input[type!=checkbox]').each(function(){if($(this).is(':visible')&&$(this).val().length>0){formVuoto=!1} 1107if($(this).is(':visible')&&($(this).attr('id')=='pecfe'||$(this).attr('id')=='cufe')&&$('#pecfe').val().length==0&&$('#cufe').val().length==0){valido=!1;return} 1108if($(this).is(':visible')&&$(this).attr('id')=='cf'&&$('#country').val().length>0&&$('#country').val()=='100000100'){var cf=$(this).val();if(/^\d/.test(cf)){if(cf.length!=11){valido=!1;return}}else{if(cf.length!=16){valido=!1;return}}} 1109if($(this).is(':visible')&&$(this).attr('required')=='required'&&$(this).val().length==0){valido=!1;return}}) 1110$('#formInvoice select').each(function(){if($(this).is(':visible')&&$(this).val().length>0){formVuoto=!1} 1111if($(this).is(':visible')&&$(this).attr('required')=='required'&&($(this).val()==null||$(this).val().length==0)){valido=!1;return}}) 1112return valido||(!gpInvoiceRequired&&formVuoto)} 1113function gpInvoiceEnableSubmit(){gpInvoiceValid()?gpSubmitEnable():gpSubmitDisable();return!1} 1114function gpInvoiceSubmit(){$(".loading").show();$.ajax({type:"POST",url:$('#formInvoice').attr('data-action')+'?ajax=true',data:$('#formInvoice').serialize(),error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){if(data=='ok'){gpPageClose()}else{$('#guest-portal-page').html(data);$('.loading').hide();$('html, body').animate({scrollTop:0},600)}}})} 1115function gpContractValid(){var allSigned=!0;$('.blksignature').each(function(){var isSigned=$(this).attr('data-signed')=="1";var isChecked=$(this).find('.signed-chk').length>0&&$(this).find('.signed-chk').prop('checked');if(!isSigned&&!isChecked){allSigned=!1}});return allSigned} 1116function gpContractEnableSubmit(){gpContractValid()?gpSubmitEnable():gpSubmitDisable();return!1} 1117function gpContractSubmit(){if(gpContractValid()){$(".loading").show();$.ajax({type:"POST",url:$('#formContract').attr('data-action')+'?ajax=true',data:$('#formContract').serialize(),error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){if(data=='ok'){gpPageClose()}else{$('#guest-portal-page').html(data);$('.loading').hide();$('html, body').animate({scrollTop:0},600)}}})}} 1118function gpDepositValid(){var valido=!0;$('#formDeposit input[type!=checkbox]').each(function(){if($(this).is(':visible')&&$(this).attr('required')=='required'&&$(this).val().length==0){valido=!1;return}}) 1119return valido} 1120function gpDepositEnableSubmit(){gpDepositValid()?gpSubmitEnable():gpSubmitDisable();return!1} 1121function gpDepositSubmit(){if(gpDepositValid()){$(".loading").show();$.ajax({type:"POST",url:$('#formDeposit').attr('data-action')+'?ajax=true',data:$('#formDeposit').serialize(),error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){if(data=='ok'){gpPageClose()}else{$('#guest-portal-page').html(data);$('.loading').hide();$('html, body').animate({scrollTop:0},600)}}})}} 1122function gpPaymentValid(){if($('.alert-no-method').length>0){return!1} 1123var valido=!0;if($('.checkpaycharge').length>0&&$('.checkpaycharge:checked').length==0){return valido} 1124$('#formPayment input[type!=checkbox]').each(function(){if($(this).attr('id')=='metodo_pagamento'&&$('#formPayment input[type=radio]').length>0&&$(this).val().length==0){valido=!1;return} 1125if($(this).attr('name').substr(0,3)=='cc_'&&$(this).val().length==0&&$('#metodo_pagamento').val()=='cc'){valido=!1;return} 1126if($(this).attr('name')=='cc_number'&&$('#metodo_pagamento').val()=='cc'){if($(this).val().length==0){valido=!1;return} 1127var res=ccValid(this);if(!res){valido=!1;return}} 1128if($(this).attr('name')=='cc_expiration_date'&&$('#metodo_pagamento').val()=='cc'){if($(this).val().length!=5){valido=!1;return} 1129const[month,year]=$(this).val().split('/');const inputDate=new Date(`20${year}`,month-1,1);inputDate.setMonth(inputDate.getMonth()+1);const currentDate=new Date();if(inputDate<currentDate){valido=!1;return}}}) 1130return valido} 1131function gpPaymentEnableSubmit(){gpPaymentValid()?gpSubmitEnable():gpSubmitDisable();return!1} 1132function gpPaymentSubmit(){if(gpPaymentValid()){$(".loading").show();if($('#formPayment input[type=radio]').length>0&&['bb','cc','nopay','paycash'].indexOf($('#metodo_pagamento').val())==-1){if($('.checkpaycharge').length>0){$.ajax({type:"POST",url:$('#formPayment').attr('data-action')+'?ajax=true',data:$('#formPayment').serialize(),error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){gpPayment()}})}else{gpPayment()}}else{$.ajax({type:"POST",url:$('#formPayment').attr('data-action')+'?ajax=true',data:$('#formPayment').serialize(),error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){if(data=='ok'){gpPageClose()}else{$('#guest-portal-page').html(data);$('.loading').hide()}}})}}} 1133function gpPaymentToggleCharge(){if($('.checkpaycharge').length>0){var tot=0;$('.checkpaycharge').each(function(){if($(this).prop('checked')){tot+=parseFloat($(this).attr('data-amount'))}}) 1134$('#schedule-total').html(pr(tot));if(tot==0){$('#form-payments-container').slideUp();$('input[name=mp_pay]:checked').prop('checked',!1).trigger('change');$('#metodo_pagamento').val('')}else{$('#form-payments-container').slideDown()}}};var gpCheckinDataFullyOpen=!1;function gpCheckinOpen(id){gpLog('gpCheckinOpen',{id});$(".loading").show();
1134$(".btn:not(.disabled)").addClass('disabled disabled-guest');$.ajax({type:'POST',url:BASE_PATH+'/guest/guest-checkin?ajax=true',data:{'tag':$('#gpTag').val(),'id':id},error:function(err){$(".loading").hide();$(".disabled-guest").removeClass('disbled disabled-guest');alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){$(".loading").hide();$('#guest-informations-'+id).html(data);$('#guest-informations-'+id).addClass('guest-informations-open');$('#guest-informations-'+id).slideDown(function(){gpCheckinDataFullyOpen=!0;gpCheckinDataEnableSubmit()});$('#formCheckinData .tab-link').on('shown.bs.tab',function(event){setTimeout(()=>{gpCheckinDataEnableSubmit()},300)})}})} 1135function gpCheckinClose(){gpLog('gpCheckinClose',{});$('.guest-informations-open').slideUp(function(){$(this).removeClass('.guest-informations-open');$(this).html('')});$(".btn.disabled-guest").removeClass('disabled disabled-guest');$("#gpCheckinDocFrontModal").modal('hide');$("#gpCheckinDocRearModal").modal('hide');$("#gpCheckinSelfieModal").modal('hide');$(".loading").hide();gpCameraStop()} 1136function gpCheckinMarkOk(id,type){var elem,text;switch(type){case 'd':elem=$('#btn'+id);text=t('Dati inseriti');break;case 'f':elem=$('#btn-doc-f'+id);text=t('Documento caricato');break;case 'r':elem=$('#btn-doc-r'+id);text=t('Documento caricato');break;case 's':elem=$('#btn-self'+id);text=t('Selfie caricato');break;default:return} 1137elem.html('<div style="position:relative"><div class="btn-mark-tick" style="opacity:0;position:absolute;top:0;left:0;right:0;bottom:0; font-size:1.4em; margin-top:-3px"><i class="fas fa-check" aria-hidden="true"></i></div><span class="btn-mark-text" style="opacity:0"><i class="fas fa-check" aria-hidden="true"></i> '+text+'</span></div>');elem.removeClass('btn-inverse').addClass('btn-success');elem.find('.btn-mark-tick').animate({opacity:1},500,function(){setTimeout(()=>{elem.find('.btn-mark-tick').animate({opacity:0}
1137,500);elem.find('.btn-mark-text').animate({opacity:1},500)},1000)}) 1138gpCheckinEnableSubmit()} 1139function gpCheckinGuestsChange(id_room){var room_div=$('#checkin_room_'+id_room);var num_guests=parseInt($('#num_guests_'+id_room).val());var prev_num_guests=parseInt($('#num_guests_'+id_room).attr('data-sel'));if(confirm(t('js_gp_cambiare numero ospiti?'))){$(".loading").show();$.ajax({type:"POST",url:BASE_PATH+'/guest/save-checkin-num-guests',data:{id_room:id_room,tag:$('#gpTag').val(),num_guests:num_guests},error:function(err){$('#num_guests_'+id_room).val(prev_num_guests);$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){$('#num_guests_'+id_room).find('option').each(function(){if(parseInt($(this).val())>num_guests){$(this).remove()}}) 1140$('#num_guests_'+id_room).attr('data-sel',num_guests);room_div.find('.guestportal-guest').each(function(){if(parseInt($(this).attr('data-roomguest'))>num_guests){$(this).remove()}}) 1141$('.loading').hide();gpCheckinEnableSubmit()}})}else{$('#num_guests_'+id_room).val(prev_num_guests)}} 1142function gpCheckinRoomConfigChange(id_room){$(".loading").show();$.ajax({type:"POST",url:BASE_PATH+'/guest/save-checkin-bed-preference',data:{id_room:id_room,tag:$('#gpTag').val(),cod_configuration:$('#cod_configuration_'+id_room).val()},error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:30000,success:function(data){$('.loading').hide()}})};var gpCheckinGuestId;function gpCheckinDocFrontModalOpen(id,withRear=!1){gpCheckinGuestId=id;$('#formCheckinDocFrontId').val(id);$('#dropDocf').html('');if(!withRear){$('.front-upload-rear').hide()} 1143$('#gpCheckinDocFrontModal').modal('show')} 1144function gpCheckinDocRearModalOpen(id){gpCheckinGuestId=id;$('#formCheckinDocRearId').val(id);$('#dropDocr').html('');$('#gpCheckinDocRearModal').modal('show')} 1145function gpCheckinDataPagePrev(){gpCheckinDataStep--;$('#formCheckinData .tab-link[data-nstep='+gpCheckinDataStep+']').tab('show');gpCheckinDataSubmitShow();gpCheckinDataPageVisibilityCheck();gpCheckinDataSubmitDisable()} 1146function gpCheckinDataPageNext(){gpCheckinDataStep++;$('#formCheckinData .tab-link[data-nstep='+gpCheckinDataStep+']').removeClass('disabled');$('#formCheckinData .tab-link[data-nstep='+gpCheckinDataStep+']').tab('show');$('#gpCheckinBtnPrev').removeClass('disabled');gpCheckinDataSubmitShow();gpCheckinDataPageVisibilityCheck();gpCheckinDataSubmitDisable()} 1147function gpCheckinDataPageGo(page){gpCheckinDataStep=page;if(page>1){$('#gpCheckinBtnPrev').removeClass('disabled')} 1148gpCheckinDataSubmitShow();gpCheckinDataPageVisibilityCheck();gpCheckinDataSubmitDisable()} 1149function gpCheckinDataSubmitShow(){if(gpCheckinDataStep==$('#formCheckinData .tab-link').length){$('#gpCheckinBtnNext').hide();$('#gpCheckinBtnSubmit').show()}else{$('#gpCheckinBtnNext').show();$('#gpCheckinBtnSubmit').hide()}} 1150function gpCheckinDataPageVisibilityCheck(){var visible=!1;$('#formCheckinData .tab-pane[data-nstep='+gpCheckinDataStep+'] .sect-data').each(function(){if($(this).css('display')!='none'){visible=!0}});if(!visible){$('#formCheckinData .tab-pane[data-nstep='+gpCheckinDataStep+'] .sect-no-data').show()}else{$('#formCheckinData .tab-pane[data-nstep='+gpCheckinDataStep+'] .sect-no-data').hide()}} 1151function gpCheckinDataSubmitEnable(){$("#formCheckinData .btn-continue").removeClass('disabled').removeAttr('disabled');return!1} 1152function gpCheckinDataSubmitDisable(){$("#formCheckinData .btn-continue").addClass('disabled').attr('disabled','disabled');return!1} 1153function gpCheckinDataValid(){if(!gpCheckinDataFullyOpen){return!1} 1154gpLog('gpCheckinDataValid',{});var valido=!0;$('#formCheckinData input[type!=checkbox]').each(function(){$(this).removeClass('is-invalid');$(this).removeClass('is-empty');if($(this).is(':visible')&&$(this).attr('required')=='required'&&$(this).val().length==0){$(this).addClass('is-empty');valido=!1;return} 1155if($(this).is(':visible')&&$(this).attr('pattern')!='undefined'&&$(this).val().length>0&&!$(this).val().toUpperCase().match($(this).attr('pattern'))){$(this).addClass('is-invalid');valido=!1;return} 1156if($(this).is(':visible')&&$(this).attr('id')=='number_document'&&$(this).val().length>0){var numeroDocumento=$(this).val();var tipoDocumento=$('#cod_personal_doc_type').val();var country=$('#release_place_country').val();if(typeof country=='undefined'||country.length==0){country=$('#cod_citizenship').val()} 1157var validDocumento1=(tipoDocumento=='IDENT'&&gpValidateIdentityCard(country,numeroDocumento));var validDocumento2=(tipoDocumento=='PRMES'&&gpValidateVISA(room_cod_country_code,numeroDocumento));var validDocumento3=(tipoDocumento!='IDENT'&&tipoDocumento!='PRMES');if(!(validDocumento1||validDocumento2||validDocumento3)){$(this).addClass('is-invalid');valido=!1;return}} 1158if($(this).is(':visible')&&$(this).attr('id')=='soporte_documento'&&$(this).val().length>0){var numeroDocumentoSop=$(this).val();var validDocumentoSop=gpValidateSoporte(numeroDocumentoSop);if(!validDocumentoSop){$(this).addClass('is-invalid');valido=!1;return}}}) 1159$('#formCheckinData input[type=checkbox]').each(function(){if($(this).parent().find('label').is(':visible')&&$(this).attr('required')=='required'&&!$(this).prop('checked')){valido=!1;return}}) 1160$('#formCheckinData select:not(.selectk-initialized)').each(function(){$(this).removeClass('is-invalid');$(this).removeClass('is-empty');if($(this).is(':visible')&&$(this).attr('required')=='required'&&($(this).val()==null||$(this).val().length==0)){$(this).addClass('is-empty');valido=!1;return}}) 1161$('#formCheckinData select.selectk-initialized').each(function(){$(this).removeClass('is-invalid');$(this).removeClass('is-empty');var id=$(this).attr('id');if($('#selectk-'+id).is(':visible')&&$(this).attr('required')=='required'&&($(this).val()==null||$(this).val().length==0)){$(this).addClass('is-empty');valido=!1;return}}) 1162return valido} 1163function gpCheckinDataEnableSubmit(){gpLog('gpCheckinDataEnableSubmit',{});gpCheckinDataValid()?gpCheckinDataSubmitEnable():gpCheckinDataSubmitDisable();return!1} 1164function gpCheckinDataSubmit(){gpLog('gpCheckinDataSubmit',{});if(gpCheckinDataValid()){$(".loading").show();$.ajax({type:"POST",url:$('#formCheckinData').attr('data-action')+'?ajax=true',data:$('#formCheckinData').serialize(),error:function(err){$(".loading").hide();var errMsg=null;if(typeof err.responseText!='undefined'&&err.responseText.length>0){try{var errJson=JSON.parse(err.responseText);if(typeof errJson.error!='undefined'&&errJson.error.length>0){errMsg=errJson.error}}catch(e){}} 1165if(errMsg){alertErrorPublic(errMsg)}else{alertErrorPublic(t('js_gp_errore'))}},timeout:30000,success:function(data){$(".loading").hide();if(data.success=='ok'){gpCheckinClose();gpCheckinMarkOk(data.id,'d')}else if(typeof data.error!='undefined'&&data.error.length>0){alertErrorPublic(data.error)}else{alertErrorPublic(t('js_gp_errore'))}}})}} 1166function gpCheckinSelfieModalOpen(id,upload=!1){gpCheckinGuestId=id;$('#formCheckinSelfieId').val(id);$('#dropDocr').html('');$('#gpCheckinSelfieModal').modal('show');if(upload){$('.upload-button-selfie').show()}};function gpExtraUpdateSummary(){var html='';var totprice=0;$('.qt-service').each(function(){if(parseInt($(this).val())){var price=parseFloat($(this).attr('data-price'));totprice+=price;html+='<div class="clearfix mb-2">'+'<div class="summary-price">'+pr(price)+'</div>'+'<span class="size15">'+$(this).val()+' x '+$(this).attr('data-name')+'</span></div>'}});if(html.length==0){$('#reservation-summary-extra-services').slide
1166Up(400,function(){$('#list-services').html('')})}else{$('#list-services').html(html);if(totprice>0){$('#totaleservizieuro').html(pr(totprice));$('#totaleservizi').show()}else{$('#totaleservizi').hide()} 1167$('#reservation-summary-extra-services').slideDown()}};function gpInvoiceCountryFatt(){if($('#country').val()=='100000100'){if($('input[name=cod_user_type]:checked').val()!='GUE'){$('.rowfe').show()} 1168if($('#cod_user_typeGUE').prop('checked')&&!$('#cufe').val()){$('#cufe').val('0000000');$('#pecfe').val('')} 1169if($('#cufe').val()=='XXXXXXX'){$('#cufe').val('');$('#pecfe').val('')}}else{$('#cufe').val('XXXXXXX');$('#pecfe').val('');$('.rowfe').hide()}} 1170function gpInvoiceCambiaTipoUtente(){$('.mainguest-data').hide();$('.invoice-data').hide();$('.privato').hide();$('.azienda').hide();$('.rowfe').hide();switch($('input[name=cod_user_type]:checked').val()){case 'GUE':$('.invoice-data').show();$('.privato').show();$('#cufe').val('');$('#pecfe').val('');$('#surname').focus();break;case 'CMP':$('.invoice-data').show();$('.azienda').show();gpInvoiceCountryFatt();$('#company').focus();break;default:$('.mainguest-data').show();break}};function gpContractSign(tag,id,id_room_4_reservation_4_guest){if($('#signature'+id+'_'+id_room_4_reservation_4_guest).jSignature('getData','native').length==0){return!1} 1171var data={tag:tag,id_room_4_reservation_4_guest:id_room_4_reservation_4_guest,id_template:id,signature:$('#signature'+id+'_'+id_room_4_reservation_4_guest).jSignature("getData").replace('data:image/png;base64',''),};$(".loading").show();$.ajax({type:"POST",url:BASE_PATH+'/guest/sign-contract?ajax=true',data:data,traditional:!0,error:function(err){$(".loading").hide();alertErrorPublic(t('js_gp_errore'))},timeout:15000,success:function(data){$('#blksignature'+id+'_'+id_room_4_reservation_4_guest).html('<a class="btn btn-success size14 rounded-pill" href="'+BASE_PATH+'/guest/contract?tag='+tag+'&t='+id+'&g='+id_room_4_reservation_4_guest+'" target="_blank"><i class="fa fa-download" aria-hidden="true"></i> '+t('Scarica contratto firmato')+'</a>');$('#signed'+id+'_'+id_room_4_reservation_4_guest).val(1);$('#rowcontinua a.btn').removeClass('disabled');$('.show-signature').show();$('#blksignature'+id+'_'+id_room_4_reservation_4_guest).attr('data-signed',1);$(".loading").hide();gpContractEnableSubmit()}})} 1172function gpContractClearSignature(id,idr4){$('#signature'+id+'_'+idr4).jSignature("reset")} 1173function gpContractOtpSend(id_tmp,id_guest,id_reservation){$('.loading').show();var val=$('#otptel'+id_tmp+'_'+id_guest).val();if(!val.trim()){alert(t('Inserire un numero di telefono'));return!1} 1174if(val.substr(0,2)=='00'){val='+'+val.substr(2)} 1175$.ajax({url:BASE_PATH+'/guest/otp?ajax=true&id_template='+id_tmp+'&idr='+id_reservation+'&idg='+id_guest+'&tel='+encodeURIComponent(val),error:function(err){$('.loading').hide();alert(t('Impossibile inviare codice OTP'))},timeout:15000,success:function(data){$('.loading').hide();$('.spotp'+id_tmp+'_'+id_guest).show();$('#sptok'+id_tmp+'_'+id_guest).val(data.token)}})} 1176function gpContractOtpValidate(id,id_room_4_reservation_4_guest,id_reservation,tag){$('.loading').show();$.ajax({type:'POST',url:BASE_PATH+"/guest/otp-validate",data:{token:$('#sptok'+id+'_'+id_room_4_reservation_4_guest).val(),code1:$('#sp_otp_code1_'+id+'_'+id_room_4_reservation_4_guest).val(),code2:$('#sp_otp_code2_'+id+'_'+id_room_4_reservation_4_guest).val(),id_template:id,tag:tag,id_room_4_reservation_4_guest:id_room_4_reservation_4_guest,},success:function(data){$('.loading').hide();$('#blksignature'+id+'_'+id_room_4_reservation_4_guest).html('<a class="btn btn-success size14 rounded-pill" href="'+BASE_PATH+'/guest/contract?tag='+tag+'&t='+id+'&g='+id_room_4_reservation_4_guest+'" target="_blank"><i class="fa fa-download" aria-hidden="true"></i> '+t('Scarica contratto firmato')+'</a>');$('#signed'+id+'_'+id_room_4_reservation_4_guest).val(1);$('#rowcontinua a.btn').removeClass('disabled');$('.show-signature').show();$('#blksignature'+id+'_'+id_room_4_reservation_4_guest).attr('data-signed',1);$(".loading").hide();gpContractEnableSubmit()},error:function(xhr,ajaxOptions,thrownError){$('.loading').hide();$('#otpresult'+id+'_'+id_room_4_reservation_4_guest).html('<span class="text-danger">'+t('Codice inserito non valido')+'</span>');$('#sp_otp_'+id+'_'+id_room_4_reservation_4_guest).attr('valid',!1)}});return!1};!function(i){"undefined"!=typeof jQuery&&jQuery||"function"!=typeof define||!define.amd?"undefined"!=typeof jQuery&&jQuery||"object"!=typeof exports?i(jQuery,document,window,navigator):i(require("jquery"),document,window,navigator):define(["jquery"],function(t){return i(t,document,window,navigator)})}(function(a,c,l,t,_){"use strict";var i,s,o=0,e=(i=t.userAgent,s=/msie\s\d+/i,0<i.search(s)&&s.exec(i).toString().split(" ")[1]<9&&(a("html").addClass("lt-ie9"),!0));Function.prototype.bind||(Function.prototype.bind=function(o){var e=this,h=[].slice;if("function"!=typeof e)throw new TypeError;
1176var r=h.call(arguments,1),n=function(){if(this instanceof n){var t=function(){};t.prototype=e.prototype;var i=new t,s=e.apply(i,r.concat(h.call(arguments)));return Object(s)===s?s:i}return e.apply(o,r.concat(h.call(arguments)))};return n}),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),e<=h)return-1;for(s=Math.max(0<=h?h:e-Math.abs(h),0);s<e;){if(s in o&&o[s]===t)return s;s++}return-1});function h(t,i,s){this.VERSION="2.3.1",this.input=t,this.plugin_count=s,this.current_plugin=0,this.calc_count=0,this.update_tm=0,this.old_from=0,this.old_to=0,this.old_min_interval=null,this.raf_id=null,this.dragging=!1,this.force_redraw=!1,this.no_diapason=!1,this.has_tab_index=!0,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,i=i||{},this.$cache={win:a(l),body:a(c.body),input:a(t),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:[]},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_fake:0,p_single_real:0,p_from_fake:0,p_from_real:0,p_to_fake: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_fake:0,p_from_left:0,p_to_fake:0,p_to_left:0,p_single_fake:0,p_single_left:0};var o,e,h,r=this.$cache.input,n=r.prop("value");for(h in o={skin:"flat",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:!0,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:" â ",input_values_separator:";",disable:!1,block:!1,extra_classes:"",scope:null,onStart:null,onChange:null,onFinish:null,onUpdate:null},"INPUT"!==r[0].nodeName&&console&&console.warn&&console.warn("Base element should be <input>!",r[0]),(e={skin:r.data("skin"),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"),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"),input_values_separator:r.data("inputValuesSeparator"),disable:r.data("disable"),block:r.data("block"),extra_classes:r.data("extraClasses")}).values=e.values&&e.values.split(","),e)e.hasOwnProperty(h)&&(e[h]!==_&&""!==e[h]||delete e[h]);n!==_&&""!==n&&((n=n.split(e.input_values_separator||i.input_values_separator||";"))[0]&&n[0]==+n[0]&&(n[0]=+n[0]),n[1]&&n[1]==+n[1]&&(n[1]=+n[1]),i&&i.values&&i.values.length?(o.from=n[0]&&i.values.indexOf(n[0]),o.to=n[1]&&i.values.indexOf(n[1])):(o.from=n[0]&&+n[0],o.to=n[1]&&+n[1])),a.extend(o,i),a.extend(o,e),this.options=o,this.update_check={},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.init()}h.prototype={init:function(t){this.no_diapason=!1,this.coords.p_step=this.convertToPercent(this.options.step,!0),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.callOnStar
vendor: 3,423 bytes, line 1176
1176t()),this.updateScene()},append:function(){var t='<span class="irs irs--'+this.options.skin+" js-irs-"+this.plugin_count+" "+this.options.extra_classes+'"></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('<span class="irs"><span class="irs-line" tabindex="0"></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>'),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.line=this.$cache.cont.find(".irs-line"),this.$cache.grid=this.$cache.cont.find(".irs-grid"),"single"===this.options.type?(this.$cache.cont.append('<span class="irs-bar irs-bar--single"></span><span class="irs-shadow shadow-single"></span><span class="irs-handle single"><i></i><i></i><i></i></span>'),this.$cache.bar=this.$cache.cont.find(".irs-bar"),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('<span class="irs-bar"></span><span class="irs-shadow shadow-from"></span><span class="irs-shadow shadow-to"></span><span class="irs-handle from"><i></i><i></i><i></i></span><span class="irs-handle to"><i></i><i></i><i></i></span>'),this.$cache.bar=this.$cache.cont.find(".irs-bar"),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.input[0].disabled=!1,this.removeDisableMask(),this.bindEvents()),this.options.disable||(this.options.block?this.appendDisableMask():this.removeDisableMask()),this.options.drag_interval&&(this.$cache.bar[0].style.cursor="ew-resize")},setTopHandler:function(){var t=this.options.min,i=this.options.max,s=this.options.from,o=this.options.to;t<s&&o===i?this.$cache.s_from.addClass("type_last"):o<i&&this.$cache.s_to.addClass("type_last")},changeLevel:function(t){switch(t){case"single":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_single_fake),this.$cache.s_single.addClass("state_hover");break;case"from":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_from_fake),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_fake),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.co
vendor: 4,194 bytes, line 1176
1176ords.p_pointer-this.coords.p_from_fake),this.coords.p_gap_right=this.toFixed(this.coords.p_to_fake-this.coords.p_pointer),this.$cache.s_to.removeClass("type_last"),this.$cache.s_from.removeClass("type_last")}},appendDisableMask:function(){this.$cache.cont.append('<span class="irs-disable-mask"></span>'),this.$cache.cont.addClass("irs-disabled")},removeDisableMask:function(){this.$cache.cont.remove(".irs-disable-mask"),this.$cache.cont.removeClass("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),e&&(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.no_diapason||(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.$cache.line.on("focus.irs_"+this.plugin_count,this.pointerFocus.bind(this)),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,null)),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,null)),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("key
1176down.irs_"+this.plugin_count,this.key.bind(this,"keyboard")),e&&(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))))},pointerFocus:function(t){var i,s;this.target||(i=(s="single"===this.options.type?this.$cache.single:this.$cache.from).offset().left,i+=s.width()/2-1,this.pointerClick("single",{preventDefault:function(){},pageX:i}))},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(t){this.current_plugin===this.plugin_count&&this.is_active&&(this.is_active=!1,this.$cache.cont.find(".state_hover").removeClass("state_hover"),this.force_redraw=!0,e&&a("*").prop("unselectable",!1),this.updateScene(),this.restoreOriginalMinInterval(),(a.contains(this.$cache.cont[0],t.target)||this.dragging)&&this.callOnFinish(),this.dragging=!1)},pointerDown:function(t,i){i.preventDefault();var s=i.pageX||i.originalEvent.touches&&i.originalEvent.touches[0].pageX;2!==i.button&&("both"===t&&this.setTempMinInterval(),t=t||(this.target||"from"),this.current_plugin=this.plugin_count,this.target=t,this.is_active=!0,this.dragging=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=s-this.coords.x_gap,this.calcPointerPercent(),this.changeLevel(t),e&&a("*").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,s=(this.options.max-this.options.min)/100;s=this.options.step/s,t?i+=s:i-=s,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");if(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]));else{var t=this._prettify(this.options.min),i=this._prettify(this.options.max);this.result.min_pretty=t,this.result.max_pretty=i,this.$cache.min.html(this.decorate(t,this.options.min)),this.$cache.max.html(this.decorate(i,this.options.max))}this.labels.w_min=this.$cache.min.outerWidth(!1),this.labels.w_max=this.$cache.max.outerWidth(!1)}},setTempMinInterval:function(){var t=this.result.to-this.result.from;null===this.old_min_interval&&(this.old_min_interval=this.options.min_interval),this.options.min_interval=t},restoreOriginalMinInterval:function(){null!==this.old_min_interval&&(this.options.min_interval=this.old_min_interval,this.old_min_interval=null)},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),this.calcHandlePercent()),this.coords.w_rs)){this.calcPointerPercent();var i=this.getHandleX();switch("both"===this.target&&(this.coords.p_gap=0,i=this.getHandleX()),"click"===this.target&&(this.coords.p_gap=this.coords.p_handle/2,i=this.getHandleX(),this.options.drag_interval?this.target="both_one":this.target=this.chooseHandle(i)),this.target){case"base":var s=(this.options.max-this.options.min)/100,o=(this.result.from-this.options.min)/s,e=(this.result.to-this.options.min)/s;this.coords.p_single_real=this.toFixed(o),this.coords.p_from_real=this.toFixed(o),this.coords.p_to_real=this.toFixed(e),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_fake=this.convertToFakePercent(this.coords.p_single_real),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real),this.target=null;break;case"single":if(this.options.from_fixed)break;this.coords.p_single_real=this.convertToRealPercent(i),this.coords.p_single_real=this.calcWithStep(this.coords.p_single_real),this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max),this.coords.p_single_fake=this.convertToFakePercent(this.coords.p_single_real);break;case"from":if(this.options.from_fixed)break;this.coords.p_from_real=this.convertToRealPercent(i),this.coords.p_from_real=this.calcWithStep(this.coords.p_from_real),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_fake=this.convertToFakePercent(this.coords.p_from_real);break;case"to":if(this.options.to_fixed)break;this.coords.p_to_real=this.convertToRealPercent(i),this.coords.p_to_real=this.calcWithStep(this.coords.p_to_real),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_fake=this.convertToFakePercent(this.coords.p_to_real);break;case"both":if(this.options.from_fixed||this.options.to_fixed)break;i=this.toFixed(i+.001*this.coords.p_handle),this.coords.p_from_real=this.convertToRealPercent(i)-this.coords.p_gap_left,this.coords.p_from_real=this.calcWithStep(this.coords.p_from_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_fake=this.convertToFakePercent(this.coords.p_from_real),this.coords.p_to_real=this.convertToRealPercent(i)+this.coords.p_gap_right,this.coords.p_to_real=this.calcWithStep(this.coords.p_to_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_fake=this.convertToFakePercent(this.coords.p_to_real);break;case"both_one":if(this.options.from_fixed||this.options.to_fixed)break;var h=this.convertToRealPercent(i),r=this.result.from_percent,n=this.result.to_percent-r,a=n/2,c=h-a,l=h+a;c<0&&(l=(c=0)+n),100<l&&(c=(l=100)-n),this.coords.p_from_real=this.calcWithStep(c),this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max),this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real),this.coords.p_to_real=this.calcWithStep(l),this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max),this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real)}"single"===this.options.type?(this.coords.p_bar_x=this.coords.p_handle/2,this.coords.p_bar_w=this.coords.p_single_fake,this.result.from_percent=this.coords.p_single_real,this.result.from=this.convertToValue(this.coords.p_single_real),this.result.from_pretty=this._prettify(this.result.from),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_fake+this.coords.p_handle/2),this.coords.p_bar_w=this.toFixed(this.coords.p_to_fake-this.coords.p_from_fake),this.result.from_percent=this.coords.p_from_real,this.result.from=this.convertToValue(this.coords.p_from_real),this.result.from_pretty=this._prettify(this.result.from),this.result.to_percent=this.coords.p_to_real,this.result.to=this.convertToValue(this.coords.p_to_real),this.result.to_pretty=this._prettify(this.result.to),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()}}
1176,calcPointerPercent:function(){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),this.coords.p_pointer=this.toFixed(this.coords.x_pointer/this.coords.w_rs*100)):this.coords.p_pointer=0},convertToRealPercent:function(t){return t/(100-this.coords.p_handle)*100},convertToFakePercent:function(t){return t/100*(100-this.coords.p_handle)},getHandleX:function(){var t=100-this.coords.p_handle,i=this.toFixed(this.coords.p_pointer-this.coords.p_gap);return i<0?i=0:t<i&&(i=t),i},calcHandlePercent:function(){"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)},chooseHandle:function(t){return"single"===this.options.type?"single":this.coords.p_from_real+(this.coords.p_to_real-this.coords.p_from_real)/2<=t?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_fake=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=this.coords.p_single_fake+this.coords.p_handle/2-this.labels.p_single_fake/2):(this.labels.w_from=this.$cache.from.outerWidth(!1),this.labels.p_from_fake=this.labels.w_from/this.coords.w_rs*100,this.labels.p_from_left=this.coords.p_from_fake+this.coords.p_handle/2-this.labels.p_from_fake/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_fake),this.labels.w_to=this.$cache.to.outerWidth(!1),this.labels.p_to_fake=this.labels.w_to/this.coords.w_rs*100,this.labels.p_to_left=this.coords.p_to_fake+this.coords.p_handle/2-this.labels.p_to_fake/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_fake),this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single_fake=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_fake)/2-this.labels.p_single_fake/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_fake))},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.bar[0].style.left=0,this.$cache.bar[0].style.width=this.coords.p_bar_w+this.coords.p_bar_x+"%",this.$cache.s_single[0].style.left=this.coords.p_single_fake+"%"):(this.$cache.s_from[0].style.left=this.coords.p_from_fake+"%",this.$cache.s_to[0].style.left=this.coords.p_to_fake+"%",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.writeToInput(),this.old_from===this.result.from&&this.old_to===this.result.to||this.is_start||(this.$cache.input.trigger("change"),this.$cache.input.trigger("input")),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.is_key=!1,this.is_click=!1,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))},drawLabels:function(){if(this.options){var t,i,s,o,e,h=this.options.values.length,r=this.options.p_values;if(!this.options.hide_from_to)if("single"===this.options.type)t=h?this.decorate(r[this.result.from]):(o=this._prettify(this.result.from),this.decorate(o,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_fake>100-this.labels.p_max-1?this.$cache.max[0].style.visibility="hidden":this.$cache.max[0].style.visibility="visible";else{s=h?(this.options.decorate_both?(t=this.decorate(r[this.result.from]),t+=this.options.values_separator,t+=this.decorate(r[this.result.to])):t=this.decorate(r[this.result.from]+this.options.values_separator+r[this.result.to]),i=this.decorate(r[this.result.from]),this.decorate(r[this.result.to])):(o=this._prettify(this.result.from),e=this._prettify(this.result.to),this.options.decorate_both?(t=this.decorate(o,this.result.from),t+=this.options.values_separator,t+=this.decorate(e,this.result.to)):t=this.decorate(o+this.options.values_separator+e,this.result.to),i=this.decorate(o,this.result.from),this.decorate(e,this.result.to)),this.$cache.single.html(t),this.$cache.from.html(i),this.$cache.to.html(s),this.calcLabels();var n=Math.min(this.labels.p_single_left,this.labels.p_from_left),a=this.labels.p_single_left+this.labels.p_single_fake,c=this.labels.p_to_left+this.labels.p_to_fake,l=Math.max(a,c);this.labels.p_from_left+this.labels.p_from_fake>=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",l=this.result.from===this.result.to?("from"===this.target?this.$cache.from[0].style.visibility="visible":"to"===this.target?this.$cache.to[0].style.visibility="visible":this.target||(this.$cache.from[0].style.visibility="visible"),this.$cache.single[0].style.visibility="hidden",c):(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",Math.max(a,c))):(this.$cache.from[0].style.visibility="visible",this.$cache.to[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden"),n<this.labels.p_min+1?this.$cache.min[0].style.visibility="hidden":this.$cache.min[0].style.visibility="visible",l>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),n="number"==typeof e.from_max&&!isNaN(e.from_max),a="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||n)?(t=this.convertToPercent(r?e.from_min:e.min),i=this.convertToPercent(n?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||n)?(t=this.convertToPercent(r?e.from_min:e.min),i=this.convertToPercent(n?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&&(a||c)?(s=this.convertToPercent(a?e.to_min:e.min),o=this.convertToPercent(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")}
1176,writeToInput:function(){"single"===this.options.type?(this.options.values.length?this.$cache.input.prop("value",this.result.from_value):this.$cache.input.prop("value",this.result.from),this.$cache.input.data("from",this.result.from)):(this.options.values.length?this.$cache.input.prop("value",this.result.from_value+this.options.input_values_separator+this.result.to_value):this.$cache.input.prop("value",this.result.from+this.options.input_values_separator+this.result.to),this.$cache.input.data("from",this.result.from),this.$cache.input.data("to",this.result.to))},callOnStart:function(){this.writeToInput(),this.options.onStart&&"function"==typeof this.options.onStart&&(this.options.scope?this.options.onStart.call(this.options.scope,this.result):this.options.onStart(this.result))},callOnChange:function(){this.writeToInput(),this.options.onChange&&"function"==typeof this.options.onChange&&(this.options.scope?this.options.onChange.call(this.options.scope,this.result):this.options.onChange(this.result))},callOnFinish:function(){this.writeToInput(),this.options.onFinish&&"function"==typeof this.options.onFinish&&(this.options.scope?this.options.onFinish.call(this.options.scope,this.result):this.options.onFinish(this.result))},callOnUpdate:function(){this.writeToInput(),this.options.onUpdate&&"function"==typeof this.options.onUpdate&&(this.options.scope?this.options.onUpdate.call(this.options.scope,this.result):this.options.onUpdate(this.result))},toggleInput:function(){this.$cache.input.toggleClass("irs-hidden-input"),this.has_tab_index?this.$cache.input.prop("tabindex",-1):this.$cache.input.removeProp("tabindex"),this.has_tab_index=!this.has_tab_index},convertToPercent:function(t,i){var s,o=this.options.max-this.options.min,e=o/100;return o?(s=(i?t:t-this.options.min)/e,this.toFixed(s)):(this.no_diapason=!0,0)},convertToValue:function(t){var i,s,o=this.options.min,e=this.options.max,h=o.toString().split(".")[1],r=e.toString().split(".")[1],n=0,a=0;if(0===t)return this.options.min;if(100===t)return this.options.max;h&&(n=i=h.length),r&&(n=s=r.length),i&&s&&(n=s<=i?i:s),o<0&&(o=+(o+(a=Math.abs(o))).toFixed(n),e=+(e+a).toFixed(n));var c,l=(e-o)/100*t+o,_=this.options.step.toString().split(".")[1];return l=_?+l.toFixed(_.length):(l/=this.options.step,+(l*=this.options.step).toFixed(0)),a&&(l-=a),(c=_?+l.toFixed(_.length):this.toFixed(l))<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 100<i&&(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.convertToValue(t),e=this.convertToValue(i),"from"===s?e-o<h.min_interval&&(o=e-h.min_interval):o-e<h.min_interval&&(o=e+h.min_interval),this.convertToPercent(o)):t},checkMaxInterval:function(t,i,s){var o,e,h=this.options;return h.max_interval?(o=this.convertToValue(t),e=this.convertToValue(i),"from"===s?e-o>h.max_interval&&(o=e-h.max_interval):o-e>h.max_interval&&(o=e+h.max_interval),this.convertToPercent(o)):t},checkDiapason:function(t,i,s){var o=this.convertToValue(t),e=this.options;return"number"!=typeof i&&(i=e.min),"number"!=typeof s&&(s=e.max),o<i&&(o=i),s<o&&(o=s),this.convertToPercent(o)},toFixed:function(t){return+(t=t.toFixed(20))},_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){return t.toString().replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g,"$1"+this.options.prettify_separator)},checkEdges:function(t,i){return this.options.force_edges&&(t<0?t=0:100-i<t&&(t=100-i)),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.grid_num&&(s.grid_num=+s.grid_num),s.max<s.min&&(s.max=s.min),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;i<h;i++)t=+e[i],t=isNaN(t)?e[i]:(e[i]=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.to)||(s.to=s.max),"single"===s.type?(s.from<s.min&&(s.from=s.min),s.from>
1176s.max&&(s.from=s.max)):(s.from<s.min&&(s.from=s.min),s.from>s.max&&(s.from=s.max),s.to<s.min&&(s.to=s.min),s.to>s.max&&(s.to=s.max),this.update_check.from&&(this.update_check.from!==s.from&&s.from>s.to&&(s.from=s.to),this.update_check.to!==s.to&&s.to<s.from&&(s.to=s.from)),s.from>s.to&&(s.from=s.to),s.to<s.from&&(s.to=s.from)),("number"!=typeof s.step||isNaN(s.step)||!s.step||s.step<0)&&(s.step=1),"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.convertToPercent(this.result.from),this.result.from_pretty=this._prettify(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.convertToPercent(this.result.to),this.result.to_pretty=this._prettify(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,r=this.options,n=r.max-r.min,a=r.grid_num,c=0,l=4,_="";for(this.calcGridMargin(),r.grid_snap&&(a=n/r.step),50<a&&(a=50),s=this.toFixed(100/a),4<a&&(l=3),7<a&&(l=2),14<a&&(l=1),28<a&&(l=0),t=0;t<a+1;t++){for(o=l,100<(c=this.toFixed(s*t))&&(c=100),e=((this.coords.big[t]=c)-s*(t-1))/(o+1),i=1;i<=o&&0!==c;i++)_+='<span class="irs-grid-pol small" style="left: '+this.toFixed(c-e*i)+'%"></span>';_+='<span class="irs-grid-pol" style="left: '+c+'%"></span>',h=this.convertToValue(c),_+='<span class="irs-grid-text js-grid-text-'+t+'" style="left: '+c+'%">'+(h=r.values.length?r.p_values[h]:this._prettify(h))+"</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;i<s;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;t<e;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;t<e;t++)i=this.$cache.grid_labels[t][0],this.coords.big_x[t]!==Number.POSITIVE_INFINITY&&(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;o<r&&!(r<=(e=o+t/2));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[
11760].style.width=this.toFixed(100-this.coords.p_handle)+"%",this.$cache.grid[0].style.left=this.coords.grid_gap+"%"))},update:function(t){this.input&&(this.is_update=!0,this.options.from=this.result.from,this.options.to=this.result.to,this.update_check.from=this.result.from,this.update_check.to=this.result.to,this.options=a.extend(this.options,t),this.validate(),this.updateResult(t),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),a.data(this.input,"ionRangeSlider",null),this.remove(),this.input=null,this.options=null)}},a.fn.ionRangeSlider=function(t){return this.each(function(){a.data(this,"ionRangeSlider")||a.data(this,"ionRangeSlider",new h(this,t,o++))})},function(){for(var h=0,t=["ms","moz","webkit","o"],i=0;i<t.length&&!l.requestAnimationFrame;++i)l.requestAnimationFrame=l[t[i]+"RequestAnimationFrame"],l.cancelAnimationFrame=l[t[i]+"CancelAnimationFrame"]||l[t[i]+"CancelRequestAnimationFrame"];l.requestAnimationFrame||(l.requestAnimationFrame=function(t,i){var s=(new Date).getTime(),o=Math.max(0,16-(s-h)),e=l.setTimeout(function(){t(s+o)},o);return h=s+o,e}),l.cancelAnimationFrame||(l.cancelAnimationFrame=function(t){clearTimeout(t)})}()});(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else if(typeof module==="object"&&module.exports){module.exports=factory(require("jquery"))}else{factory(jQuery)}}(function($){$.extend($.fn,{validate:function(options){if(!this.length){if(options&&options.debug&&window.console){console.warn("Nothing selected, can't validate, returning nothing.")} 1177return} 1178var validator=$.data(this[0],"validator");if(validator){return validator} 1179this.attr("novalidate","novalidate");validator=new $.validator(options,this[0]);$.data(this[0],"validator",validator);if(validator.settings.onsubmit){this.on("click.validate",":submit",function(event){validator.submitButton=event.currentTarget;if($(this).hasClass("cancel")){validator.cancelSubmit=!0} 1180if($(this).attr("formnovalidate")!==undefined){validator.cancelSubmit=!0}});this.on("submit.validate",function(event){if(validator.settings.debug){event.preventDefault()} 1181function handle(){var hidden,result;if(validator.submitButton&&(validator.settings.submitHandler||validator.formSubmitted)){hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val($(validator.submitButton).val()).appendTo(validator.currentForm)} 1182if(validator.settings.submitHandler){result=validator.settings.submitHandler.call(validator,validator.currentForm,event);if(hidden){hidden.remove()} 1183if(result!==undefined){return result} 1184return!1} 1185return!0} 1186if(validator.cancelSubmit){validator.cancelSubmit=!1;return handle()} 1187if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=!0;return!1} 1188return handle()}else{validator.focusInvalid();return!1}})} 1189return validator},valid:function(){var valid,validator,errorList;if($(this[0]).is("form")){valid=this.validate().form()}else{errorList=[];valid=!0;validator=$(this[0].form).validate();this.each(function(){valid=validator.element(this)&&valid;if(!valid){errorList=errorList.concat(validator.errorList)}});validator.errorList=errorList} 1190return valid},rules:function(command,argument){var element=this[0],settings,staticRules,existingRules,data,param,filtered;if(element==null){return} 1191if(!element.form&&element.hasAttribute("contenteditable")){element.form=this.closest("form")[0];element.name=this.attr("name")} 1192if(element.form==null){return} 1193if(command){settings=$.data(element.form,"validator").settings;staticRules=settings.rules;existingRules=$.validator.staticRules(element);switch(command){case "add":$.extend(existingRules,$.validator.normalizeRule(argument));delete existingRules.messages;staticRules[element.name]=existingRules;if(argument.messages){settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages)} 1194break;case "remove":if(!argument){delete staticRules[element.name];return existingRules} 1195filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method]});return filtered}} 1196data=$.validator.normalizeRules($.extend({},$.validator.classRules(element),$.validator.attributeRules(element),$.validator.dataRules(element),$.validator.staticRules(element)),element);if(data.required){param=data.required;delete data.required;data=$.extend({required:param},data)} 1197if(data.remote){param=data.remote;delete data.remote;data=$.extend(data,{remote:param})} 1198return data}});$.extend($.expr.pseudos||$.expr[":"],{blank:function(a){return!$.trim(""+$(a).val())},filled:function(a){var val=$(a).val();return val!==null&&!!$.trim(""+val)},unchecked:function(a){return!$(a).prop("checked")}});$.validator=function(options,form){this.settings=$.extend(!0,{},$.validator.defaults,options);this.currentForm=form;this.init()};$.validator.format=function(source,params){if(arguments.length===1){return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args)}}
1199if(params===undefined){return source} 1200if(arguments.length>2&¶ms.constructor!==Array){params=$.makeArray(arguments).slice(1)} 1201if(params.constructor!==Array){params=[params]} 1202$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),function(){return n})});return source};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",pendingClass:"pending",validClass:"valid",errorElement:"label",focusCleanup:!1,focusInvalid:!0,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup){if(this.settings.unhighlight){this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass)} 1203this.hideThese(this.errorsFor(element))}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element)}},onkeyup:function(element,event){var excludedKeys=[16,17,18,20,35,36,37,38,39,40,45,144,225];if(event.which===9&&this.elementValue(element)===""||$.inArray(event.keyCode,excludedKeys)!==-1){return}else if(element.name in this.submitted||element.name in this.invalid){this.element(element)}},onclick:function(element){if(element.name in this.submitted){this.element(element)}else if(element.parentNode.name in this.submitted){this.element(element.parentNode)}},highlight:function(element,errorClass,validClass){if(element.type==="radio"){this.findByName(element.name).addClass(errorClass).removeClass(validClass)}else{$(element).addClass(errorClass).removeClass(validClass)}},unhighlight:function(element,errorClass,validClass){if(element.type==="radio"){this.findByName(element.name).removeClass(errorClass).addClass(validClass)}else{$(element).removeClass(errorClass).addClass(validClass)}}},setDefaults:function(settings){$.extend($.validator.defaults,settings)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",equalTo:"Please enter the same value again.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}."),step:$.validator.format("Please enter a multiple of {0}.")},autoCreateRanges:!1,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={}),rules;$.each(this.settings.groups,function(key,value){if(typeof value==="string"){value=value.split(/\s/)} 1204$.each(value,function(index,name){groups[name]=key})});rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value)});function delegate(event){if(!this.form&&this.hasAttribute("contenteditable")){this.form=$(this).closest("form")[0];this.name=$(this).attr("name")} 1205var validator=$.data(this.form,"validator"),eventType="on"+event.type.replace(/^validate/,""),settings=validator.settings;if(settings[eventType]&&!$(this).is(settings.ignore)){settings[eventType].call(validator,this,event)}} 1206$(this.currentForm).on("focusin.validate focusout.validate keyup.validate",":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], "+"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], "+"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], "+"[type='radio'], [type='checkbox'], [contenteditable], [type='button']",delegate).on("click.validate","select, option, [type='radio'], [type='checkbox']",delegate);if(this.settings.invalidHandler){$(this.currentForm).on("invalid-form.validate",this.settings.invalidHandler)}},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid()){$(this.currentForm).triggerHandler("invalid-form",[this])} 1207this.showErrors();return this.valid()},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i])} 1208return this.valid()},element:function(element){var cleanElement=this.clean(element),checkElement=this.validationTargetFor(cleanElement),v=this,result=!0,rs,group;if(checkElement===undefined){delete this.invalid[cleanElement.name]}else{this.prepareElement(checkElement);this.currentElements=$(checkElement);group=this.groups[checkElement.name];if(group){$.each(this.groups,function(name,testgroup){if(testgroup===group&&name!==checkElement.name){cleanElement=v.validationTargetFor(v.clean(v.findByName(name)));
1208if(cleanElement&&cleanElement.name in v.invalid){v.currentElements.push(cleanElement);result=v.check(cleanElement)&&result}}})} 1209rs=this.check(checkElement)!==!1;result=result&&rs;if(rs){this.invalid[checkElement.name]=!1}else{this.invalid[checkElement.name]=!0} 1210if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers)} 1211this.showErrors();$(element).attr("aria-invalid",!rs)} 1212return result},showErrors:function(errors){if(errors){var validator=this;$.extend(this.errorMap,errors);this.errorList=$.map(this.errorMap,function(message,name){return{message:message,element:validator.findByName(name)[0]}});this.successList=$.grep(this.successList,function(element){return!(element.name in errors)})} 1213if(this.settings.showErrors){this.settings.showErrors.call(this,this.errorMap,this.errorList)}else{this.defaultShowErrors()}},resetForm:function(){if($.fn.resetForm){$(this.currentForm).resetForm()} 1214this.invalid={};this.submitted={};this.prepareForm();this.hideErrors();var elements=this.elements().removeData("previousValue").removeAttr("aria-invalid");this.resetElements(elements)},resetElements:function(elements){var i;if(this.settings.unhighlight){for(i=0;elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,"");this.findByName(elements[i].name).removeClass(this.settings.validClass)}}else{elements.removeClass(this.settings.errorClass).removeClass(this.settings.validClass)}},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(obj){var count=0,i;for(i in obj){if(obj[i]!==undefined&&obj[i]!==null&&obj[i]!==!1){count++}} 1215return count},hideErrors:function(){this.hideThese(this.toHide)},hideThese:function(errors){errors.not(this.containers).text("");this.addWrapper(errors).hide()},valid:function(){return this.size()===0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name===lastActive.name}).length===1&&lastActive},elements:function(){var validator=this,rulesCache={};return $(this.currentForm).find("input, select, textarea, [contenteditable]").not(":submit, :reset, :image, :disabled").not(this.settings.ignore).filter(function(){var name=this.name||$(this).attr("name");if(!name&&validator.settings.debug&&window.console){console.error("%o has no name assigned",this)} 1216if(this.hasAttribute("contenteditable")){this.form=$(this).closest("form")[0];this.name=name} 1217if(name in rulesCache||!validator.objectLength($(this).rules())){return!1} 1218rulesCache[name]=!0;return!0})},clean:function(selector){return $(selector)[0]},errors:function(){var errorClass=this.settings.errorClass.split(" ").join(".");return $(this.settings.errorElement+"."+errorClass,this.errorContext)},resetInternals:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([])},reset:function(){this.resetInternals();this.currentElements=$([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element)},elementValue:function(element){var $element=$(element),type=element.type,val,idx;if(type==="radio"||type==="checkbox"){return this.findByName(element.name).filter(":checked").val()}else if(type==="number"&&typeof element.validity!=="undefined"){return element.validity.badInput?"NaN":$element.val()} 1219if(element.hasAttribute("contenteditable")){val=$element.text()}else{val=$element.val()} 1220if(type==="file"){if(val.substr(0,12)==="C:\\fakepath\\"){return val.substr(12)} 1221idx=val.lastIndexOf("/");if(idx>=0){return val.substr(idx+1)} 1222idx=val.lastIndexOf("\\");if(idx>=0){return val.substr(idx+1)} 1223return val} 1224if(typeof val==="string"){return val.replace(/\r/g,"")} 1225return val},check:function(element){element=this.validationTargetFor(this.clean(element));var rules=$(element).rules(),rulesCount=$.map(rules,function(n,i){return i}).length,dependencyMismatch=!1,val=this.elementValue(element),result,method,rule,normalizer;if(typeof rules.normalizer==="function"){normalizer=rules.normalizer}else if(typeof this.settings.normalizer==="function"){normalizer=this.settings.normalizer} 1226if(normalizer){val=normalizer.call(element,val);if(typeof val!=="string"){throw new TypeError("The normalizer should return a string value.")} 1227delete rules.normalizer} 1228for(method in rules){rule={method:method,parameters:rules[method]};try{result=$.validator.methods[method].call(this,val,element,rule.parameters);if(result==="dependency-mismatch"&&rulesCount===1){dependencyMismatch=!0;continue} 1229dependencyMismatch=!1;if(result==="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return} 1230if(!result){this.formatAndAdd(element,rule);return!1}}catch(e){if(this.settings.debug&&window.console){console.log("Exception occurred when checking element "+element.i
1230d+", check the '"+rule.method+"' method.",e)} 1231if(e instanceof TypeError){e.message+=". Exception occurred when checking element "+element.id+", check the '"+rule.method+"' method."} 1232throw e}} 1233if(dependencyMismatch){return} 1234if(this.objectLength(rules)){this.successList.push(element)} 1235return!0},customDataMessage:function(element,method){return $(element).data("msg"+method.charAt(0).toUpperCase()+method.substring(1).toLowerCase())||$(element).data("msg")},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor===String?m:m[method])},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined){return arguments[i]}} 1236return undefined},defaultMessage:function(element,rule){if(typeof rule==="string"){rule={method:rule}} 1237var message=this.findDefined(this.customMessage(element.name,rule.method),this.customDataMessage(element,rule.method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[rule.method],"<strong>Warning: No message defined for "+element.name+"</strong>"),theregex=/\$?\{(\d+)\}/g;if(typeof message==="function"){message=message.call(this,rule.parameters,element)}else if(theregex.test(message)){message=$.validator.format(message.replace(theregex,"{$1}"),rule.parameters)} 1238return message},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule);this.errorList.push({message:message,element:element,method:rule.method});this.errorMap[element.name]=message;this.submitted[element.name]=message},addWrapper:function(toToggle){if(this.settings.wrapper){toToggle=toToggle.add(toToggle.parent(this.settings.wrapper))} 1239return toToggle},defaultShowErrors:function(){var i,elements,error;for(i=0;this.errorList[i];i++){error=this.errorList[i];if(this.settings.highlight){this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass)} 1240this.showLabel(error.element,error.message)} 1241if(this.errorList.length){this.toShow=this.toShow.add(this.containers)} 1242if(this.settings.success){for(i=0;this.successList[i];i++){this.showLabel(this.successList[i])}} 1243if(this.settings.unhighlight){for(i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass)}} 1244this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return $(this.errorList).map(function(){return this.element})},showLabel:function(element,message){var place,group,errorID,v,error=this.errorsFor(element),elementID=this.idOrName(element),describedBy=$(element).attr("aria-describedby");if(error.length){error.removeClass(this.settings.validClass).addClass(this.settings.errorClass);error.html(message)}else{error=$("<"+this.settings.errorElement+">").attr("id",elementID+"-error").addClass(this.settings.errorClass).html(message||"");place=error;if(this.settings.wrapper){place=error.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()} 1245if(this.labelContainer.length){this.labelContainer.append(place)}else if(this.settings.errorPlacement){this.settings.errorPlacement.call(this,place,$(element))}else{place.insertAfter(element)} 1246if(error.is("label")){error.attr("for",elementID)}else if(error.parents("label[for='"+this.escapeCssMeta(elementID)+"']").length===0){errorID=error.attr("id");if(!describedBy){describedBy=errorID}else if(!describedBy.match(new RegExp("\\b"+this.escapeCssMeta(errorID)+"\\b"))){describedBy+=" "+errorID} 1247$(element).attr("aria-describedby",describedBy);group=this.groups[element.name];if(group){v=this;$.each(v.groups,function(name,testgroup){if(testgroup===group){$("[name='"+v.escapeCssMeta(name)+"']",v.currentForm).attr("aria-describedby",error.attr("id"))}})}}} 1248if(!message&&this.settings.success){error.text("");if(typeof this.settings.success==="string"){error.addClass(this.settings.success)}else{this.settings.success(error,element)}} 1249this.toShow=this.toShow.add(error)},errorsFor:function(element){var name=this.escapeCssMeta(this.idOrName(element)),describer=$(element).attr("aria-describedby"),selector="label[for='"+name+"'], label[for='"+name+"'] *";if(describer){selector=selector+", #"+this.escapeCssMeta(describer).replace(/\s+/g,", #")} 1250return this.errors().filter(selector)},escapeCssMeta:function(string){return string.replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,"\\$1")},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.i
1250d||element.name)},validationTargetFor:function(element){if(this.checkable(element)){element=this.findByName(element.name)} 1251return $(element).not(this.settings.ignore)[0]},checkable:function(element){return(/radio|checkbox/i).test(element.type)},findByName:function(name){return $(this.currentForm).find("[name='"+this.escapeCssMeta(name)+"']")},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case "select":return $("option:selected",element).length;case "input":if(this.checkable(element)){return this.findByName(element.name).filter(":checked").length}} 1252return value.length},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):!0},dependTypes:{"boolean":function(param){return param},"string":function(param,element){return!!$(param,element.form).length},"function":function(param,element){return param(element)}},optional:function(element){var val=this.elementValue(element);return!$.validator.methods.required.call(this,val,element)&&"dependency-mismatch"},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;$(element).addClass(this.settings.pendingClass);this.pending[element.name]=!0}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0){this.pendingRequest=0} 1253delete this.pending[element.name];$(element).removeClass(this.settings.pendingClass);if(valid&&this.pendingRequest===0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();if(this.submitButton){$("input:hidden[name='"+this.submitButton.name+"']",this.currentForm).remove()} 1254this.formSubmitted=!1}else if(!valid&&this.pendingRequest===0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=!1}},previousValue:function(element,method){method=typeof method==="str
1254ing"&&method||"remote";return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:!0,message:this.defaultMessage(element,{method:method})})},destroy:function(){this.resetForm();$(this.currentForm).off(".validate").removeData("validator").find(".validate-equalTo-blur").off(".validate-equalTo").removeClass("validate-equalTo-blur")}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(className,rules){if(className.constructor===String){this.classRuleSettings[className]=rules}else{$.extend(this.classRuleSettings,className)}},classRules:function(element){var rules={},classes=$(element).attr("class");if(classes){$.each(classes.split(" "),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this])}})} 1255return rules},normalizeAttributeRule:function(rules,type,method,value){if(/min|max|step/.test(method)&&(type===null||/number|range|text/.test(type))){value=Number(value);if(isNaN(value)){value=undefined}} 1256if(value||value===0){rules[method]=value}else if(type===method&&type!=="range"){rules[method]=!0}},attributeRules:function(element){var rules={},$element=$(element),type=element.getAttribute("type"),method,value;for(method in $.validator.methods){if(method==="required"){value=element.getAttribute(method);if(value===""){value=!0} 1257value=!!value}else{value=$element.attr(method)} 1258this.normalizeAttributeRule(rules,type,method,value)} 1259if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength} 1260return rules},dataRules:function(element){var rules={},$element=$(element),type=element.getAttribute("type"),method,value;for(method in $.validator.methods){value=$element.data("rule"+method.charAt(0).toUpperCase()+method.substring(1).toLowerCase());this.normalizeAttributeRule(rules,type,method,value)} 1261return rules},staticRules:function(element){var rules={},validator=$.data(element.form,"validator");if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{}} 1262return rules},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===!1){delete rules[prop];return} 1263if(val.param||val.depends){var keepRule=!0;switch(typeof val.depends){case "string":keepRule=!!$(val.depends,element.form).length;break;case "function":keepRule=val.depends.call(element,element);break} 1264if(keepRule){rules[prop]=val.param!==undefined?val.param:!0}else{$.data(element.form,"validator").resetElements($(element));delete rules[prop]}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)&&rule!=="normalizer"?parameter(element):parameter});$.each(["minlength","maxlength"],function(){if(rules[this]){rules[this]=Number(rules[this])}});$.each(["rangelength","range"],function(){var parts;if(rules[this]){if($.isArray(rules[this])){rules[this]=[Number(rules[this][0]),Number(rules[this][1])]}else if(typeof rules[this]==="string"){parts=rules[this].replace(/[\[\]]/g,"").split(/[\s,]+/);rules[this]=[Number(parts[0]),Number(parts[1])]}}});if($.validator.autoCreateRanges){if(rules.min!=null&&rules.max!=null){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max} 1265if(rules.minlength!=null&&rules.maxlength!=null){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength}} 1266return rules},normalizeRule:function(data){if(typeof data==="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=!0});data=transformed} 1267return data},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!==undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name))}},methods:{required:function(value,element,param){if(!this.depend(param,element)){return "dependency-mismatch"} 1268if(element.nodeName.toLowerCase()==="select"){var val=$(element).val();return val&&val.length>0} 1269if(this.checkable(element)){return this.getLength(value,element)>0} 1270return value.length>0},email:function(value,element){return this.optional(element)||/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test(value)},url:function(value,element){return this.optional(element)||/^(?:(?:(?
1270:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(value)},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value).toString())},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test(value)},number:function(value,element){return this.optional(element)||/^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(value)},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value)},minlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength(value,element);return this.optional(element)||length>=param},maxlength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength(value,element);return this.optional(element)||length<=param},rangelength:function(value,element,param){var length=$.isArray(value)?value.length:this.getLength(value,element);return this.optional(element)||(length>=param[0]&&length<=param[1])},min:function(value,element,param){return this.optional(element)||value>=param},max:function(value,element,param){return this.optional(element)||value<=param},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1])},step:function(value,element,param){var type=$(element).attr("type"),errorMessage="Step attribute on input type "+type+" is not supported.",supportedTypes=["text","number","range"],re=new RegExp("\\b"+type+"\\b"),notSupported=type&&!re.test(supportedTypes.join()),decimalPlaces=function(num){var match=(""+num).match(/(?:\.(\d+))?$/);if(!match){return 0} 1271return match[1]?match[1].length:0},toInt=function(num){return Math.round(num*Math.pow(10,decimals))},valid=!0,decimals;if(notSupported){throw new Error(errorMessage)} 1272decimals=decimalPlaces(param);if(decimalPlaces(value)>decimals||toInt(value)%toInt(param)!==0){valid=!1} 1273return this.optional(element)||valid},equalTo:function(value,element,param){var target=$(param);if(this.settings.onfocusout&&target.not(".validate-equalTo-blur").length){target.addClass("validate-equalTo-blur").on("blur.validate-equalTo",function(){$(element).valid()})} 1274return value===target.val()},remote:function(value,element,param,method){if(this.optional(element)){return "dependency-mismatch"}
1275method=typeof method==="string"&&method||"remote";var previous=this.previousValue(element,method),validator,data,optionDataString;if(!this.settings.messages[element.name]){this.settings.messages[element.name]={}} 1276previous.originalMessage=previous.originalMessage||this.settings.messages[element.name][method];this.settings.messages[element.name][method]=previous.message;param=typeof param==="string"&&{url:param}||param;optionDataString=$.param($.extend({data:value},param.data));if(previous.old===optionDataString){return previous.valid} 1277previous.old=optionDataString;validator=this;this.startRequest(element);data={};data[element.name]=value;$.ajax($.extend(!0,{mode:"abort",port:"validate"+element.name,dataType:"json",data:data,context:validator.currentForm,success:function(response){var valid=response===!0||response==="true",errors,message,submitted;validator.settings.messages[element.name][method]=previous.originalMessage;if(valid){submitted=validator.formSubmitted;validator.resetInternals();validator.toHide=validator.errorsFor(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.invalid[element.name]=!1;validator.showErrors()}else{errors={};message=response||validator.defaultMessage(element,{method:method,parameters:value});errors[element.name]=previous.message=message;validator.invalid[element.name]=!0;validator.showErrors(errors)} 1278previous.valid=valid;validator.stopRequest(element,valid)}},param));return "pending"}}});var pendingRequests={},ajax;if($.ajaxPrefilter){$.ajaxPrefilter(function(settings,_,xhr){var port=settings.port;if(settings.mode==="abort"){if(pendingRequests[port]){pendingRequests[port].abort()} 1279pendingRequests[port]=xhr}})}else{ajax=$.ajax;$.ajax=function(settings){var mode=("mode" in settings?settings:$.ajaxSettings).mode,port=("port" in settings?settings:$.ajaxSettings).port;if(mode==="abort"){if(pendingRequests[port]){pendingRequests[port].abort()} 1280pendingRequests[port]=ajax.apply(this,arguments);return pendingRequests[port]} 1281return ajax.apply(this,arguments)}} 1282return $}));(function(){var $,Range,Trie,indexOf=[].indexOf||function(item){for(var i=0,l=this.length;i<l;i++){if(i in this&&this[i]===item)return i}return-1};Trie=(function(){function Trie(){this.trie={}} 1283Trie.prototype.push=function(value){var char,i,j,len,obj,ref,results;value=value.toString();obj=this.trie;ref=value.split('');results=[];for(i=j=0,len=ref.length;j<len;i=++j){char=ref[i];if(obj[char]==null){if(i===(value.length-1)){obj[char]=null}else{obj[char]={}}} 1284results.push(obj=obj[char])} 1285return results};Trie.prototype.find=function(value){var char,i,j,len,obj,ref;value=value.toString();obj=this.trie;ref=value.split('');for(i=j=0,len=ref.length;j<len;i=++j){char=ref[i];if(obj.hasOwnProperty(char)){if(obj[char]===null){return!0}}else{return!1} 1286obj=obj[char]}};return Trie})();Range=(function(){function Range(trie1){this.trie=trie1;if(this.trie.constructor!==Trie){throw Error('Range constructor requires a Trie parameter')}} 1287Range.rangeWithString=function(ranges){var j,k,len,n,r,range,ref,ref1,trie;if(typeof ranges!=='string'){throw Error('rangeWithString requires a string parameter')} 1288ranges=ranges.replace(/ /g,'');ranges=ranges.split(',');trie=new Trie;for(j=0,len=ranges.length;j<len;j++){range=ranges[j];if(r=range.match(/^(\d+)-(\d+)$/)){for(n=k=ref=r[1],ref1=r[2];ref<=ref1?k<=ref1:k>=ref1;n=ref<=ref1?++k:--k){trie.push(n)}}else if(range.match(/^\d+$/)){trie.push(range)}else{throw Error("Invalid range '"+r+"'")}} 1289return new Range(trie)};Range.prototype.match=function(number){return this.trie.find(number)};return Range})();$=jQuery;$.fn.validateCreditCard=function(callback,options){var bind,card,card_type,card_types,get_card_type,is_valid_length,is_valid_luhn,j,len,normalize,ref,validate,validate_number;card_types=[{name:'amex',range:'34,37',valid_length:[15]},{name:'diners_club_carte_blanche',range:'300-305',valid_length:[14]},{name:'diners_club_international',range:'36',valid_length:[14]},{name:'jcb',range:'3528-3589',valid_length:[16]},{name:'laser',range:'6304, 6706, 6709, 6771',valid_length:[16,17,18,19]},{name:'visa_electron',range:'4026, 417500, 4508, 4844, 4913, 4917',valid_length:[16]},{name:'visa',range:'4',valid_length:[13,14,15,16,17,18,19]},{name:'mastercard',range:'51-55,2221-2720',valid_length:[16]},{name:'discover',range:'6011, 622126-622925, 644-649, 65',valid_length:[16]},{name:'dankort',range:'5019',valid_length:[16]},{name:'maestro',range:'50, 56-69',valid_length:[12,13,14,15,16,17,18,19]},{name:'uatp',range:'1',valid_length:[15]}];bind=!1;if(callback){if(typeof callback==='object'){options=callback;bind=!1;callback=null}else if(typeof callback==='function'){bind=!0}} 1290if(options==null){options={}} 1291if(options.accept==null){options.accept=(function(){var j,len,results;results=[];for(j=0,len=card_types.length;j<len;j++){card=card_types[j];results.push(card.name)} 1292return results})()} 1293ref=options.accept;
1293for(j=0,len=ref.length;j<len;j++){card_type=ref[j];if(indexOf.call((function(){var k,len1,results;results=[];for(k=0,len1=card_types.length;k<len1;k++){card=card_types[k];results.push(card.name)} 1294return results})(),card_type)<0){throw Error("Credit card type '"+card_type+"' is not supported")}} 1295get_card_type=function(number){var k,len1,r,ref1;ref1=(function(){var l,len1,ref1,results;results=[];for(l=0,len1=card_types.length;l<len1;l++){card=card_types[l];if(ref1=card.name,indexOf.call(options.accept,ref1)>=0){results.push(card)}} 1296return results})();for(k=0,len1=ref1.length;k<len1;k++){card_type=ref1[k];r=Range.rangeWithString(card_type.range);if(r.match(number)){return card_type}} 1297return null};is_valid_luhn=function(number){var digit,k,len1,n,ref1,sum;sum=0;ref1=number.split('').reverse();for(n=k=0,len1=ref1.length;k<len1;n=++k){digit=ref1[n];digit=+digit;if(n%2){digit*=2;if(digit<10){sum+=digit}else{sum+=digit-9}}else{sum+=digit}} 1298return sum%10===0};is_valid_length=function(number,card_type){var ref1;return ref1=number.length,indexOf.call(card_type.valid_length,ref1)>=0};validate_number=function(number){var length_valid,luhn_valid;card_type=get_card_type(number);luhn_valid=!1;length_valid=!1;if(card_type!=null){luhn_valid=is_valid_luhn(number);length_valid=is_valid_length(number,card_type)} 1299return{card_type:card_type,valid:luhn_valid&&length_valid,luhn_valid:luhn_valid,length_valid:length_valid}};validate=(function(_this){return function(){var number;number=normalize($(_this).val());return validate_number(number)}})(this);normalize=function(number){return number.replace(/[ -]/g,'')};if(!bind){return validate()} 1300this.on('input.jccv',(function(_this){return function(){$(_this).off('keyup.jccv');return callback.call(_this,validate())}})(this));this.on('keyup.jccv',(function(_this){return function(){return callback.call(_this,validate())}})(this));callback.call(this,validate());return this}}).call(this);function ccValid(el){element=$('#'+el.id);var result=element.validateCreditCard({accept:accepted_cards});if(result.valid){element.addClass('valid');element.addClass(result.card_type.name);$('#cc_type').val(result.card_type.name)}else{element.removeClass('valid');element.removeClass('visa');element.removeClass('visa_electron');element.removeClass('maestro');element.removeClass('mastercard');element.removeClass('discover')} 1301return result.valid;return!1} 1302jQuery.validator.addMethod("cc_valid",function(value,element,params){return this.optional(element)||ccValid(element)},jQuery.validator.format("Invalid number"));jQuery.validator.addMethod("cc_exp_valid",function(value,element,params){console.warn({value,element,params});if(value.length<5){return!1} 1303var month=value.substr(0,2);var year=value.substr(3,2);return moment('20'+year+'-'+month+'-01').isSameOrAfter(moment(),'month')},jQuery.validator.format("Invalid expiration"));!function(i){"use strict";"function"==typeof define&&define.amd?define(["jquery"],i):"undefined"!=typeof exports?module.exports=i(require("jquery")):i(jQuery)}(function(i){"use strict";var e=window.Slick||{};(e=function(){var e=0;return function(t,o){var s,n=this;n.defaults={accessibility:!0,adaptiveHeight:!1,appendArrows:i(t),appendDots:i(t),arrows:!0,asNavFor:null,prevArrow:'<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',nextArrow:'<button class="slick-next" aria-label="Next" type="button">Next</button>',autoplay:!1,autoplaySpeed:3e3,centerMode:!1,centerPadding:"50px",cssEase:"ease",customPaging:function(e,t){return i('<button type="button" />').text(t+1)},dots:!1,dotsClass:"slick-dots",draggable:!0,easing:"linear",edgeFriction:.35,fade:!1,focusOnSelect:!1,focusOnChange:!1,infinite:!0,initialSlide:0,lazyLoad:"ondemand",mobileFirst:!1,pauseOnHover:!0,pauseOnFocus:!0,pauseOnDotsHover:!1,respondTo:"window",responsive:null,rows:1,rtl:!1,slide:"",slidesPerRow:1,slidesToShow:1,slidesToScroll:1,speed:500,swipe:!0,swipeToSlide:!1,touchMove:!0,touchThreshold:5,useCSS:!0,useTransform:!0,variableWidth:!1,vertical:!1,verticalSwiping:!1,waitForAnimate:!0,zIndex:1e3},n.initials={animating:!1,dragging:!1,autoPlayTimer:null,currentDirection:0,currentLeft:null,currentSlide:0,direction:1,$dots:null,listWidth:null,listHeight:null,loadIndex:0,$nextArrow:null,$prevArrow:null,scrolling:!1,slideCount:null,slideWidth:null,$slideTrack:null,$slides:null,
1303sliding:!1,slideOffset:0,swipeLeft:null,swiping:!1,$list:null,touchObject:{},transformsEnabled:!1,unslicked:!1},i.extend(n,n.initials),n.activeBreakpoint=null,n.animType=null,n.animProp=null,n.breakpoints=[],n.breakpointSettings=[],n.cssTransitions=!1,n.focussed=!1,n.interrupted=!1,n.hidden="hidden",n.paused=!0,n.positionProp=null,n.respondTo=null,n.rowCount=1,n.shouldClick=!0,n.$slider=i(t),n.$slidesCache=null,n.transformType=null,n.transitionType=null,n.visibilityChange="visibilitychange",n.windowWidth=0,n.windowTimer=null,s=i(t).data("slick")||{},n.options=i.extend({},n.defaults,o,s),n.currentSlide=n.options.initialSlide,n.originalSettings=n.options,void 0!==document.mozHidden?(n.hidden="mozHidden",n.visibilityChange="mozvisibilitychange"):void 0!==document.webkitHidden&&(n.hidden="webkitHidden",n.visibilityChange="webkitvisibilitychange"),n.autoPlay=i.proxy(n.autoPlay,n),n.autoPlayClear=i.proxy(n.autoPlayClear,n),n.autoPlayIterator=i.proxy(n.autoPlayIterator,n),n.changeSlide=i.proxy(n.changeSlide,n),n.clickHandler=i.proxy(n.clickHandler,n),n.selectHandler=i.proxy(n.selectHandler,n),n.setPosition=i.proxy(n.setPosition,n),n.swipeHandler=i.proxy(n.swipeHandler,n),n.dragHandler=i.proxy(n.dragHandler,n),n.keyHandler=i.proxy(n.keyHandler,n),n.instanceUid=e++,n.htmlExpr=/^(?:\s*(<[\w\W]+>)[^>]*)$/,n.registerBreakpoints(),n.init(!0)}}()).prototype.activateADA=function(){this.$slideTrack.find(".slick-active").attr({"aria-hidden":"false"}).find("a, input, button, select").attr({tabindex:"0"})},e.prototype.addSlide=e.prototype.slickAdd=function(e,t,o){var s=this;if("boolean"==typeof t)o=t,t=null;else if(t<0||t>=s.slideCount)return!1;s.unload(),"number"==typeof t?0===t&&0===s.$slides.length?i(e).appendTo(s.$slideTrack):o?i(e).insertBefore(s.$slides.eq(t)):i(e).insertAfter(s.$slides.eq(t)):!0===o?i(e).prependTo(s.$slideTrack):i(e).appendTo(s.$slideTrack),s.$slides=s.$slideTrack.children(this.options.slide),s.$slideTrack.children(this.options.slide).detach(),s.$slideTrack.append(s.$slides),s.$slides.each(function(e,t){i(t).attr("data-slick-index",e)}),s.$slidesCache=s.$slides,s.reinit()},e.prototype.animateHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.animate({height:e},i.options.speed)}},e.prototype.animateSlide=function(e,t){var o={},s=this;s.animateHeight(),!0===s.options.rtl&&!1===s.options.vertical&&(e=-e),!1===s.transformsEnabled?!1===s.options.vertical?s.$slideTrack.animate({left:e},s.options.speed,s.options.easing,t):s.$slideTrack.animate({top:e},s.options.speed,s.options.easing,t):!1===s.cssTransitions?(!0===s.options.rtl&&(s.currentLeft=-s.currentLeft),i({animStart:s.currentLeft}).animate({animStart:e},{duration:s.options.speed,easing:s.options.easing,step:function(i){i=Math.ceil(i),!1===s.options.vertical?(o[s.animType]="translate("+i+"px, 0px)",s.$slideTrack.css(o)):(o[s.animType]="translate(0px,"+i+"px)",s.$slideTrack.css(o))},complete:function(){t&&t.call()}})):(s.applyTransition(),e=Math.ceil(e),!1===s.options.vertical?o[s.animType]="translate3d("+e+"px, 0px, 0px)":o[s.animType]="translate3d(0px,"+e+"px, 0px)",s.$slideTrack.css(o),t&&setTimeout(function(){s.disableTransition(),t.call()},s.options.speed))},e.prototype.getNavTarget=function(){var e=this,t=e.options.asNavFor;return t&&null!==t&&(t=i(t).not(e.$slider)),t},e.prototype.asNavFor=function(e){var t=this.getNavTarget();null!==t&&"object"==typeof t&&t.each(function(){var t=i(this).slick("getSlick");t.unslicked||t.slideHandler(e,!0)})},e.prototype.applyTransition=function(i){var e=this,t={};!1===e.options.fade?t[e.transitionType]=e.transformType+" "+e.options.speed+"ms "+e.options.cssEase:t[e.transitionType]="opacity "+e.options.speed+"ms "+e.options.cssEase,!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.autoPlay=function(){var i=this;i.autoPlayClear(),i.slideCount>i.options.slidesToShow&&(i.autoPlayTimer=setInterval(i.autoPlayIterator,i.options.autoplaySpeed))},e.prototype.autoPlayClear=function(){var i=this;i.autoPlayTimer&&clearInterval(i.autoPlayTimer)},e.prototype.autoPlayIterator=function(){var i=this,e=i.currentSlide+i.options.slidesToScroll;i.paused||i.interrupted||i.focussed||(!1===i.options.infinite&&(1===i.direction&&i.currentSlide+1===i.slideCount-1?i.direction=0:0===i.direction&&(e=i.currentSlide-i.options.slidesToScroll,i.currentSlide-1==0&&(i.direction=1))),i.slideHandler(e))},e.prototype.buildArrows=function(){var e=this;!0===e.options.arrows&&(e.$prevArrow=i(e.options.prevArrow).addClass("slick-arrow"),e.$nextArrow=i(e.options.nextArrow).addClass("slick-arrow"),e.slideCount>e.options.slidesToShow?(e.$prevArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.$nextArrow.removeClass("slick-hidden").removeAttr("aria-hidden tabindex"),e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.prependTo(e.options.appendArrows),e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.appendTo(e.options.appendArrows),!0!==e.options.infinite&&e.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true")):e.$prevArrow.add(e.$nextArrow).addClass("slick-hidden").attr({"aria-disabled":"true",tabindex:"-1"}))},e.prototype.buildDots=function(){var e,t,o=this;if(!0===o.options.dots){for(o.$slider.addClass("slick-dotted"),t=i("<ul />").addClass(o.options.dotsClass),e=0;e<=o.getDotCount();e+=1)t.append(i("<li />").append(o.options.customPaging.call(this,o,e)));o.$dots=t.appendTo(o.options.appendDots),o.$dots.find("li").first().addClass("slick-active")}},e.prototype.buildOut=function(){var e=this;e.$slides=e.$slider.children(e.options.slide+":not(.slick-cloned)").addClass("slick-slide"),e.slideCount=e.$slides.length,e.$slides.each(function(e,t){i(t).attr("data-slick-index",e).data("originalStyling",i(t).attr("style")||"")}),e.$slider.addClass("slick-slider"),e.$slideTrack=0===e.slideCount?i('<div class="slick-track"/>').appendTo(e.$slider):e.$slides.wrapAll('<div class="slick-track"/>').parent(),e.$list=e.$slideTrack.wrap('<div class="slick-list"/>').parent(),e.$slideTrack.css("opacity",0),!0!==e.options.centerMode&&!0!==e.options.swipeToSlide||(e.options.slidesToScroll=1),i("img[data-lazy]",e.$slider).not("[src]").addClass("slick-loading"),e.setupInfinite(),e.buildArrows(),e.buildDots(),e.updateDots(),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),!0===e.options.draggable&&e.$list.addClass("draggable")},e.prototype.buildRows=function(){var i,e,t,o,s,n,r,l=this;if(o=document.createDocumentFragment(),n=l.$slider.children(),l.o
1303ptions.rows>1){for(r=l.options.slidesPerRow*l.options.rows,s=Math.ceil(n.length/r),i=0;i<s;i++){var d=document.createElement("div");for(e=0;e<l.options.rows;e++){var a=document.createElement("div");for(t=0;t<l.options.slidesPerRow;t++){var c=i*r+(e*l.options.slidesPerRow+t);n.get(c)&&a.appendChild(n.get(c))}d.appendChild(a)}o.appendChild(d)}l.$slider.empty().append(o),l.$slider.children().children().children().css({width:100/l.options.slidesPerRow+"%",display:"inline-block"})}},e.prototype.checkResponsive=function(e,t){var o,s,n,r=this,l=!1,d=r.$slider.width(),a=window.innerWidth||i(window).width();if("window"===r.respondTo?n=a:"slider"===r.respondTo?n=d:"min"===r.respondTo&&(n=Math.min(a,d)),r.options.responsive&&r.options.responsive.length&&null!==r.options.responsive){s=null;for(o in r.breakpoints)r.breakpoints.hasOwnProperty(o)&&(!1===r.originalSettings.mobileFirst?n<r.breakpoints[o]&&(s=r.breakpoints[o]):n>r.breakpoints[o]&&(s=r.breakpoints[o]));null!==s?null!==r.activeBreakpoint?(s!==r.activeBreakpoint||t)&&(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):(r.activeBreakpoint=s,"unslick"===r.breakpointSettings[s]?r.unslick(s):(r.options=i.extend({},r.originalSettings,r.breakpointSettings[s]),!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e)),l=s):null!==r.activeBreakpoint&&(r.activeBreakpoint=null,r.options=r.originalSettings,!0===e&&(r.currentSlide=r.options.initialSlide),r.refresh(e),l=s),e||!1===l||r.$slider.trigger("breakpoint",[r,l])}},e.prototype.changeSlide=function(e,t){var o,s,n,r=this,l=i(e.currentTarget);switch(l.is("a")&&e.preventDefault(),l.is("li")||(l=l.closest("li")),n=r.slideCount%r.options.slidesToScroll!=0,o=n?0:(r.slideCount-r.currentSlide)%r.options.slidesToScroll,e.data.message){case"previous":s=0===o?r.options.slidesToScroll:r.options.slidesToShow-o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide-s,!1,t);break;case"next":s=0===o?r.options.slidesToScroll:o,r.slideCount>r.options.slidesToShow&&r.slideHandler(r.currentSlide+s,!1,t);break;case"index":var d=0===e.data.index?0:e.data.index||l.index()*r.options.slidesToScroll;r.slideHandler(r.checkNavigable(d),!1,t),l.children().trigger("focus");break;default:return}},e.prototype.checkNavigable=function(i){var e,t;if(e=this.getNavigableIndexes(),t=0,i>e[e.length-1])i=e[e.length-1];else for(var o in e){if(i<e[o]){i=t;break}t=e[o]}return i},e.prototype.cleanUpEvents=function(){var e=this;e.options.dots&&null!==e.$dots&&(i("li",e.$dots).off("click.slick",e.changeSlide).off("mouseenter.slick",i.proxy(e.interrupt,e,!0)).off("mouseleave.slick",i.proxy(e.interrupt,e,!1)),!0===e.options.accessibility&&e.$dots.off("keydown.slick",e.keyHandler)),e.$slider.off("focus.slick blur.slick"),!0===e.options.arrows&&e.slideCount>e.options.slidesToShow&&(e.$prevArrow&&e.$prevArrow.off("click.slick",e.changeSlide),e.$nextArrow&&e.$nextArrow.off("click.slick",e.changeSlide),!0===e.options.accessibility&&(e.$prevArrow&&e.$prevArrow.off("keydown.slick",e.keyHandler),e.$nextArrow&&e.$nextArrow.off("keydown.slick",e.keyHandler))),e.$list.off("touchstart.slick mousedown.slick",e.swipeHandler),e.$list.off("touchmove.slick mousemove.slick",e.swipeHandler),e.$list.off("touchend.slick mouseup.slick",e.swipeHandler),e.$list.off("touchcancel.slick mouseleave.
1303slick",e.swipeHandler),e.$list.off("click.slick",e.clickHandler),i(document).off(e.visibilityChange,e.visibility),e.cleanUpSlideEvents(),!0===e.options.accessibility&&e.$list.off("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().off("click.slick",e.selectHandler),i(window).off("orientationchange.slick.slick-"+e.instanceUid,e.orientationChange),i(window).off("resize.slick.slick-"+e.instanceUid,e.resize),i("[draggable!=true]",e.$slideTrack).off("dragstart",e.preventDefault),i(window).off("load.slick.slick-"+e.instanceUid,e.setPosition)},e.prototype.cleanUpSlideEvents=function(){var e=this;e.$list.off("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.off("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.cleanUpRows=function(){var i,e=this;e.options.rows>1&&((i=e.$slides.children().children()).removeAttr("style"),e.$slider.empty().append(i))},e.prototype.clickHandler=function(i){!1===this.shouldClick&&(i.stopImmediatePropagation(),i.stopPropagation(),i.preventDefault())},e.prototype.destroy=function(e){var t=this;t.autoPlayClear(),t.touchObject={},t.cleanUpEvents(),i(".slick-cloned",t.$slider).detach(),t.$dots&&t.$dots.remove(),t.$prevArrow&&t.$prevArrow.length&&(t.$prevArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.prevArrow)&&t.$prevArrow.remove()),t.$nextArrow&&t.$nextArrow.length&&(t.$nextArrow.removeClass("slick-disabled slick-arrow slick-hidden").removeAttr("aria-hidden aria-disabled tabindex").css("display",""),t.htmlExpr.test(t.options.nextArrow)&&t.$nextArrow.remove()),t.$slides&&(t.$slides.removeClass("slick-slide slick-active slick-center slick-visible slick-current").removeAttr("aria-hidden").removeAttr("data-slick-index").each(function(){i(this).attr("style",i(this).data("originalStyling"))}),t.$slideTrack.children(this.options.slide).detach(),t.$slideTrack.detach(),t.$list.detach(),t.$slider.append(t.$slides)),t.cleanUpRows(),t.$slider.removeClass("slick-slider"),t.$slider.removeClass("slick-initialized"),t.$slider.removeClass("slick-dotted"),t.unslicked=!0,e||t.$slider.trigger("destroy",[t])},e.prototype.disableTransition=function(i){var e=this,t={};t[e.transitionType]="",!1===e.options.fade?e.$slideTrack.css(t):e.$slides.eq(i).css(t)},e.prototype.fadeSlide=function(i,e){var t=this;!1===t.cssTransitions?(t.$slides.eq(i).css({zIndex:t.options.zIndex}),t.$slides.eq(i).animate({opacity:1},t.options.speed,t.options.easing,e)):(t.applyTransition(i),t.$slides.eq(i).css({opacity:1,zIndex:t.options.zIndex}),e&&setTimeout(function(){t.disableTransition(i),e.call()},t.options.speed))},e.prototype.fadeSlideOut=function(i){var e=this;!1===e.cssTransitions?e.$slides.eq(i).animate({opacity:0,zIndex:e.options.zIndex-2},e.options.speed,e.options.easing):(e.applyTransition(i),e.$slides.eq(i).css({opacity:0,zIndex:e.options.zIndex-2}))},e.prototype.filterSlides=e.prototype.slickFilter=function(i){var e=this;null!==i&&(e.$slidesCache=e.$slides,e.unload(),e.$slideTrack.children(this.options.slide).detach(),e.$slidesCache.filter(i).appendTo(e.$slideTrack),e.reinit())},e.prototype.focusHandler=function(){var e=this;e.$slider.off("focus.slick blur.slick").on("focus.slick blur.slick","*",function(t){t.stopImmediatePropagation();var o=i(this);setTimeout(function(){e.options.pauseOnFocus&&(e.focussed=o.is(":focus"),e.autoPlay())},0)})},e.prototype.getCurrent=e.prototype.slickCurrentSlide=function(){return this.currentSlide},e.prototype.getDotCount=function(){var i=this,e=0,t=0,o=0;if(!0===i.options.infinite)if(i.slideCount<=i.options.slidesToShow)++o;else for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else if(!0===i.options.centerMode)o=i.slideCount;else if(i.options.asNavFor)for(;e<i.slideCount;)++o,e=t+i.options.slidesToScroll,t+=i.options.slidesToScroll<=i.options.slidesToShow?i.options.slidesToScroll:i.options.slidesToShow;else o=1+Math.ceil((i.slideCount-i.options.slidesToShow)/i.options.slidesToScroll);return o-1},e.prototype.getLeft=function(i){var e,t,o,s,n=this,r=0;return n.slideOffset=0,t=n.$slides.first().outerHeight(!0),!0===n.options.infinite?(n.slideCount>n.options.slidesToShow&&(n.slideOffset=n.slideWidth*n.options.slidesToShow*-1,s=-1,!0===n.options.vertical&&!0===n.options.centerMode&&(2===n.options.slidesToShow?s=-1.5:1===n.options.slidesToShow&&(s=-2)),r=t*n.options.slidesToShow*s),n.slideCount%n.options.slidesToScroll!=0&&i+n.options.slidesToScroll>n.slideCount&&n.slideCount>n.options.slidesToShow&&(i>n.slideCount?(n.slideOffset=(n.options.slidesToShow-(i-n.slideCount))*n.slideWidth*-1,r=(n.options.slidesToShow-(i-n.slideCount))*t*-1):(n.slideOffset=n.slideCount%n.options.slidesToScroll*n.slideWidth*-1,r=n.slideCount%n.options.slidesToScroll*t*-1))):i+n.options.slidesToShow>n.slideCount&&(n.slideOffset=(i+n.options.slidesToShow-n.slideCount)*n.slideWidth,r=(i+n.options.slidesToShow-n.slideCount)*t),n.slideCount<=n.options.slidesToShow&&(n.slideOffset=0,r=0),!0===n.options.centerMode&&n.slideCount<=n.options.slidesToShow?n.slideOffset=n.slideWidth*Math.floor(n.options.slidesToShow)/2-n.slideWidth*n.slideCount/2:!0===n.options.centerMode&&!0===n.options.infinite?n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)-n.slideWidth:!0===n.options.centerMode&&(n.slideOffset=0,n.slideOffset+=n.slideWidth*Math.floor(n.options.slidesToShow/2)),e=!1===n.options.vertical?i*n.slideWidth*-1+n.slideOffset:i*t*-1+r,!0===n.options.variableWidth&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,!0===n.options.centerMode&&(o=n.slideCount<=n.options.slidesToShow||!1===n.options.infinite?n.$slideTrack.children(".slick-slide").eq(i):n.$slideTrack.children(".slick-slide").eq(i+n.options.slidesToShow+1),e=!0===n.options.rtl?o[0]?-1*(n.$slideTrack.width()-o[0].offsetLeft-o.width()):0:o[0]?-1*o[0].offsetLeft:0,e+=(n.$list.width()-o.outerWidth())/2)),e},e.prototype.getOption=e.prototype.slickGetOption=function(i){return this.options[i]},e.prototype.getNavigableIndexes=function(){var i,e=this,t=0,o=0,s=[];for(!1===e.options.infinite?i=e.slideCount:(t=-1*e.options.slidesToScroll,o=-1*e.options.slidesToScroll,i=2*e.slideCount);t<i;)s.push(t),t=o+e.options.slidesToScroll,o+=e.options.slidesToScroll<=e.options.slidesToShow?e.options.slidesToScroll:e.options.slidesToShow;return s},e.prototype.getSlick=function(){return this},e.prototype.getSlideCount=function(){var e,t,o=this;return t=!0===o.options.centerMode?o.slideWidth*Math.floor(o.options.slidesToShow/2):0,!0===o.options.swipeToSlide?(o.$slideTrack.find(".slick-slide").each(function(s,n){if(n.offsetLeft-t+i(n).outerWidth()/2>-1*o.swipeLeft)return e=n,!1}),Math.abs(i(e).attr("data-slick-index")-o.currentSlide)||1):o.options.slidesToScroll},e.prototype.goTo=e.prototype.slickGoTo=function(i,e){this.changeSlide({data:{message:"index",index:
1303parseInt(i)}},e)},e.prototype.init=function(e){var t=this;i(t.$slider).hasClass("slick-initialized")||(i(t.$slider).addClass("slick-initialized"),t.buildRows(),t.buildOut(),t.setProps(),t.startLoad(),t.loadSlider(),t.initializeEvents(),t.updateArrows(),t.updateDots(),t.checkResponsive(!0),t.focusHandler()),e&&t.$slider.trigger("init",[t]),!0===t.options.accessibility&&t.initADA(),t.options.autoplay&&(t.paused=!1,t.autoPlay())},e.prototype.initADA=function(){var e=this,t=Math.ceil(e.slideCount/e.options.slidesToShow),o=e.getNavigableIndexes().filter(function(i){return i>=0&&i<e.slideCount});e.$slides.add(e.$slideTrack.find(".slick-cloned")).attr({"aria-hidden":"true",tabindex:"-1"}).find("a, input, button, select").attr({tabindex:"-1"}),null!==e.$dots&&(e.$slides.not(e.$slideTrack.find(".slick-cloned")).each(function(t){var s=o.indexOf(t);i(this).attr({role:"tabpanel",id:"slick-slide"+e.instanceUid+t,tabindex:-1}),-1!==s&&i(this).attr({"aria-describedby":"slick-slide-control"+e.instanceUid+s})}),e.$dots.attr("role","tablist").find("li").each(function(s){var n=o[s];i(this).attr({role:"presentation"}),i(this).find("button").first().attr({role:"tab",id:"slick-slide-control"+e.instanceUid+s,"aria-controls":"slick-slide"+e.instanceUid+n,"aria-label":s+1+" of "+t,"aria-selected":null,tabindex:"-1"})}).eq(e.currentSlide).find("button").attr({"aria-selected":"true",tabindex:"0"}).end());for(var s=e.currentSlide,n=s+e.options.slidesToShow;s<n;s++)e.$slides.eq(s).attr("tabindex",0);e.activateADA()},e.prototype.initArrowEvents=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.off("click.slick").on("click.slick",{message:"previous"},i.changeSlide),i.$nextArrow.off("click.slick").on("click.slick",{message:"next"},i.changeSlide),!0===i.options.accessibility&&(i.$prevArrow.on("keydown.slick",i.keyHandler),i.$nextArrow.on("keydown.slick",i.keyHandler)))},e.prototype.initDotEvents=function(){var e=this;!0===e.options.dots&&(i("li",e.$dots).on("click.slick",{message:"index"},e.changeSlide),!0===e.options.accessibility&&e.$dots.on("keydown.slick",e.keyHandler)),!0===e.options.dots&&!0===e.options.pauseOnDotsHover&&i("li",e.$dots).on("mouseenter.slick",i.proxy(e.interrupt,e,!0)).on("mouseleave.slick",i.proxy(e.interrupt,e,!1))},e.prototype.initSlideEvents=function(){var e=this;e.options.pauseOnHover&&(e.$list.on("mouseenter.slick",i.proxy(e.interrupt,e,!0)),e.$list.on("mouseleave.slick",i.proxy(e.interrupt,e,!1)))},e.prototype.initializeEvents=function(){var e=this;e.initArrowEvents(),e.initDotEvents(),e.initSlideEvents(),e.$list.on("touchstart.slick mousedown.slick",{action:"start"},e.swipeHandler),e.$list.on("touchmove.slick mousemove.slick",{action:"move"},e.swipeHandler),e.$list.on("touchend.slick mouseup.slick",{action:"end"}
1303,e.swipeHandler),e.$list.on("touchcancel.slick mouseleave.slick",{action:"end"},e.swipeHandler),e.$list.on("click.slick",e.clickHandler),i(document).on(e.visibilityChange,i.proxy(e.visibility,e)),!0===e.options.accessibility&&e.$list.on("keydown.slick",e.keyHandler),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),i(window).on("orientationchange.slick.slick-"+e.instanceUid,i.proxy(e.orientationChange,e)),i(window).on("resize.slick.slick-"+e.instanceUid,i.proxy(e.resize,e)),i("[draggable!=true]",e.$slideTrack).on("dragstart",e.preventDefault),i(window).on("load.slick.slick-"+e.instanceUid,e.setPosition),i(e.setPosition)},e.prototype.initUI=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.show(),i.$nextArrow.show()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.show()},e.prototype.keyHandler=function(i){var e=this;i.target.tagName.match("TEXTAREA|INPUT|SELECT")||(37===i.keyCode&&!0===e.options.accessibility?e.changeSlide({data:{message:!0===e.options.rtl?"next":"previous"}}):39===i.keyCode&&!0===e.options.accessibility&&e.changeSlide({data:{message:!0===e.options.rtl?"previous":"next"}}))},e.prototype.lazyLoad=function(){function e(e){i("img[data-lazy]",e).each(function(){var e=i(this),t=i(this).attr("data-lazy"),o=i(this).attr("data-srcset"),s=i(this).attr("data-sizes")||n.$slider.attr("data-sizes"),r=document.createElement("img");r.onload=function(){e.animate({opacity:0}
vendor: 5,619 bytes, line 1303
1303,100,function(){o&&(e.attr("srcset",o),s&&e.attr("sizes",s)),e.attr("src",t).animate({opacity:1},200,function(){e.removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading")}),n.$slider.trigger("lazyLoaded",[n,e,t])})},r.onerror=function(){e.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),n.$slider.trigger("lazyLoadError",[n,e,t])},r.src=t})}var t,o,s,n=this;if(!0===n.options.centerMode?!0===n.options.infinite?s=(o=n.currentSlide+(n.options.slidesToShow/2+1))+n.options.slidesToShow+2:(o=Math.max(0,n.currentSlide-(n.options.slidesToShow/2+1)),s=n.options.slidesToShow/2+1+2+n.currentSlide):(o=n.options.infinite?n.options.slidesToShow+n.currentSlide:n.currentSlide,s=Math.ceil(o+n.options.slidesToShow),!0===n.options.fade&&(o>0&&o--,s<=n.slideCount&&s++)),t=n.$slider.find(".slick-slide").slice(o,s),"anticipated"===n.options.lazyLoad)for(var r=o-1,l=s,d=n.$slider.find(".slick-slide"),a=0;a<n.options.slidesToScroll;a++)r<0&&(r=n.slideCount-1),t=(t=t.add(d.eq(r))).add(d.eq(l)),r--,l++;e(t),n.slideCount<=n.options.slidesToShow?e(n.$slider.find(".slick-slide")):n.currentSlide>=n.slideCount-n.options.slidesToShow?e(n.$slider.find(".slick-cloned").slice(0,n.options.slidesToShow)):0===n.currentSlide&&e(n.$slider.find(".slick-cloned").slice(-1*n.options.slidesToShow))},e.prototype.loadSlider=function(){var i=this;i.setPosition(),i.$slideTrack.css({opacity:1}),i.$slider.removeClass("slick-loading"),i.initUI(),"progressive"===i.options.lazyLoad&&i.progressiveLazyLoad()},e.prototype.next=e.prototype.slickNext=function(){this.changeSlide({data:{message:"next"}})},e.prototype.orientationChange=function(){var i=this;i.checkResponsive(),i.setPosition()},e.prototype.pause=e.prototype.slickPause=function(){var i=this;i.autoPlayClear(),i.paused=!0},e.prototype.play=e.prototype.slickPlay=function(){var i=this;i.autoPlay(),i.options.autoplay=!0,i.paused=!1,i.focussed=!1,i.interrupted=!1},e.prototype.postSlide=function(e){var t=this;t.unslicked||(t.$slider.trigger("afterChange",[t,e]),t.animating=!1,t.slideCount>t.options.slidesToShow&&t.setPosition(),t.swipeLeft=null,t.options.autoplay&&t.autoPlay(),!0===t.options.accessibility&&(t.initADA(),t.options.focusOnChange&&i(t.$slides.get(t.currentSlide)).attr("tabindex",0).focus()))},e.prototype.prev=e.prototype.slickPrev=function(){this.changeSlide({data:{message:"previous"}})},e.prototype.preventDefault=function(i){i.preventDefault()},e.prototype.progressiveLazyLoad=function(e){e=e||1;var t,o,s,n,r,l=this,d=i("img[data-lazy]",l.$slider);d.length?(t=d.first(),o=t.attr("data-lazy"),s=t.attr("data-srcset"),n=t.attr("data-sizes")||l.$slider.attr("data-sizes"),(r=document.createElement("img")).onload=function(){s&&(t.attr("srcset",s),n&&t.attr("sizes",n)),t.attr("src",o).removeAttr("data-lazy data-srcset data-sizes").removeClass("slick-loading"),!0===l.options.adaptiveHeight&&l.setPosition(),l.$slider.trigger("lazyLoaded",[l,t,o]),l.progressiveLazyLoad()},r.onerror=function(){e<3?setTimeout(function(){l.progressiveLazyLoad(e+1)},500):(t.removeAttr("data-lazy").removeClass("slick-loading").addClass("slick-lazyload-error"),l.$slider.trigger("lazyLoadError",[l,t,o]),l.progressiveLazyLoad())},r.src=o):l.$slider.trigger("allImagesLoaded",[l])},e.prototype.refresh=function(e){var t,o,s=this;o=s.slideCount-s.options.slidesToShow,!s.options.infinite&&s.currentSlide>o&&(s.currentSlide=o),s.slideCount<=s.options.slidesToShow&&(s.currentSlide=0),t=s.currentSlide,s.destroy(!0),i.extend(s,s.initials,{currentSlide:t}),s.init(),e||s.changeSlide({data:{message:"index",index:t}},!1)},e.prototype.registerBreakpoints=function(){var e,t,o,s=this,n=s.options.responsive||null;if("array"===i.type(n)&&n.length){s.respondTo=s.options.respondTo||"window";for(e in n)if(o=s.breakpoints.length-1,n.hasOwnProperty(e)){for(t=n[e].breakpoint;o>=0;)s.breakpoints[o]&&s.breakpoints[o]===t&&s.breakpoints.splice(o,1),o--;s.breakpoints.push(t),s.breakpointSettings[t]=n[e].settings}s.breakpoints.sort(function(i,e){return s.options.mobileFirst?i-e:e-i})}},e.prototype.reinit=function(){var e=this;e.$slides=e.$slideTrack.children(e.options.slide).addClass("slick-slide"),e.slideCount=e.$slides.length,e.currentSlide>=e.slideCount&&0!==e.currentSlide&&(e.currentSlide=e.currentSlide-e.options.slidesToScroll),e.slideCount<=e.options.slidesToShow&&(e.currentSlide=0),e.registerBreakpoints(),e.setProps(),e.setupInfinite(),e.buildArrows(),e.updateArrows(),e.initArrowEvents(),e.buildDots(),e.updateDots(),e.initDotEvents(),e.cleanUpSlideEvents(),e.initSlideEvents(),e.checkResponsive(!1,!0),!0===e.options.focusOnSelect&&i(e.$slideTrack).children().on("click.slick",e.selectHandler),e.setSlideClasses("number"==typeof e.currentSlide?e.currentSlide:0),e.setPosition(),e.focusHandler(),e.paused=!e.options.autoplay,e.autoPlay(),e.$slider.trigger("reInit",[e])},e.prototype.resize=function(){var e=this;i(window).width()!==e.windowWidth&&(clearTimeout(e.windowDelay),e.windowDelay=window.setTimeout(function(){e.windowWidth=i(window).width(),e.checkResponsive(),e.unslicked||e.setPosition()},50))},e.prototype.removeSlide=e.prototype.slickRemove=function(i,e,t){var o=this;if(i="boolean"==typeof i?!0===(e=i)?0:o.slideCount-1:!0===e?--i:i,o.slideCount<1||i<0||i>o.slideCount-1)return!1;o.unload(),!0===t?o.$slideTrack.children().remove():o.$slideTrack.children(this.options.slide).eq(i).remove(),o.$slides=o.$slideTrack.children(this.options.slide),o.$slideTrack.children(this.options.slide).detach(),o.$slideTrack.append(o.$slides),o.$slidesCache=o.$slides,o.reinit()},e.prototype.setCSS=function(i){var e,t,o=this,s={};
1303!0===o.options.rtl&&(i=-i),e="left"==o.positionProp?Math.ceil(i)+"px":"0px",t="top"==o.positionProp?Math.ceil(i)+"px":"0px",s[o.positionProp]=i,!1===o.transformsEnabled?o.$slideTrack.css(s):(s={},!1===o.cssTransitions?(s[o.animType]="translate("+e+", "+t+")",o.$slideTrack.css(s)):(s[o.animType]="translate3d("+e+", "+t+", 0px)",o.$slideTrack.css(s)))},e.prototype.setDimensions=function(){var i=this;!1===i.options.vertical?!0===i.options.centerMode&&i.$list.css({padding:"0px "+i.options.centerPadding}):(i.$list.height(i.$slides.first().outerHeight(!0)*i.options.slidesToShow),!0===i.options.centerMode&&i.$list.css({padding:i.options.centerPadding+" 0px"})),i.listWidth=i.$list.width(),i.listHeight=i.$list.height(),!1===i.options.vertical&&!1===i.options.variableWidth?(i.slideWidth=Math.ceil(i.listWidth/i.options.slidesToShow),i.$slideTrack.width(Math.ceil(i.slideWidth*i.$slideTrack.children(".slick-slide").length))):!0===i.options.variableWidth?i.$slideTrack.width(5e3*i.slideCount):(i.slideWidth=Math.ceil(i.listWidth),i.$slideTrack.height(Math.ceil(i.$slides.first().outerHeight(!0)*i.$slideTrack.children(".slick-slide").length)));var e=i.$slides.first().outerWidth(!0)-i.$slides.first().width();!1===i.options.variableWidth&&i.$slideTrack.children(".slick-slide").width(i.slideWidth-e)},e.prototype.setFade=function(){var e,t=this;t.$slides.each(function(o,s){e=t.slideWidth*o*-1,!0===t.options.rtl?i(s).css({position:"relative",right:e,top:0,zIndex:t.options.zIndex-2,opacity:0}
1303):i(s).css({position:"relative",left:e,top:0,zIndex:t.options.zIndex-2,opacity:0})}),t.$slides.eq(t.currentSlide).css({zIndex:t.options.zIndex-1,opacity:1})},e.prototype.setHeight=function(){var i=this;if(1===i.options.slidesToShow&&!0===i.options.adaptiveHeight&&!1===i.options.vertical){var e=i.$slides.eq(i.currentSlide).outerHeight(!0);i.$list.css("height",e)}},e.prototype.setOption=e.prototype.slickSetOption=function(){var e,t,o,s,n,r=this,l=!1;if("object"===i.type(arguments[0])?(o=arguments[0],l=arguments[1],n="multiple"):"string"===i.type(arguments[0])&&(o=arguments[0],s=arguments[1],l=arguments[2],"responsive"===arguments[0]&&"array"===i.type(arguments[1])?n="responsive":void 0!==arguments[1]&&(n="single")),"single"===n)r.options[o]=s;else if("multiple"===n)i.each(o,function(i,e){r.options[i]=e});else if("responsive"===n)for(t in s)if("array"!==i.type(r.options.responsive))r.options.responsive=[s[t]];else{for(e=r.options.responsive.length-1;e>=0;)r.options.responsive[e].breakpoint===s[t].breakpoint&&r.options.responsive.splice(e,1),e--;r.options.responsive.push(s[t])}l&&(r.unload(),r.reinit())},e.prototype.setPosition=function(){var i=this;i.setDimensions(),i.setHeight(),!1===i.options.fade?i.setCSS(i.getLeft(i.currentSlide)):i.setFade(),i.$slider.trigger("setPosition",[i])},e.prototype.setProps=function(){var i=this,e=document.body.style;i.positionProp=!0===i.options.vertical?"top":"left","top"===i.positionProp?i.$slider.addClass("slick-vertical"):i.$slider.removeClass("slick-vertical"),void 0===e.WebkitTransition&&void 0===e.MozTransition&&void 0===e.msTransition||!0===i.options.useCSS&&(i.cssTransitions=!0),i.options.fade&&("number"==typeof i.options.zIndex?i.options.zIndex<3&&(i.options.zIndex=3):i.options.zIndex=i.defaults.zIndex),void 0!==e.OTransform&&(i.animType="OTransform",i.transformType="-o-transform",i.transitionType="OTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.MozTransform&&(i.animType="MozTransform",i.transformType="-moz-transform",i.transitionType="MozTransition",void 0===e.perspectiveProperty&&void 0===e.MozPerspective&&(i.animType=!1)),void 0!==e.webkitTransform&&(i.animType="webkitTransform",i.transformType="-webkit-transform",i.transitionType="webkitTransition",void 0===e.perspectiveProperty&&void 0===e.webkitPerspective&&(i.animType=!1)),void 0!==e.msTransform&&(i.animType="msTransform",i.transformType="-ms-transform",i.transitionType="msTransition",void 0===e.msTransform&&(i.animType=!1)),void 0!==e.transform&&!1!==i.animType&&(i.animType="transform",i.transformType="transform",i.transitionType="transition"),i.transformsEnabled=i.options.useTransform&&null!==i.animType&&!1!==i.animType},e.prototype.setSlideClasses=function(i){var e,t,o,s,n=this;if(t=n.$slider.find(".slick-slide").removeClass("slick-active slick-center slick-current").attr("aria-hidden","true"),n.$slides.eq(i).addClass("slick-current"),!0===n.options.centerMode){var r=n.options.slidesToShow%2==0?1:0;e=Math.floor(n.options.slidesToShow/2),!0===n.options.infinite&&(i>=e&&i<=n.slideCount-1-e?n.$slides.slice(i-e+r,i+e+1).addClass("slick-active").attr("aria-hidden","false"):(o=n.options.slidesToShow+i,t.slice(o-e+1+r,o+e+2).addClass("slick-active").attr("aria-hidden","false")),0===i?t.eq(t.length-1-n.options.slidesToShow).addClass("slick-center"):i===n.slideCount-1&&t.eq(n.options.slidesToShow).addClass("slick-center")),n.$slides.eq(i).addClass("slick-center")}else i>=0&&i<=n.slideCount-n.options.slidesToShow?n.$slides.slice(i,i+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"):t.length<=n.options.slidesToShow?t.addClass("slick-active").attr("aria-hidden","false"):(s=n.slideCount%n.options.slidesToShow,o=!0===n.options.infinite?n.options.slidesToShow+i:i,n.options.slidesToShow==n.options.slidesToScroll&&n.slideCount-i<n.options.slidesToShow?t.slice(o-(n.options.slidesToShow-s),o+s).addClass("slick-active").attr("aria-hidden","false"):t.slice(o,o+n.options.slidesToShow).addClass("slick-active").attr("aria-hidden","false"));"ondemand"!==n.options.lazyLoad&&"anticipated"!==n.options.lazyLoad||n.lazyLoad()},e.prototype.setupInfinite=function(){var e,t,o,s=this;if(!0===s.options.fade&&(s.options.centerMode=!1),!0===s.options.infinite&&!1===s.options.fade&&(t=null,s.slideCount>s.options.slidesToShow)){for(o=!0===s.options.centerMode?s.options.slidesToShow+1:s.options.slidesToShow,e=s.slideCount;e>s.slideCount-o;e-=1)t=e-1,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t-s.slideCount).prependTo(s.$slideTrack).addClass("slick-cloned");for(e=0;e<o+s.slideCount;e+=1)t=e,i(s.$slides[t]).clone(!0).attr("id","").attr("data-slick-index",t+s.slideCount).appendTo(s.$slideTrack).addClass("slick-cloned");s.$slideTrack.find(".slick-cloned").find("[id]").each(function(){i(this).attr("id","")})}},e.prototype.interrupt=function(i){var e=this;i||e.autoPlay(),e.interrupted=i},e.prototype.selectHandler=function(e){var t=this,o=i(e.target).is(".slick-slide")?i(e.target):i(e.target).parents(".slick-slide"),s=parseInt(o.attr("data-slick-index"));s||(s=0),t.slideCount<=t.options.slidesToShow?t.slideHandler(s,!1,!0):t.slideHandler(s)},e.prototype.slideHandler=function(i,e,t){var o,s,n,r,l,d=null,a=this;if(e=e||!1,!(!0===a.animating&&!0===a.options.waitForAnimate||!0===a.options.fade&&a.currentSlide===i))if(!1===e&&a.asNavFor(i),o=i,d=a.getLeft(o),r=a.getLeft(a.currentSlide),a.currentLeft=null===a.swipeLeft?r:a.swipeLeft,!1===a.options.infinite&&!1===a.options.centerMode&&(i<0||i>a.getDotCount()*a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else if(!1===a.options.infinite&&!0===a.options.centerMode&&(i<0||i>a.slideCount-a.options.slidesToScroll))!1===a.options.fade&&(o=a.currentSlide,!0!==t?a.animateSlide(r,function(){a.postSlide(o)}):a.postSlide(o));else{if(a.options.autoplay&&clearInterval(a.autoPlayTimer),s=o<0?a.slideCount%a.options.slidesToScroll!=0?a.slideCount-a.slideCount%a.options.slidesToScroll:a.slideCount+
1303o:o>=a.slideCount?a.slideCount%a.options.slidesToScroll!=0?0:o-a.slideCount:o,a.animating=!0,a.$slider.trigger("beforeChange",[a,a.currentSlide,s]),n=a.currentSlide,a.currentSlide=s,a.setSlideClasses(a.currentSlide),a.options.asNavFor&&(l=(l=a.getNavTarget()).slick("getSlick")).slideCount<=l.options.slidesToShow&&l.setSlideClasses(a.currentSlide),a.updateDots(),a.updateArrows(),!0===a.options.fade)return!0!==t?(a.fadeSlideOut(n),a.fadeSlide(s,function(){a.postSlide(s)})):a.postSlide(s),void a.animateHeight();!0!==t?a.animateSlide(d,function(){a.postSlide(s)}):a.postSlide(s)}},e.prototype.startLoad=function(){var i=this;!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&(i.$prevArrow.hide(),i.$nextArrow.hide()),!0===i.options.dots&&i.slideCount>i.options.slidesToShow&&i.$dots.hide(),i.$slider.addClass("slick-loading")},e.prototype.swipeDirection=function(){var i,e,t,o,s=this;return i=s.touchObject.startX-s.touchObject.curX,e=s.touchObject.startY-s.touchObject.curY,t=Math.atan2(e,i),(o=Math.round(180*t/Math.PI))<0&&(o=360-Math.abs(o)),o<=45&&o>=0?!1===s.options.rtl?"left":"right":o<=360&&o>=315?!1===s.options.rtl?"left":"right":o>=135&&o<=225?!1===s.options.rtl?"right":"left":!0===s.options.verticalSwiping?o>=35&&o<=135?"down":"up":"vertical"},e.prototype.swipeEnd=function(i){var e,t,o=this;if(o.dragging=!1,o.swiping=!1,o.scrolling)return o.scrolling=!1,!1;if(o.interrupted=!1,o.shouldClick=!(o.touchObject.swipeLength>10),void 0===o.touchObject.curX)return!1;if(!0===o.touchObject.edgeHit&&o.$slider.trigger("edge",[o,o.swipeDirection()]),o.touchObject.swipeLength>=o.touchObject.minSwipe){switch(t=o.swipeDirection()){case"left":case"down":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide+o.getSlideCount()):o.currentSlide+o.getSlideCount(),o.currentDirection=0;break;case"right":case"up":e=o.options.swipeToSlide?o.checkNavigable(o.currentSlide-o.getSlideCount()):o.currentSlide-o.getSlideCount(),o.currentDirection=1}"vertical"!=t&&(o.slideHandler(e),o.touchObject={},o.$slider.trigger("swipe",[o,t]))}else o.touchObject.startX!==o.touchObject.curX&&(o.slideHandler(o.currentSlide),o.touchObject={})},e.prototype.swipeHandler=function(i){var e=this;if(!(!1===e.options.swipe||"ontouchend"in document&&!1===e.options.swipe||!1===e.options.draggable&&-1!==i.type.indexOf("mouse")))switch(e.touchObject.fingerCount=i.originalEvent&&void 0!==i.originalEvent.touches?i.originalEvent.touches.length:1,e.touchObject.minSwipe=e.listWidth/e.options.touchThreshold,!0===e.options.verticalSwiping&&(e.touchObject.minSwipe=e.listHeight/e.options.touchThreshold),i.data.action){case"start":e.swipeStart(i);break;case"move":e.swipeMove(i);break;case"end":e.swipeEnd(i)}},e.prototype.swipeMove=function(i){var e,t,o,s,n,r,l=this;return n=void 0!==i.originalEvent?i.originalEvent.touches:null,!(!l.dragging||l.scrolling||n&&1!==n.length)&&(e=l.getLeft(l.currentSlide),l.touchObject.curX=void 0!==n?n[0].pageX:i.clientX,l.touchObject.curY=void 0!==n?n[0].pageY:i.clientY,l.touchObject.swipeLength=Math.round(Math.sqrt(Math.pow(l.touchObject.curX-l.touchObject.startX,2))),r=Math.round(Math.sqrt(Math.pow(l.touchObject.curY-l.touchObject.startY,2))),!l.options.verticalSwiping&&!l.swiping&&r>4?(l.scrolling=!0,!1):(!0===l.options.verticalSwiping&&(l.touchObject.swipeLength=r),t=l.swipeDirection(),void 0!==i.originalEvent&&l.touchObject.swipeLength>4&&(l.swiping=!0,i.preventDefault()),s=(!1===l.options.rtl?1:-1)*(l.touchObject.curX>l.touchObject.startX?1:-1),!0===l.options.verticalSwiping&&(s=l.touchObject.curY>l.touchObject.startY?1:-1),o=l.touchObject.swipeLength,l.touchObject.edgeHit=!1,!1===l.options.infinite&&(0===l.currentSlide&&"right"===t||l.currentSlide>=l.getDotCount()&&"left"===t)&&(o=l.touchObject.swipeLength*l.options.edgeFriction,l.touchObject.edgeHit=!0),!1===l.options.vertical?l.swipeLeft=e+o*s:l.swipeLeft=e+o*(l.$list.height()/l.listWidth)*s,!0===l.options.verticalSwiping&&(l.swipeLeft=e+o*s),!0!==l.options.fade&&!1!==l.options.touchMove&&(!0===l.animating?(l.swipeLeft=null,!1):void l.setCSS(l.swipeLeft))))},e.prototype.swipeStart=function(i){var e,t=this;if(t.interrupted=!0,1!==t.touchObject.fingerCount||t.slideCount<=t.options.slidesToShow)return t.touchObject={},!1;void 0!==i.originalEvent&&void 0!==i.originalEvent.touches&&(e=i.originalEvent.touches[0]),t.touchObject.startX=t.touchObject.curX=void 0!==e?e.pageX:i.clientX,t.touchObject.startY=t.touchObject.curY=void 0!==e?e.pageY:i.clientY,t.dragging=!0},e.prototype.unfilterSlides=e.prototype.slickUnfilter=function(){var i=this;null!==i.$slidesCache&&(i.unload(),i.$slideTrack.children(this.options.slide).detach(),i.$slidesCache.appendTo(i.$slideTrack),i.reinit())},e.prototype.unload=function(){var e=this;i(".slick-cloned",e.$slider).remove(),e.$dots&&e.$dots.remove(),e.$prevArrow&&e.htmlExpr.test(e.options.prevArrow)&&e.$prevArrow.remove(),e.$nextArrow&&e.htmlExpr.test(e.options.nextArrow)&&e.$nextArrow.remove(),e.$slides.removeClass("slick-slide slick-active slick-visible slick-current").attr("aria-hidden","true").css("width","")}
1303,e.prototype.unslick=function(i){var e=this;e.$slider.trigger("unslick",[e,i]),e.destroy()},e.prototype.updateArrows=function(){var i=this;Math.floor(i.options.slidesToShow/2),!0===i.options.arrows&&i.slideCount>i.options.slidesToShow&&!i.options.infinite&&(i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false"),0===i.currentSlide?(i.$prevArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$nextArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-i.options.slidesToShow&&!1===i.options.centerMode?(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")):i.currentSlide>=i.slideCount-1&&!0===i.options.centerMode&&(i.$nextArrow.addClass("slick-disabled").attr("aria-disabled","true"),i.$prevArrow.removeClass("slick-disabled").attr("aria-disabled","false")))},e.prototype.updateDots=function(){var i=this;null!==i.$dots&&(i.$dots.find("li").removeClass("slick-active").end(),i.$dots.find("li").eq(Math.floor(i.currentSlide/i.options.slidesToScroll)).addClass("slick-active"))},e.prototype.visibility=function(){var i=this;i.options.autoplay&&(document[i.hidden]?i.interrupted=!0:i.interrupted=!1)},i.fn.slick=function(){var i,t,o=this,s=arguments[0],n=Array.prototype.slice.call(arguments,1),r=o.length;for(i=0;i<r;i++)if("object"==typeof s||void 0===s?o[i].slick=new e(o[i],s):t=o[i].slick[s].apply(o[i].slick,n),void 0!==t)return t;return o}});(function(c,d){"function"===typeof define&&define.amd?define(["jquery"],d):"object"===typeof exports?module.exports=d(require("jquery")):c.lightbox=d(c.jQuery)})(this,function(c){function d(a){this.album=[];this.currentImageIndex=void 0;this.init();this.options=c.extend({},this.constructor.defaults);this.option(a)}d.defaults={albumLabel:"Image %1 of %2",alwaysShowNavOnTouchDevices:!1,fadeDuration:600,fitImagesInViewport:!0,imageFadeDuration:600,positionFromTop:50,resizeDuration:700,showImageNumberLabel:!0,wrapAround:!1,disableScrolling:!1,sanitizeTitle:!1};d.prototype.option=function(a){c.extend(this.options,a)};d.prototype.imageCountLabel=function(a,b){return this.options.albumLabel.replace(/%1/g,a).replace(/%2/g,b)};d.prototype.init=function(){var a=this;c(document).ready(function(){a.enable();a.build()})};d.prototype.enable=function(){var a=this;c("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(b){a.start(c(b.currentTarget));return!1})};d.prototype.build=function(){if(!(0<c("#lightbox").length)){var a=this;c('<div id="lightboxOverlay" tabindex="-1" class="lightboxOverlay"></div><div id="lightbox" tabindex="-1" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" alt=""/><div class="lb-nav"><a class="lb-prev" aria-label="Previous image" href="" ></a><a class="lb-next" aria-label="Next image" href="" ></a></div><div class="lb-loader"><a href="javascript:;" class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo(c("body"));this.$lightbox=c("#lightbox");this.$overlay=c("#lightboxOverlay");this.$outerContainer=this.$lightbox.find(".lb-outerContainer");this.$container=this.$lightbox.find(".lb-container");this.$image=this.$lightbox.find(".lb-image");this.$nav=this.$lightbox.find(".lb-nav");this.containerPadding={top:parseInt(this.$container.css("padding-top"),10),right:parseInt(this.$container.css("padding-right"),10),bottom:parseInt(this.$container.css("padding-bottom"),10),left:parseInt(this.$container.css("padding-left"),10)};this.imageBorderWidth={top:parseInt(this.$image.css("border-top-width"),10),right:parseInt(this.$image.css("border-right-width"),10),bottom:parseInt(this.$image.css("border-bottom-width"),10),left:parseInt(this.$image.css("border-left-width"),10)};this.$overlay.hide().on("click",function(){a.end();return!1});this.$lightbox.hide().on("click",function(b){"lightbox"===c(b.target).attr("id")&&a.end()});this.$outerContainer.on("click",function(b){"lightbox"===c(b.target).attr("id")&&a.end();return!1});this.$lightbox.find(".lb-prev").on("click",function(){0===a.currentImageIndex?a.changeImage(a.album.length-1):a.changeImage(a.currentImageIndex-1);return!1});this.$lightbox.find(".lb-next").on("click",function(){a.currentImageIndex===a.album.length-1?a.changeImage(0):a.changeImage(a.currentImageIndex+1);return!1});this.$nav.on("mousedown",function(b){3===b.which&&(a.$nav.css("pointer-events","none"),a.$lightbox.one("contextmenu",function(){setTimeout(function(){this.$nav.css("pointer-events","auto")}.bind(a),0)}))});this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){a.end();return!1})}};d.prototype.start=function(a){function b(a){d.album.push({alt:a.attr("data-alt"),link:a.attr("href"),title:a.attr("data-title")||a.attr("title")})}var d=this,k=c(window);k.on("resize",c.proxy(this.sizeOverlay,this));this.sizeOverlay();this.album=[];var h=0,f=a.attr("data-lightbox");if(f){f=c(a.prop("tagName")+'[data-lightbox="'+f+'"]');for(var e=0;e<f.length;e=++e)b(c(f[e])),f[e]===a[0]&&(h=e)}else if("lightbox"===a.attr("rel"))b(a);else for(f=c(a.prop("tagName")+'[rel="'+a.attr("rel")+'"]'),e=0;e<f.length;e=++e)b(c(f[e])),f[e]===a[0]&&(h=e);a=k.scrollTop()+this.options.positionFromTop;k=k.scrollLeft();this.$lightbox.css({top:a+"px",left:k+"px"}).fadeIn(this.options.fadeDuration);this.options.disableScrolling&&c("body").addClass("lb-disable-scrolling");this.changeImage(h)};d.prototype.changeImage=function(a){var b=this,d=this.album[a].link,k=d.split(".").slice(-1)[0],h=this.$lightbox.find(".lb-image");this.disableKeyboardNav();this.$overlay.fadeIn(this.options.fadeDuration);c(".lb-loader").fadeIn("slow");this.$lightbox.find(".lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption").hide();this.$outerContainer.addClass("animating");var f=new Image;f.onload=function(){h.attr({alt:b.album[a].alt,src:d});c(f);h.width(f.width);h.height(f.height);var e=c(window).width();var g=c(window).height();e=e-b.containerPadding.left-b.containerPadding.right-b.imageBorderWidth.left-b.imageBorderWidth.right-20;g=g-b.containerPadding.top-b.containerPadding.bottom-b.imageBorderWidth.top-b.imageBorderWidth.bottom-b.options.positionFromTop-70;"svg"===k&&(h.width(e),h.height(g));b.options.fitImagesInViewport?(b.options.maxWidth&&b.options.maxWidth<e&&(e=b.options.maxWidth),b.options.maxHeight&&b.options.maxHeight<g&&(g=b.options.maxHeight)):(e=b.options.maxWidth||f.width||e,g=b.options.maxHeight||f.height||g);if(f.width>e||f.height>g)f.width/e>f.height/g?(g=e,e=parseInt(f.height/(f.width/g),10)):(e=g,g=parseInt(f.width/(f.height/e),10)),h.width(g),h.height(e);b.sizeContainer(h.width(),h.height())};f.src=this.album[a].link;this.currentImageIndex=a};d.prototype.sizeOverlay=function(){var a=this;setTimeout(function(){a.$overlay.width(c(document).width()).height(c(document).height())},0)};d.prototype.sizeContainer=function(a,b){function c(){d.$lightbox.find(".lb-dataContainer").width(e);d.$lightbox.find(".lb-prevLink").height(g);d.$lightbox.find(".lb-nextLink").height(g);d.$overlay.focus();d.showImage()}var d=this,h=this.$outerContainer.outerWidth(),f=this.$outerContainer.outerHeight(),e=a+this.containerPadding.left+this.containerPadding.right+this.imageBorderWidth.left+this.imageBorderWidth.right,g=b+this.containerPadding.top+this.containerPadding.bottom+this.imageBorderWidth.top+this.imageBorderWidth.bottom;h!==e||f!==g?this.$outerContainer.animate({width:e,height:g},this.options.resizeDuration,"swing",function(){c()}):c()};d.prototype.showImage=function(){this.$lightbox.find(".lb-loader").stop(!0).hide();this.$lightbox.find(".lb-image").fadeIn(this.options.imageFadeDuration);this.updateNav();this.updateDetails();this.preloadNeighboringImages();this.enableKeyboardNav()};d.prototype.updateNav=function(){var a=!1;try{document.createEvent("TouchEvent"),a=this.options.alwaysShowNavOnTouchDevices?!0:!1}catch(b){}this.$lightbox.find(".lb-nav").show();1<this.album.length&&(this.options.wrapAround?(a&&this.$lightbox.find(".lb-prev, .lb-next").
1303css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(0<this.currentImageIndex&&(this.$lightbox.find(".lb-prev").show(),a&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".lb-next").show(),a&&this.$lightbox.find(".lb-next").css("opacity","1"))))};d.prototype.updateDetails=function(){var a=this;if("undefined"!==typeof this.album[this.currentImageIndex].title&&""!==this.album[this.currentImageIndex].title){var b=this.$lightbox.find(".lb-caption");this.options.sanitizeTitle?b.text(this.album[this.currentImageIndex].title):b.html(this.album[this.currentImageIndex].title);b.fadeIn("fast")}1<this.album.length&&this.options.showImageNumberLabel?(b=this.imageCountLabel(this.currentImageIndex+1,this.album.length),this.$lightbox.find(".lb-number").text(b).fadeIn("fast")):this.$lightbox.find(".lb-number").hide();this.$outerContainer.removeClass("animating");this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return a.sizeOverlay()})};d.prototype.preloadNeighboringImages=function(){this.album.length>this.currentImageIndex+1&&((new Image).src=this.album[this.currentImageIndex+1].link);0<this.currentImageIndex&&((new Image).src=this.album[this.currentImageIndex-1].link)};d.prototype.enableKeyboardNav=function(){this.$lightbox.on("keyup.keyboard",c.proxy(this.keyboardAction,this));this.$overlay.on("keyup.keyboard",c.proxy(this.keyboardAction,this))};d.prototype.disableKeyboardNav=function(){this.$lightbox.off(".keyboard");this.$overlay.off(".keyboard")};d.prototype.keyboardAction=function(a){var b=a.keyCode;27===b?(a.stopPropagation(),this.end()):37===b?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&1<this.album.length&&this.changeImage(this.album.length-1):39===b&&(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&1<this.album.length&&this.changeImage(0))};d.prototype.end=function(){this.disableKeyboardNav();c(window).off("resize",this.sizeOverlay);this.$lightbox.fadeOut(this.options.fadeDuration);this.$overlay.fadeOut(this.options.fadeDuration);this.options.disableScrolling&&c("body").removeClass("lb-disable-scrolling")};return new d});/*! Select2 4.0.2-rc.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;
vendor: 1,286 bytes, line 1303
1303c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.a
vendor: 5,363 bytes, line 1303
1303pply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice;this.listeners=this.listeners||{},a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")});var f=e.filter("[aria-selected=true]");f.length>0?f.first().trigger("mouseenter"):e.first().trigger("mouseenter")})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&d.setClasses()}),b.on("unselect",function(){b.isOpen()&&d.setClasses(
vendor: 14,296 bytes, line 1303
1303)}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">×</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">×</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({}
vendor: 8,329 bytes, line 1303
1303,b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"â¶":"A","A":"A","Ã":"A","Ã":"A","Ã":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ä":"A","Ä":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ç ":"A","Ã":"A","Ç":"A","Ả":"A","Ã
":"A","Ǻ":"A","Ç":"A","È":"A","È":"A","Ạ":"A","Ậ":"A","Ặ":"A","á¸":"A","Ä":"A","Ⱥ":"A","Ɐ":"A","ê²":"AA","Ã":"AE","Ǽ":"AE","Ç¢":"AE","ê´":"AO","ê¶":"AU","ê¸":"AV","êº":"AV","ê¼":"AY","â·":"B","ï¼¢":"B","á¸":"B","á¸":"B","á¸":"B","É":"B","Æ":"B","Æ":"B","â¸":"C","ï¼£":"C","Ä":"C","Ä":"C","Ä":"C","Ä":"C","Ã":"C","á¸":"C","Æ":"C","È»":"C","ê¾":"C","â¹":"D","D":"D","á¸":"D","Ä":"D","á¸":"D","á¸":"D","á¸":"D","á¸":"D","Ä":"D","Æ":"D","Æ":"D","Æ":"D","ê¹":"D","DZ":"DZ","Ç":"DZ","Dz":"Dz","Ç
":"Dz","âº":"E","ï¼¥":"E","Ã":"E","Ã":"E","Ã":"E","á»":"E","Ế":"E","á»":"E","á»":"E","Ẽ":"E","Ä":"E","á¸":"E","á¸":"E","Ä":"E","Ä":"E","Ã":"E","Ẻ":"E","Ä":"E","È":"E","È":"E","Ẹ":"E","á»":"E","Ȩ":"E","á¸":"E","Ä":"E","á¸":"E","á¸":"E","Æ":"E","Æ":"E","â»":"F","F":"F","á¸":"F","Æ":"F","ê»":"F","â¼":"G","ï¼§":"G","Ç´":"G","Ä":"G","Ḡ":"G","Ä":"G","Ä ":"G","Ǧ":"G","Ä¢":"G","Ǥ":"G","Æ":"G","ê ":"G","ê½":"G","ê¾":"G","â½":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","È":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","â±§":"H","â±µ":"H","ê":"H","â¾":"I","I":"I","Ã":"I","Ã":"I","Ã":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ã":"I","Ḯ":"I","á»":"I","Ç":"I","È":"I","È":"I","á»":"I","Ä®":"I","Ḭ":"I","Æ":"I","â¿":"J","J":"J","Ä´":"J","É":"J","â":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Æ":"K","Ⱪ":"K","ê":"K","ê":"K","ê":"K","ê¢":"K","â":"L","L":"L","Ä¿":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ä»":"L","Ḽ":"L","Ḻ":"L","Å":"L","Ƚ":"L","â±¢":"L","â± ":"L","ê":"L","ê":"L","ê":"L","Ç":"LJ","Ç":"Lj","â":"M","ï¼":"M","Ḿ":"M","á¹":"M","á¹":"M","â±®":"M","Æ":"M","â":"N","ï¼®":"N","Ǹ":"N","Å":"N","Ã":"N","á¹":"N","Å":"N","á¹":"N","Å
":"N","á¹":"N","á¹":"N","È ":"N","Æ":"N","ê":"N","ê¤":"N","Ç":"NJ","Ç":"Nj","â":"O","O":"O","Ã":"O","Ã":"O","Ã":"O","á»":"O","á»":"O","á»":"O","á»":"O","Ã":"O","á¹":"O","Ȭ":"O","á¹":"O","Å":"O","á¹":"O","á¹":"O","Å":"O","È®":"O","Ȱ":"O","Ã":"O","Ȫ":"O","á»":"O","Å":"O","Ç":"O","È":"O","È":"O","Æ ":"O","á»":"O","á»":"O","á» ":"O","á»":"O","Ợ":"O","á»":"O","á»":"O","Ǫ":"O","Ǭ":"O","Ã":"O","Ǿ":"O","Æ":"O","Æ":"O","ê":"O","ê":"O","Æ¢":"OI","ê":"OO","È¢":"OU","â
":"P","ï¼°":"P","á¹":"P","á¹":"P","Ƥ":"P","â±£":"P","ê":"P","ê":"P","ê":"P","â":"Q","ï¼±":"Q","ê":"Q","ê":"Q","É":"Q","â":"R","ï¼²":"R","Å":"R","á¹":"R","Å":"R","È":"R","È":"R","á¹":"R","á¹":"R","Å":"R","á¹":"R","É":"R","Ɽ":"R","ê":"R","ê¦":"R","ê":"R","â":"S","ï¼³":"S","áº":"S","Å":"S","Ṥ":"S","Å":"S","á¹ ":"S","Å ":"S","Ṧ":"S","á¹¢":"S","Ṩ":"S","È":"S","Å":"S","â±¾":"S","ê¨":"S","ê":"S","â":"T","ï¼´":"T","Ṫ":"T","Ť":"T","Ṭ":"T","È":"T","Å¢":"T","á¹°":"T","á¹®":"T","Ŧ":"T","Ƭ":"T","Æ®":"T","Ⱦ":"T","ê":"T","ê¨":"TZ","â":"U","ï¼µ":"U","Ã":"U","Ã":"U","Ã":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ã":"U","Ç":"U","Ç":"U","Ç":"U","Ç":"U","Ủ":"U","Å®":"U","Ű":"U","Ç":"U","È":"U","È":"U","Ư":"U","Ừ":"U","Ứ":"U","á»®":"U","Ử":"U","á»°":"U","Ụ":"U","á¹²":"U","Ų":"U","á¹¶":"U","á¹´":"U","É":"U","â":"V","ï¼¶":"V","á¹¼":"V","á¹¾":"V","Ʋ":"V","ê":"V","É
":"V","ê ":"VY","â":"W","ï¼·":"W","áº":"W","áº":"W","Å´":"W","áº":"W","áº":"W","áº":"W","â±²":"W","â":"X","X":"X","áº":"X","áº":"X","â":"Y","ï¼¹":"Y","Ỳ":"Y","Ã":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","áº":"Y","Ÿ":"Y","á»¶":"Y","á»´":"Y","Ƴ":"Y","É":"Y","Ỿ":"Y","â":"Z","Z":"Z","Ź":"Z","áº":"Z","Å»":"Z","Ž":"Z","áº":"Z","áº":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","ê¢":"Z","â":"a","ï½":"a","áº":"a","à ":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","Ä":"a","Ä":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","Ç¡":"a","ä":"a","Ç":"a","ả":"a","Ã¥":"a","Ç»":"a","Ç":"a","È":"a","È":"a","ạ":"a","áº":"a","ặ":"a","á¸":"a","Ä
":"a","â±¥":"a","É":"a","ê³":"aa","æ":"ae","ǽ":"ae","Ç£":"ae","êµ":"ao","ê·":"au","ê¹":"av","ê»":"av","ê½":"ay","â":"b","ï½":"b","á¸":"b","á¸
":"b","á¸":"b","Æ":"b","Æ":"b","É":"b","â":"c","ï½":"c","Ä":"c","Ä":"c","Ä":"c","Ä":"c","ç":"c","á¸":"c","Æ":"c","ȼ":"c","ê¿":"c","â":"c","â":"d","ï½":"d","á¸":"d","Ä":"d","á¸":"d","á¸":"d","á¸":"d","á¸":"d","Ä":"d","Æ":"d","É":"d","É":"d","êº":"d","dz":"dz","Ç":"dz","â":"e","ï½
":"e","è":"e","é":"e","ê":"e","á»":"e","ế":"e","á»
":"e","á»":"e","ẽ":"e","Ä":"e","á¸":"e","á¸":"e","Ä":"e","Ä":"e","ë":"e","ẻ":"e","Ä":"e","È
":"e","È":"e","ẹ":"e","á»":"e","È©":"e","á¸":"e","Ä":"e","á¸":"e","á¸":"e","É":"e","É":"e","Ç":"e","â":"f","ï½":"f","á¸":"f","Æ":"f","ê¼":"f","â":"g","ï½":"g","ǵ":"g","Ä":"g","ḡ":"g","Ä":"g","Ä¡":"g","ǧ":"g","Ä£":"g","Ç¥":"g","É ":"g","ê¡":"g","áµ¹":"g","ê¿":"g","â":"h","ï½":"h","Ä¥":"h","ḣ":"h","ḧ":"h","È":"h","ḥ":"h","ḩ":"h","ḫ":"h","áº":"h","ħ":"h","ⱨ":"h","â±¶":"h","É¥":"h","Æ":"hv","â":"i","ï½":"i","ì":"i","Ã":"i","î":"i","Ä©":"i","Ä«":"i","Ä":"i","ï":"i","ḯ":"i","á»":"i","Ç":"i","È":"i","È":"i","á»":"i","į":"i","á¸":"i","ɨ":"i","ı":"i","â":"j","ï½":"j","ĵ":"j","ǰ":"j","É":"j","â":"k","ï½":"k","ḱ":"k","Ç©":"k","ḳ":"k","Ä·":"k","ḵ":"k","Æ":"k","ⱪ":"k","ê":"k","ê":"k","ê
":"k","ê£":"k","â":"l","ï½":"l","Å":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","Å¿":"l","Å":"l","Æ":"l","É«":"l","ⱡ":"l","ê":"l","ê":"l","ê":"l","Ç":"lj","â":"m","ï½":"m","ḿ":"m","á¹":"m","á¹":"m","ɱ":"m","ɯ":"m","â":"n","ï½":"n","ǹ":"n","Å":"n","ñ":"n","á¹
":"n","Å":"n","á¹":"n","Å":"n","á¹":"n","á¹":"n","Æ":"n","ɲ":"n","Å":"n","ê":"n","ê¥":"n","Ç":"nj","â":"o","ï½":"o","ò":"o","ó":"o","ô":"o","á»":"o","á»":"o","á»":"o","á»":"o","õ":"o","á¹":"o","È":"o","á¹":"o","Å":"o","á¹":"o","á¹":"o","Å":"o","ȯ":"o","ȱ":"o","ö":"o","È«":"o","á»":"o","Å":"o","Ç":"o","È":"o","È":"o","Æ¡":"o","á»":"o","á»":"o","ỡ":"o","á»":"o","ợ":"o","á»":"o","á»":"o","Ç«":"o","Ç":"o","ø":"o","Ç¿":"o","É":"o","ê":"o","ê":"o","ɵ":"o","Æ£":"oi","È£":"ou","ê":"oo","â":"p","ï½":"p","á¹":"p","á¹":"p","Æ¥":"p","áµ½":"p","ê":"p","ê":"p","ê":"p","â ":"q","ï½":"q","É":"q","ê":"q","ê":"q","â¡":"r","ï½":"r","Å":"r","á¹":"r","Å":"r","È":"r","È":"r","á¹":"r","á¹":"r","Å":"r","á¹":"r","É":"r","ɽ":"r","ê":"r","ê§":"r","ê":"r","â¢":"s","ï½":"s","Ã":"s","Å":"s","á¹¥":"s","Å":"s","ṡ":"s","Å¡":"s","á¹§":"s","á¹£":"s","ṩ":"s","È":"s","Å":"s","È¿":"s","ê©":"s","ê
":"s","áº":"s","â£":"t","ï½":"t","ṫ":"t","áº":"t","Å¥":"t","á¹":"t","È":"t","Å£":"t","á¹±":"t","ṯ":"t","ŧ":"t","Æ":"t","Ê":"t","ⱦ":"t","ê":"t","ê©":"tz","â¤":"u","ï½":"u","ù":"u","ú":"u","û":"u","Å©":"u","á¹¹":"u","Å«":"u","á¹»":"u","Å":"u","ü":"u","Ç":"u","Ç":"u","Ç":"u","Ç":"u","á»§":"u","ů":"u","ű":"u","Ç":"u","È":"u","È":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","á»":"u","á»±":"u","ụ":"u","á¹³":"u","ų":"u","á¹·":"u","á¹µ":"u","Ê":"u","â¥":"v","ï½":"v","á¹½":"v","ṿ":"v","Ê":"v","ê":"v","Ê":"v","ê¡":"vy","â¦":"w","ï½":"w","áº":"w","áº":"w","ŵ":"w","áº":"w","áº
":"w","áº":"w","áº":"w","â±³":"w","â§":"x","ï½":"x","áº":"x","áº":"x","â¨":"y","ï½":"y","ỳ":"y","ý":"y","Å·":"y","ỹ":"y","ȳ":"y","áº":"y","ÿ":"y","á»·":"y","áº":"y","ỵ":"y","Æ´":"y","É":"y","ỿ":"y","â©":"z","ï½":"z","ź":"z","áº":"z","ż":"z","ž":"z","áº":"z","áº":"z","ƶ":"z","È¥":"z","É":"z","ⱬ":"z","ê£":"z","Î":"Î","Î":"Î","Î":"Î","Î":"Î","Ϊ":"Î","Î":"Î","Î":"Î¥","Ϋ":"Î¥","Î":"Ω","ά":"α","Î":"ε","ή":"η","ί":"ι","Ï":"ι","Î":"ι","Ï":"ο","Ï":"Ï
","Ï":"Ï
","ΰ":"Ï
","Ï":"Ï","Ï":"Ï"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(
vendor: 13,774 bytes, line 1303
1303a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&""!==a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return f?!1:(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){var c=(this._lastTag,this.$element.find("option[data-select2-tag]"));c.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(a,b,c){function d(a){e.trigger("select",{data:a})}var e=this;b.term=b.term||"";var f=this.tokenizer(b,this.options,d);f.term!==b.term&&(this.$search.length&&(this.$search.val(f.term),this.$search.focus()),b.term=f.term),a.call(this,b,c)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.
1303select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return a(c.data.results)<this.minimumResultsForSearch?!1:b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(){d._handleSelectOnClose()})},a.prototype._handleSelectOnClose=function(){var a=this.getHighlightedResults();if(!(a.length<1)){var b=a.data("data");null!=b.element&&b.element.selected||null==b.element&&b.selected||this.trigger("select",{data:b})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{
vendor: 9,604 bytes, line 1303
1303})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more resultsâ¦"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searchingâ¦"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.
vendor: 3,174 bytes, line 1303
1303_sync=c.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",b._sync,!1)},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")}
vendor: 6,682 bytes, line 1303
1303,e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&(f=d(this),null!=f&&g.push(f))})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;return this._isInitialized?void b.call(this,c):void this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),a.call(this,b,c)}return b.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f<this._currentData.length;f++){var g=this._currentData[f];e.push.apply(e,d(g,this.$element.val().split(this._valueSeparator)))}c(e)},b.prototype.select=function(b,c){if(this.options.get("multiple")){var d=this.$element.val();d+=this._valueSeparator+c.id,this.$element.val(d),this.$element.trigger("change")}else this.current(function(b){a.map(b,function(a){a.selected=!1})}),this.$element.val(c.id),this.$element.trigger("change")},b.prototype.unselect=function(a,b){var c=this;b.selected=!1,this.current(function(a){for(var d=[],e=0;e<a.length;e++){var f=a[e];b.id!=f.id&&d.push(f.id)}c.$element.val(d.join(c._valueSeparator)),c.$element.trigger("change")})},b.prototype.query=function(a,b,c){for(var d=[],e=0;e<this._currentData.length;e++){var f=this._currentData[e],g=this.matches(b,f);null!==g&&d.push(g)}c({results:d})},b.prototype.addOptions=function(b,c){var d=a.map(c,function(b){return a.data(b[0],"data")});this._currentData.push.apply(this._currentData,d)},b}),b.define("select2/compat/matcher",["jquery"],function(a){function b(b){function c(c,d){var e=a.extend(!0,{},d);if(null==c.term||""===a.trim(c.term))return e;if(d.children){for(var f=d.children.length-1;f>=0;f--){var g=d.children[f],h=b(c.term,g.text,g);h||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated
1303in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c;var d=this.options.get("query");d.call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){var d=c.find(".dropdown-wrapper");d.append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery-mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d;return this.each(function(){var c=a(this).data("select2");
1303null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2.");var e=Array.prototype.slice.call(arguments,1);d=c[b].apply(c,e)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});var guests;var guestsWhereChanged=!1;var guestsLabel=t('Ospiti');var children=0;var childrenLabel=t('Bambini');var guests_rooms;var maxMinCheck;var childrenSummaryString='';var selectedChildrenAges=[];var step;$(document).ready(function(){var filtri='';var mappa='';if($('#guests').val()>0) 1304guests=$('#guests').val();$('form.form-kross-booking .kb-adults').on("mouseover",function(){$(this).find('.kg-select').show().animate({opacity:1},{queue:!1,duration:'fast'})});$('form.form-kross-booking .kb-adults').on("mouseout",function(){$(this).find('.kg-select').animate({opacity:0},{queue:!1,duration:'fast'})});$("html").on("mouseup",function(e){var l=$(e.target);if(!l.hasClass('guestsActionCalcButton')&&!l.parent().hasClass('guestsActionCalcContainer')&&!l.parent().hasClass('sharing')&&!l.parent().hasClass('ordermob-container')&&!l.hasClass('children-age')&&!l.hasClass('childrenAges')&&!l.parent().hasClass('childrenAgeSelectionContainer')&&!l.parents().hasClass('childrenAges')){$(".popover").each(function(){$('#guestsDiv').popover("hide");$('.qtguests').popover("hide");$('.qtguestsInput').popover("hide");$('.infobutton').popover("hide");$('.sharingContainer').popover("hide");$('#mobileOrderButton').popover("hide");if(maxMinCheck==!0&&guestsWhereChanged==!0){$('.loading').show();$('#roomsDetailsAva').submit()}})}})});function search_addRoom(container,adults,children,age,max_age,min_age){return!1} 1305function searchHt(desturl,containerClass='rooms'){newSearchHt(desturl,kross_from,kross_to,guests_rooms)} 1306function newSearchHt(desturl,from,to,guests_rooms){var searchParams='from='+from+'&to='+to;var url=BASE_PATH+'/book/'+desturl+'?'+searchParams;changeUrl(url);if(desturl=='packages'){$.post(url+'&search=1').done(function(data){$('.packages-wrapper').html(data.listings)})}else if(desturl.indexOf('package-detail')>-1){$.post(url+'&search=1').done(function(data){$('.package-detail-wrapper').html(data.listings);$('#s1').attr('href',data.packages_url)})}} 1307function resetPositionFiltersMap(){var mapOpen=parseInt($("[name=mapToggle]").attr('data-open'));var addOverflow=!1;if(window.innerWidth>1024){mapOpen=1} 1308if(mapOpen){if(window.innerWidth>1024){$('#mapContainer').removeAttr('style')}else{addOverflow=!0;$('#mapContainer').css('left','0%')}}else{addOverflow=!1;$('#mapContainer').css('left','100%')} 1309if($('.reservationSummaryDetailsPanel').length>0&&!$('.reservationSummaryDetailsPanel').hasClass('d-none')){addOverflow=!0}} 1310function closeReservationSummaryMobilePanel(){if($('.reservationSummaryMobilePanel').length>0&&!$('.reservationSummaryMobilePanel').hasClass('d-none')){$('#formBook').css('height','unset');$('.reservationSummaryMobilePanel').addClass('d-none');$('.reservationSummaryMobilePanel .rates-sidebar-choose').remove();if($(window).innerWidth()<991) 1311$('body').toggleClass('overflow-hidden')}} 1312function fixedSearchOnMobile(){if(window.innerWidth>991){closeReservationSummaryMobilePanel()}else{}} 1313$(function(){fixedSearchOnMobile()});$(window).resize(function(){});function selectRateRadio(id_rate,name_rate,total_rate,min_price_rate,adv_tot_price=0,adv_perc=0,tot_vat=0){unselectRate(!1);selectRate(id_rate,name_rate,total_rate,min_price_rate,adv_tot_price,adv_perc,tot_vat);$('.rate-selected').removeClass('d-none');$('.box-rate'+id_rate).addClass('selected');$('.box-rate'+id_rate+' input.selrate').prop('checked',!0);selected_rate=id_rate;selected_rate_name=name_rate;selected_rate_total=total_rate;selected_rate_vat=tot_vat;selected_rate_min_price=min_price_rate;if(adv_tot_price>0){selected_rate_adv_tot_price=adv_tot_price}else{selected_rate_adv_tot_price=0} 1314if(adv_perc>0){selected_rate_adv_perc=adv_perc}else{selected_rate_adv_perc=0}} 1315function selectRate(id_rate,name,price,min_price,adv_tot_price=0,adv_perc=0,vat_amount=0){if(min_price===undefined){min_price=0}
1316$('#rate-not-selected').slideUp('fast',function(){$('#rate-selected').slideDown()});$('.id_rate').val(id_rate);var obj=$('<div class="reservation-summary-row vr reservation-summary-detail">'+$('#reservation-summary-detail-model').html()+'</div>');obj.attr('data-price',price);obj.find('.tariffaselezionata').html('<i>'+name+'</i>');obj.find('.aptprice').html(pr(price));$('.resumeMinPrice').html(pr(min_price));$('.resumeMinPrice[data-pricetype=month]').html(pr(min_price*30));$('.aptprice').html(pr(price));obj.find('.tariffaselezionatamore').html($('#guests').val()+' '+t('js_be_ospiti')+' '+t('js_be_dal')+' '+$('#arrivalformat').val()+' '+t('js_be_al')+' '+$('#departureformat').val());var stayprice=price;$('li.resumeRow').remove();var adv_serv=0;var servprice=0;for(i in mandatory_services_rates[id_rate]){var service=mandatory_services_rates[id_rate][i];var serviceadvperc=service.advance_payment_perc;if(serviceadvperc===null){serviceadvperc=adv_perc} 1317var rowModel='<li class="resumeRowModel" style="display:none"><span class="resumeRowName"></span><span class="float-right resumeRowPrice"></span></li>';obj=$(rowModel);obj.addClass('resumeRow').removeClass('resumeRowModel');var serviceprice=service.price_service;var vatservice=parseFloat(service.tot_vat);if(service.is_perc){serviceprice=serviceprice*stayprice/100} 1318if(parseFloat(service.min_amount)&&parseFloat(service.min_amount)>parseFloat(serviceprice))serviceprice=service.min_amount;obj.attr('data-price',service.price_service);var service_name='';if(service.name_service_t){service_name_t=JSON.parse(service.name_service_t);if(typeof service_name_t[kross_lang]!='undefined'&&service_name_t[kross_lang]!=null&&service_name_t[kross_lang].length>0){service_name=service_name_t[kross_lang]}} 1319if(service_name==''&&service.name) 1320service_name=service.name;else if(service_name==''&&service.name_service) 1321service_name=service.name_service;vat_amount+=parseFloat(vatservice);obj.find('.resumeRowName').html(service_name);if(HOTEL_ID_QUERY=='airus'){if(service.description){obj.find('.resumeRowName').html(service_name+`<span style="font-size:14px;" data-toggle="tooltip" data-placement="top" class="infosrv ml-2" title="${service['description']}" data-original-title="${service['description']}"><i class="fa fa-info-circle"></i></span>`);obj.find('[data-toggle="tooltip"]').tooltip()}else{obj.find('.resumeRowName').html(service_name)}} 1322adv_serv+=parseFloat(serviceadvperc)*(parseFloat(serviceprice)+parseFloat(vatservice))/100;obj.find('.resumeRowPrice').html(pr(serviceprice));$('.resumeListPricesAndFares').append(obj);obj.css('display','block');price+=parseFloat(serviceprice);servprice+=parseFloat(serviceprice)} 1323$('.servprice').html(pr(servprice));totalSelectedRoomsRate=parseFloat(price);refreshSelectedServices();refreshTotal();if(vat_amount>0){$('#tot_vat').val(vat_amount);$('.vatContainer').show();$('.totalVatContainer').show();$('.vatValue').html(pr(vat_amount));$('.totalVatValue').html(pr(parseFloat(price)+parseFloat(vat_amount)))} 1324var totPren=adv_tot_price;if(adv_serv){totPren=adv_tot_price+adv_serv} 1325if(totPren>0){$('.advancePaymentContainer').show();$('.advancePaymentValue').html(pr(totPren))}else{$('.advancePaymentContainer').hide();$('.advancePaymentValue').html(pr(0))} 1326$('#btn-prenota').removeAttr('disabled').removeClass('btn-disabled')} 1327function unselectRate(animate){if(animate){$('#rate-not-selected').slideDown();$('.reservation-summary-detail').slideUp()} 1328$('#rate-selected-rates').html('');$('#btn-prenota').attr('disabled','').addClass('btn-disabled');$('.box-rate').removeClass('selected')} 1329function aggiungiServizioVr(id_service){refreshSelectedRooms();refreshSelectedServices();refreshTotal()} 1330var totalSelectedRooms=0;var totalSelectedRoomsRate=0;var totalSelectedServices=0;var totalSelectedPromo=0;function refreshSelectedRooms(){totalSelectedRooms=0;$('.reservation-summary-detail').each(function(){totalSelectedRooms+=parseFloat($(this).attr('data-price'))})} 1331function refreshSelectedServices(){totalSelectedServices=0} 1332function refreshTotal(){$('.totalePrenotazione').html(pr(totalSelectedRooms+totalSelectedRoomsRate+totalSelectedServices+totalSelectedPromo));$('.totalePrenotazione').attr('content',(totalSelectedRooms+totalSelectedRoomsRate+totalSelectedServices+totalSelectedPromo).toFixed(2));$('.totalePrenotazione').attr('itemprop','price');$('#tot_cart').val(totalSelectedRooms+totalSelectedRoomsRate+totalSelectedServices+totalSelectedPromo)} 1333function loadRemoteCities(lang,htmlItemClass,arrival=null,departure=null,refresh=!0){var remoteCitiesData=[];var remoteListingsData=[];if(lang===undefined){lang=''} 1334if(htmlItemClass===undefined){htmlItemClass=''};var fullUrl='https://data.krossbooking.com/get/info?id='+HOTEL_ID_QUERY+'&be='+HOTEL_ID+'&w=cities-rt';if(withListing){fullUrl+=',rts';if($('#destination').val())fullUrl+='&city='+$('#destination').val()} 1335if(lang!==''){fullUrl=fullUrl+"&lang="+lang} 1336if(arrival&&departure){fullUrl=fullUrl+"&arrival="+arrival+"&departure="+departure} 1337var selected=$('#destination').val();var selected_label=$('#destination option:selected').text();$.ajax({url:fullUrl,success:function(data){var obj=$.parseJSON(data);var cities=obj.cities;$.each(cities,function(k,v){remoteCitiesData.push({id:""+k,text:""+v,fullUrl:"https://book.krossbooking.com/v6/"+HOTEL_ID+"/book/step1?city="+k})});if(selected&&!cities[selected]){remoteCitiesData.push({id:selected,text:selected_label,fullUrl:"https://book.krossbooking.com/v6/"+HOTEL_ID+"/book/step1?city="+selected})} 1338$('#destination option').remove();$('#destination').append('<option value=""></option>');$('#destination').select2("destroy").select2({allowClear:!0,data:remoteCitiesData,sorter:function(data){return data.sort(function(a,b){return a.text<b.text?-1:a.text>b.text?1:0})}});$('#destination').one('select2:open',function(e){$('input.select2-search__field').css({"border-top":0,"border-right":0,"border-left":0,"margin-bottom":"10px"});$('input.select2-search__field').prop('placeholder',t('Scrivi per cercare'))});if(selected){$('#destination').val(selected).trigger('change')}else if(typeof destination_from_param!=='undefined'){$('#destination').val(destination_from_param).trigger('change')} 1339if(destinationsDropdownEnabled==1){fillMenuDropdown('navbarDestinationsDropdown',remoteCitiesData,htmlItemClass)} 1340if(withListing){var room_types=obj.room_type;$.each(room_types,function(k,v){remoteListingsData.push({id:""+k,text:""+v,fullUrl:"https://book.krossbooking.com/v6/"+HOTEL_ID+"/book/step1?id="+k})});$('#id_listing option').remove();$('#id_listing').append('<option value=""></option>');$('#id_listing').select2("destroy").select2({allowClear:!0,data:remoteListingsData,sorter:function(data){return data.sort(function(a,b){return a.text<b.text?-1:a.text>b.text?1:0})}});$('#id_listing').one('select2:open',function(e){$('input.select2-search__field').css({"border-top":0,"border-right":0,"border-left":0,"margin-bottom":"10px"});$('input.select2-search__field').prop('placeholder',t('Scrivi per cercare'))})}}})} 1341function loadRemoteCollections(lang,htmlItemClass){var remoteCollectionsData=[];if(lang===undefined){lang=''} 1342if(htmlItemClass===undefined){htmlItemClass=''};var fullUrl='https://data.krossbooking.com/get/info?id='+HOTEL_ID_QUERY+'&be='+HOTEL_ID+'&w=collections';if(lang!==''){fullUrl=fullUrl+"&lang="+lang} 1343if($('#kross_from').val()&&$('#kross_to').val()){fullUrl=fullUrl+"&arrival="+$('#kross_from').val()+"&departure="+$('#kross_to').val()} 1344var selected=$('#destination').val();var selected_label=$('#destination option:selected').text();$.ajax({url:fullUrl,success:function(data){var obj=$.parseJSON(data);var collections=obj.collections;$.each(collections,function(k,v){remoteCollectionsData.push({id:""+k,text:""+v,fullUrl:"https://book.krossbooking.com/v6/"+HOTEL_ID+"/book/step1?collection="+k})});$('#destination option').remove();$('#destination').append('<option value=""></option>');$('#destination').select2("destroy").select2({allowClear:!0,data:remoteCollectionsData,sorter:function(data){return data.sort(function(a,b){return a.text<b.text?-1:a.text>b.text?1:0})}});$('#destination').one('select2:open',function(e){$('input.select2-search__field').css({"border-top":0,"border-right":0,"border-left":0,"margin-bottom":" 10
1344px"});$('input.select2-search__field').prop('placeholder',t('Scrivi per cercare'))});if(selected){$('#destination').val(selected).trigger('change')}else if(typeof destination_from_param!=='undefined'){$('#destination').val(destination_from_param).trigger('change')}}})} 1345function loadRemoteRoomTypeCategories(lang,htmlItemClass){var remoteCollectionsData=[];if(lang===undefined){lang=''} 1346if(htmlItemClass===undefined){htmlItemClass=''};var fullUrl='https://data.krossbooking.com/get/info?id='+HOTEL_ID_QUERY+'&be='+HOTEL_ID+'&w=room_type_categories';if(lang!==''){fullUrl=fullUrl+"&lang="+lang} 1347if($('#kross_from').val()&&$('#kross_to').val()){fullUrl=fullUrl+"&arrival="+$('#kross_from').val()+"&departure="+$('#kross_to').val()} 1348var selected=$('#destination').val();var selected_label=$('#destination option:selected').text();$.ajax({url:fullUrl,success:function(data){var obj=$.parseJSON(data);var collections=obj.room_type_category;$.each(collections,function(k,v){remoteCollectionsData.push({id:""+k,text:""+v,fullUrl:"https://book.krossbooking.com/v6/"+HOTEL_ID+"/book/step1?id_room_type_category="+k})});$('#destination option').remove();$('#destination').append('<option value=""></option>');$('#destination').select2("destroy").select2({allowClear:!0,data:remoteCollectionsData,sorter:function(data){return data.sort(function(a,b){return a.text<b.text?-1:a.text>b.text?1:0})}});$('#destination').one('select2:open',function(e){$('input.select2-search__field').css({"border-top":0,"border-right":0,"border-left":0,"margin-bottom":" 10px"});$('input.select2-search__field').prop('placeholder',t('Scrivi per cercare'))});if(selected){$('#destination').val(selected).trigger('change')}else if(typeof destination_from_param!=='undefined'){$('#destination').val(destination_from_param).trigger('change')}}})} 1349function loadRemoteBeGroups(lang,htmlItemClass){var remoteCollectionsData=[];if(lang===undefined){lang=''} 1350if(htmlItemClass===undefined){htmlItemClass=''};var fullUrl='https://data.krossbooking.com/get/info?id='+HOTEL_ID_QUERY+'&be='+HOTEL_ID+'&w=be_groups';if(lang!==''){fullUrl=fullUrl+"&lang="+lang} 1351if($('#kross_from').val()&&$('#kross_to').val()){fullUrl=fullUrl+"&arrival="+$('#kross_from').val()+"&departure="+$('#kross_to').val()} 1352var selected=$('#destination').val();var selected_label=$('#destination option:selected').text();$.ajax({url:fullUrl,success:function(data){var obj=$.parseJSON(data);var collections=obj.be_groups;$.each(collections,function(k,v){remoteCollectionsData.push({id:""+k,text:""+v,fullUrl:"https://book.krossbooking.com/v6/"+HOTEL_ID+"/book/step1?group="+parseFloat(k)})});$('#destination option').remove();$('#destination').append('<option value=""></option>');$('#destination').select2("destroy").select2({allowClear:!0,data:remoteCollectionsData,sorter:function(data){return data.sort(function(a,b){return a.text<b.text?-1:a.text>b.text?1:0})}});$('#destination').one('select2:open',function(e){$('input.select2-search__field').css({"border-top":0,"border-right":0,"border-left":0,"margin-bottom":" 10px"});$('input.select2-search__field').prop('placeholder',t('Scrivi per cercare'))});if(selected){$('#destination').val(selected).trigger('change')}else if(typeof destination_from_param!=='undefined'){$('#destination').val(destination_from_param).trigger('change')}}})} 1353var columnID=0;function fillMenuDropdown(htmlID,remoteData,htmlItemClass){if(htmlItemClass===undefined){htmlItemClass=''};var dropdown=$('#'+htmlID);$.each(remoteData,function(k,v){if(k%4===0){columnID++;dropdown.append('<div class="'+htmlItemClass+'"><ul class="nav flex-column" id="innerColumn'+columnID+'"></ul></div>')} 1354$('#innerColumn'+columnID).append('<li class="nav-item"><a class="dropdown-item" href="'+v.fullUrl+'">'+v.text+'</a></li>')})} 1355function refreshListingByCity(){var remoteListingsData=[];var destination_ominbar=$('#destination').val().split(';');var fullUrl='https://data.krossbooking.com/get/info?id='+HOTEL_ID_QUERY+'&be='+HOTEL_ID+'&w=rts&'+destination_ominbar[0]+'='+destination_ominbar[1]+"&lang="+kross_lang;if($('#kross_from').val()&&$('#kross_to').val()){fullUrl=fullUrl+"&arrival="+$('#kross_from').val()+"&departure="+$('#kross_to').val()} 1356if($('#widget_id_group').val()){fullUrl=fullUrl+"&be_groups="+$('#widget_id_group').val()} 1357$.ajax({url:fullUrl,success:function(data){var obj=$.parseJSON(data);var room_types=obj.room_type;$.each(room_types,function(k,v){remoteListingsData.push({id:""+k,text:""+v,fullUrl:"https://book.krossbooking.com/v6/"+HOTEL_ID+"/book/step1?id="+k})});$('#id_listing option').remove();$('#id_listing').append('<option value=""></option>');$('#id_listing').select2("destroy").select2({allowClear:!0,data:remoteListingsData,sorter:function(data){return data.sort(function(a,b){return a.text<b.text?-1:a.text>b.text?1:0})}});$('#id_listing').one('select2:open',function(e){$('input.select2-search__field').css({"border-top":0,"border-right":0,"border-left":0,"margin-bottom":"10px"});$('input.select2-search__field').prop('placeholder',t('Scrivi per cercare'))})}})} 1358function mobileKbCal2(){if($(this).width()<768){$('.dateBar .btn-holder-top button.btn').addClass('btn-block');$('.dateBar .btn-holder-top').addClass('w-100 mt-3')}else{$('.dateBar .btn-holder-top button.btn').removeClass('btn-block');$('.dateBar .btn-holder-top').removeClass('w-100 mt-3')}} 1359function readMore(solution,inner){if(inner===undefined){inner='p'} 1360$('#description-'+solution+' '+inner).css('max-height','10000px');$('#description-'+solution+' div.readmore').hide();$('#description-'+solution+' div.readless').show()} 1361function readLess(solution,inner){if(inner===undefined){inner='p'} 1362$('#description-'+solution+' '+inner).css('max-height','3.4em');$('#description-'+solution+' div.readmore').show();$('#description-'+solution+' div.readless').hide()} 1363$(function(){}) 1364function vrServiceCalculate(id_service){var rowWasChanged=$('#qt-service-'+id_service);var price=rowWasChanged.val()*parseFloat(rowWasChanged.attr('data-price'))*parseFloat(rowWasChanged.attr('data-nightsmultiplier'));$('#totale_serv_'+id_service).html(pr(price));$('.resumeListServices li.serviceRow').remove();var tot=parseFloat($('#tot_cart').val());var tot_adv=parseFloat($('#tot_adv_cart').val());var tot_vat=parseFloat($('#tot_vat').val());var subTotServices=0;$('.qt-service').each(function(){if(parseInt($(this).val())){var srvPrice=$(this).val()*parseFloat($(this).attr('data-price'))*parseFloat($(this).attr('data-nightsmultiplier'));
1364var srvAdvPrice=$(this).val()*parseFloat($(this).attr('data-adv-price'))*parseFloat($(this).attr('data-nightsmultiplier'));var srvVat=$(this).val()*parseFloat($(this).attr('data-vat'))*parseFloat($(this).attr('data-nightsmultiplier'));var li='<li class="serviceRow resumeRow" style="display:block" data-price="'+parseFloat(srvPrice)+'">';li+='<span class="resumeRowName float-left w-75">'+$(this).attr('data-name')+' × '+parseInt($(this).val())+'</span>';li+='<span class="float-right resumeRowPrice">'+pr(srvPrice)+'</span>';li+='</li>' 1365$('.resumeListServices').append(li);tot+=srvPrice;tot_adv+=srvAdvPrice;tot_vat+=srvVat;subTotServices+=srvPrice}}) 1366if($('.serviceRow').length>0){$('#reservation-summary-row-services').show();$('.resumeListServices').show()}else{$('#reservation-summary-row-services').hide();$('.resumeListServices').hide()} 1367$('.totalePrenotazione').html(pr(tot));$('.totalePrenotazione').attr('content',tot.toFixed(2));$('.totalePrenotazione').attr('itemprop','price');$('.advancePaymentValue').html(pr(tot_adv));$('.vatValue').html(pr(tot_vat));$('.totalVatValue').html(pr(parseFloat(tot_vat)+parseFloat(tot)));$('#subtotaleServizi').html(pr(subTotServices))} 1368function vrServiceRefresh(){$('.resumeListServices li.serviceRow').remove();var tot=parseFloat($('#tot_cart').val());var subTotServices=0;$('.qt-service').each(function(){if(parseInt($(this).val())){var srvPrice=$(this).val()*parseFloat($(this).attr('data-price'))*parseFloat($(this).attr('data-nightsmultiplier'));var li='<li class="serviceRow resumeRow" style="display:block" data-price="'+parseFloat(srvPrice)+'">';li+='<span class="resumeRowName float-left w-75">'+$(this).attr('data-name')+'</span>';li+='<span class="float-right resumeRowPrice">'+pr(srvPrice)+'</span>';li+='</li>' 1369$('.resumeListServices').append(li);tot+=srvPrice;subTotServices+=srvPrice}}) 1370$('.totalePrenotazione').html(pr(tot));$('.totalePrenotazione').attr('content',tot.toFixed(2));$('.totalePrenotazione').attr('itemprop','price');$('#subtotaleServizi').html(pr(subTotServices))} 1371function highMarker(a=!1,b=!1){} 1372function listing_showRoomDetails(idrt){$('.modal-rt').load(BASE_PATH+'/book/modal-rt?idrt='+idrt+'&display=vrRoomDetails',function(){if(window.innerWidth>991){$('.modal-rt .modal-dialog').addClass('modal-xl')} 1373$('.modal-rt .modal-dialog').addClass('roomDetailsModalDialog'),$('.modal-rt .modal').modal();$('.modal-rt .modal .modal-body').hide();$('.modal-rt .modal').on('shown.bs.modal',function(){$('.slick-apt-detail').slick({infinite:!0,dots:!1,centerMode:!1,arrows:!0,fade:!0,nextArrow:'<button class="slick-next slick-arrow" aria-label="Next" type="button" style="display: inline-block;"></button>',prevArrow:'<button class="slick-prev slick-arrow" aria-label="Next" type="button" style="display: inline-block;"></button>',});$('.modal-rt .modal .modal-body').fadeIn()}).on('hide.bs.modal',function(e){})});return!1}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.