!function(O,W,v){"use strict";function H(a){return function(){var d,b=arguments[0];for(d="["+(a?a+":":"")+b+"] http://errors.angularjs.org/1.5.0/"+(a?a+"/":"")+b,b=1;b").append(a).html();try{return a[0].nodeType===Pa?G(d):d.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+G(b)})}catch(c){return G(d)}}function yc(a){try{return decodeURIComponent(a)}catch(b){}}function zc(a){var b={};return n((a||"").split("&"),function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=yc(e),y(e)&&(f=!y(f)||yc(f),sa.call(b,e)?L(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))}),b}function Ub(a){var b=[];return n(a,function(a,c){L(a)?n(a,function(a){b.push(ha(c,!0)+(!0===a?"":"="+ha(a,!0)))}):b.push(ha(c,!0)+(!0===a?"":"="+ha(a,!0)))}),b.length?b.join("&"):""}function qb(a){return ha(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ha(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function ee(a,b){var d,c,e=Qa.length;for(c=0;c/,">"))}return b=b||[],b.unshift(["$provide",function(b){b.value("$rootElement",a)}]),d.debugInfoEnabled&&b.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]),b.unshift("ng"),c=fb(b,d.strictDi),c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d),c(b)(a)})}]),c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;if(O&&e.test(O.name)&&(d.debugInfoEnabled=!0,O.name=O.name.replace(e,"")),O&&!f.test(O.name))return c();O.name=O.name.replace(f,""),ia.resumeBootstrap=function(a){return n(a,function(a){b.push(a)}),c()},D(ia.resumeDeferredBootstrap)&&ia.resumeDeferredBootstrap()}function ge(){O.name="NG_ENABLE_DEBUG_INFO!"+O.name,O.location.reload()}function he(a){if(!(a=ia.element(a).injector()))throw Da("test");return a.get("$$testability")}function Bc(a,b){return b=b||"_",a.replace(ie,function(a,c){return(c?b:"")+a.toLowerCase()})}function sb(a,b,d){if(!a)throw Da("areq",b||"?",d||"required");return a}function Sa(a,b,d){return d&&L(a)&&(a=a[a.length-1]),sb(D(a),b,"not a function, got "+(a&&"object"==typeof a?a.constructor.name||"Object":typeof a)),a}function Ta(a,b){if("hasOwnProperty"===a)throw Da("badname",b)}function Dc(a,b,d){if(!b)return a;b=b.split(".");for(var c,e=a,f=b.length,g=0;g")+c[2],c=c[0];c--;)d=d.lastChild;f=db(f,d.childNodes),d=e.firstChild,d.textContent=""}else f.push(b.createTextNode(a));return e.textContent="",e.innerHTML="",n(f,function(a){e.appendChild(a)}),e}function Oc(a,b){var d=a.parentNode;d&&d.replaceChild(b,a),b.appendChild(a)}function U(a){if(a instanceof U)return a;var b;if(F(a)&&(a=X(a),b=!0),!(this instanceof U)){if(b&&"<"!=a.charAt(0))throw Xb("nosel");return new U(a)}if(b){b=W;var d;a=(d=Nf.exec(a))?[b.createElement(d[1])]:(d=Nc(a,b))?d.childNodes:[]}Pc(this,a)}function Yb(a){return a.cloneNode(!0)}function wb(a,b){if(b||hb(a),a.querySelectorAll)for(var d=a.querySelectorAll("*"),c=0,e=d.length;c=xa)&&("function"==typeof a&&/^(?:class\s|constructor\()/.test(Function.prototype.toString.call(a))),d?(c.unshift(null),new(Function.prototype.bind.apply(a,c))):a.apply(b,c)},instantiate:function(a,b,c){var d=L(a)?a[a.length-1]:a;return a=e(a,b,c),a.unshift(null),new(Function.prototype.bind.apply(d,a))},get:d,annotate:fb.$$annotate,has:function(b){return r.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}b=!0===b;var k={},l=[],m=new Ua([],!0),r={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,ba(b),!1)}),constant:d(function(a,b){Ta(a,"constant"),r[a]=b,I[a]=b}),decorator:function(a,b){var c=s.get(a+"Provider"),d=c.$get;c.$get=function(){var a=t.invoke(d,c);return t.invoke(b,null,{$delegate:a})}}}},s=r.$injector=h(r,function(a,b){throw ia.isString(b)&&l.push(b),Ga("unpr",l.join(" <- "))}),I={},K=h(I,function(a,b){var c=s.get(a+"Provider",b);return t.invoke(c.$get,c,v,a)}),t=K;r.$injectorProvider={$get:ba(K)};var p=g(a),t=K.get("$injector");return t.strictDi=b,n(p,function(a){a&&t.invoke(a)}),t}function Xe(){var a=!0;this.disableAutoScrolling=function(){a=!1},this.$get=["$window","$location","$rootScope",function(b,d,c){function e(a){var b=null;return Array.prototype.some.call(a,function(a){if("a"===ra(a))return b=a,!0}),b}function f(a){if(a){a.scrollIntoView();var c;c=g.yOffset,D(c)?c=c():Rb(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):N(c)||(c=0),c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))}else b.scrollTo(0,0)}function g(a){a=F(a)?a:d.hash();var b;a?(b=h.getElementById(a))?f(b):(b=e(h.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var h=b.document;return a&&c.$watch(function(){return d.hash()},function(a,b){a===b&&""===a||Pf(function(){c.$evalAsync(g)})}),g}]}function jb(a,b){return a||b?a?b?(L(a)&&(a=a.join(" ")),L(b)&&(b=b.join(" ")),a+" "+b):a:b:""}function Yf(a){F(a)&&(a=a.split(" "));var b=Z();return n(a,function(a){a.length&&(b[a]=!0)}),b}function Ha(a){return E(a)?a:{}}function Zf(a,b,d,c){function e(a){try{a.apply(null,wa.call(arguments,1))}finally{if(0===--K)for(;t.length;)try{t.pop()()}catch(b){d.error(b)}}}function f(){z=null,g(),h()}function g(){a:{try{p=m.state;break a}catch(a){}p=void 0}p=x(p)?null:p,oa(p,$)&&(p=$),$=p}function h(){u===k.url()&&w===p||(u=k.url(),w=p,n(A,function(a){a(k.url(),p)}))}var k=this,l=a.location,m=a.history,r=a.setTimeout,s=a.clearTimeout,I={};k.isMock=!1;var K=0,t=[];k.$$completeOutstandingRequest=e,k.$$incOutstandingRequestCount=function(){K++},k.notifyWhenNoOutstandingRequests=function(a){0===K?a():t.push(a)};var p,w,u=l.href,la=b.find("base"),z=null;g(),w=p,k.url=function(b,d,e){if(x(e)&&(e=null),l!==a.location&&(l=a.location),m!==a.history&&(m=a.history),b){var f=w===e;if(u===b&&(!c.history||f))return k;var h=u&&Ia(u)===Ia(b);return u=b,w=e,!c.history||h&&f?(h&&!z||(z=b),d?l.replace(b):h?(d=l,e=b.indexOf("#"),e=-1===e?"":b.substr(e),d.hash=e):l.href=b,l.href!==b&&(z=b)):(m[d?"replaceState":"pushState"](e,"",b),g(),w=p),k}return z||l.href.replace(/%27/g,"'")},k.state=function(){return p};var A=[],Q=!1,$=null;k.onUrlChange=function(b){return Q||(c.history&&C(a).on("popstate",f),C(a).on("hashchange",f),Q=!0),A.push(b),b},k.$$applicationDestroyed=function(){C(a).off("hashchange popstate",f)},k.$$checkUrlChange=h,k.baseHref=function(){var a=la.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""},k.defer=function(a,b){var c;return K++,c=r(function(){delete I[c],e(a)},b||0),I[c]=!0,c},k.defer.cancel=function(a){return!!I[a]&&(delete I[a],s(a),e(B),!0)}}function df(){this.$get=["$window","$log","$sniffer","$document",function(a,b,d,c){return new Zf(a,c,b,d)}]}function ef(){this.$get=function(){function a(a,c){function e(a){a!=r&&(s?s==a&&(s=a.n):s=a,f(a.n,a.p),f(a,r),r=a,r.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw H("$cacheFactory")("iid",a);var g=0,h=T({},c,{id:a}),k=Z(),l=c&&c.capacity||Number.MAX_VALUE,m=Z(),r=null,s=null;return b[a]={put:function(a,b){if(!x(b)){if(ll&&this.remove(s.key),b}},get:function(a){if(l",b=ba.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name),d.value=c,a.attributes.setNamedItem(d)}function $(a,b){try{a.addClass(b)}catch(c){}}function M(a,b,c,d,e){a instanceof C||(a=C(a));for(var f=/\S+/,g=0,h=a.length;g").append(a).html())):c?Ra.clone.call(a):a,g)for(var h in g)d.data("$"+h+"Controller",g[h].instance);return M.$$addScopeInfo(d,b),c&&c(d,b),l&&l(b,d,d,f),d}}function P(a,b,c,d,e,f){function g(a,c,d,e){var f,k,l,m,p,s,u;if(A)for(u=Array(c.length),m=0;mJ.priority)break;if((fa=J.scope)&&(J.templateUrl||(E(fa)?(Wa("new/isolated scope",P||Q,J,ea),P=J):Wa("new/isolated scope",P,J,ea)),Q=Q||J),H=J.name,!N&&(J.replace&&(J.templateUrl||J.template)||J.transclude&&!J.$$tlb)){for(fa=R+1;N=a[fa++];)if(N.transclude&&!N.$$tlb||N.replace&&(N.templateUrl||N.template)){Fb=!0;break}N=!0}if(!J.templateUrl&&J.controller&&(fa=J.controller,I=I||Z(),Wa("'"+H+"' controller",I[H],J,ea),I[H]=J),fa=J.transclude)if(z=!0,J.$$tlb||(Wa("transclusion",S,J,ea),S=J),"element"==fa)B=!0,t=J.priority,G=ea,ea=d.$$element=C(W.createComment(" "+H+": "+d[H]+" ")),b=ea[0],aa(f,wa.call(G,0),b),ya=ac(Fb,G,e,t,g&&g.name,{nonTlbTranscludeDirective:S});else{var V=Z();if(G=C(Yb(b)).contents(),E(fa)){G=[];var ha=Z(),da=Z();n(fa,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a,ha[a]=b,V[b]=null,da[b]=c}),n(ea.contents(),function(a){var b=ha[va(ra(a))];b?(da[b]=!0,V[b]=V[b]||[],V[b].push(a)):G.push(a)}),n(da,function(a,b){if(!a)throw ja("reqslot",b)});for(var ga in V)V[ga]&&(V[ga]=ac(Fb,V[ga],e))}ea.empty(),ya=ac(Fb,G,e,v,v,{needsNewScope:J.$$isolateScope||J.$$newScope}),ya.$$slots=V}if(J.template)if(la=!0,Wa("template",$,J,ea),$=J,fa=D(J.template)?J.template(ea,d):J.template,fa=qa(fa),J.replace){if(g=J,G=Wb.test(fa)?Zc(U(J.templateNamespace,X(fa))):[],b=G[0],1!=G.length||1!==b.nodeType)throw ja("tplrt",H,"");aa(f,ea,b),Va={$attr:{}},fa=ma(b,[],Va);var oa=a.splice(R+1,a.length-(R+1));(P||Q)&&$c(fa,P,Q),a=a.concat(fa).concat(oa),ad(d,Va),Va=a.length}else ea.html(fa);if(J.templateUrl)la=!0,Wa("template",$,J,ea),$=J,J.replace&&(g=J),u=$f(a.splice(R,a.length-R),ea,d,f,z&&ya,h,l,{controllerDirectives:I,newScopeDirective:Q!==J&&Q,newIsolateScopeDirective:P,templateDirective:$,nonTlbTranscludeDirective:S}),Va=a.length;else if(J.compile)try{O=J.compile(ea,d,ya),D(O)?p(null,O,Y,ba):O&&p(O.pre,O.post,Y,ba)}catch(pa){c(pa,ta(ea))}J.terminal&&(u.terminal=!0,t=Math.max(t,J.priority))}return u.scope=Q&&!0===Q.scope,u.transcludeOnThisElement=z,u.templateOnThisElement=la,u.transclude=ya,m.hasElementTranscludeDirective=B,u}function $c(a,b,c){for(var d=0,e=a.length;dm.priority)&&-1!=m.restrict.indexOf(f)&&(k&&(m=Sb(m,{$$start:k,$$end:l})),b.push(m),h=m)}catch(t){c(t)}}return h}function O(b){if(e.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,f=c.length;d"+b+"",c.childNodes[0].childNodes;default:return b}}function R(a,b){if("srcdoc"==b)return la.HTML;var c=ra(a);return"xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||"ngSrc"==b)?la.RESOURCE_URL:void 0}function Y(a,c,d,e,f){var g=R(a,e);f=h[e]||f;var k=b(d,!0,g,f);if(k){if("multiple"===e&&"select"===ra(a))throw ja("selmulti",ta(a));c.push({priority:100,compile:function(){return{pre:function(a,c,h){if(c=h.$$observers||(h.$$observers=Z()),l.test(e))throw ja("nodomevents");var m=h[e];m!==d&&(k=m&&b(m,!0,g,f),d=m),k&&(h[e]=k(a),(c[e]||(c[e]=[])).$$inter=!0,(h.$$observers&&h.$$observers[e].$$scope||a).$watch(k,function(a,b){"class"===e&&a!=b?h.$updateClass(a,b):h.$set(e,a)}))}}}})}}function aa(a,b,c){var g,h,d=b[0],e=b.length,f=d.parentNode;if(a)for(g=0,h=a.length;g=b)return a;for(;b--;)8===a[b].nodeType&&ag.call(a,b,1);return a}function Wc(a,b){if(b&&F(b))return b;if(F(a)){var d=dd.exec(a);if(d)return d[3]}}function ff(){var a={},b=!1;this.register=function(b,c){Ta(b,"controller"),E(b)?T(a,b):a[b]=c},this.allowGlobals=function(){b=!0},this.$get=["$injector","$window",function(d,c){function e(a,b,c,d){if(!a||!E(a.$scope))throw H("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,g,h,k){var l,m,r;if(h=!0===h,k&&F(k)&&(r=k),F(f)){if(!(k=f.match(dd)))throw bg("ctrlfmt",f);m=k[1],r=r||k[3],f=a.hasOwnProperty(m)?a[m]:Dc(g.$scope,m,!0)||(b?Dc(c,m,!0):v),Sa(f,m,!0)}return h?(h=(L(f)?f[f.length-1]:f).prototype,l=Object.create(h||null),r&&e(g,r,l,m||f.name),T(function(){var a=d.invoke(f,l,g,m);return a!==l&&(E(a)||D(a))&&(l=a,r&&e(g,r,l,m||f.name)),l},{instance:l,identifier:r})):(l=d.instantiate(f,g,m),r&&e(g,r,l,m||f.name),l)}}]}function gf(){this.$get=["$window",function(a){return C(a.document)}]}function hf(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,arguments)}}]}function bc(a){return E(a)?V(a)?a.toISOString():eb(a):a}function nf(){this.$get=function(){return function(a){if(!a)return"";var b=[];return rc(a,function(a,c){null===a||x(a)||(L(a)?n(a,function(a,d){b.push(ha(c)+"="+ha(bc(a)))}):b.push(ha(c)+"="+ha(bc(a))))}),b.join("&")}}}function of(){this.$get=function(){return function(a){function b(a,e,f){null===a||x(a)||(L(a)?n(a,function(a,c){b(a,e+"["+(E(a)?c:"")+"]")}):E(a)&&!V(a)?rc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):d.push(ha(e)+"="+ha(bc(a))))}if(!a)return"";var d=[];return b(a,"",!0),d.join("&")}}}function cc(a,b){if(F(a)){var d=a.replace(cg,"").trim();if(d){var c=b("Content-Type");(c=c&&0===c.indexOf(ed))||(c=(c=d.match(dg))&&eg[c[0]].test(d)),c&&(a=wc(d))}}return a}function fd(a){var d,b=Z();return F(a)?n(a.split("\n"),function(a){d=a.indexOf(":");var e=G(X(a.substr(0,d)));a=X(a.substr(d+1)),e&&(b[e]=b[e]?b[e]+", "+a:a)}):E(a)&&n(a,function(a,d){var f=G(d),g=X(a);f&&(b[f]=b[f]?b[f]+", "+g:g)}),b}function gd(a){var b;return function(d){return b||(b=fd(a)),d?(d=b[G(d)],void 0===d&&(d=null),d):b}}function hd(a,b,d,c){return D(c)?c(a,b,d):(n(c,function(c){a=c(a,b,d)}),a)}function mf(){var a=this.defaults={transformResponse:[cc],transformRequest:[function(a){return E(a)&&"[object File]"!==ga.call(a)&&"[object Blob]"!==ga.call(a)&&"[object FormData]"!==ga.call(a)?eb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:na(dc),put:na(dc),patch:na(dc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},b=!1;this.useApplyAsync=function(a){return y(a)?(b=!!a,this):b};var d=!0;this.useLegacyPromiseExtensions=function(a){return y(a)?(d=!!a,this):d};var c=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(e,f,g,h,k,l){function m(b){function c(a){var b=T({},a);return b.data=hd(a.data,a.headers,a.status,f.transformResponse),a=a.status,200<=a&&300>a?b:k.reject(b)}function e(a,b){var c,d={};return n(a,function(a,e){D(a)?null!=(c=a(b))&&(d[e]=c):d[e]=a}),d}if(!E(b))throw H("$http")("badreq",b);if(!F(b.url))throw H("$http")("badreq",b.url);var f=T({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer},b);f.headers=function(b){var f,g,h,c=a.headers,d=T({},b.headers),c=T({},c.common,c[G(b.method)]);a:for(f in c){g=G(f);for(h in d)if(G(h)===g)continue a;d[f]=c[f]}return e(d,na(b))}(b),f.method=ub(f.method),f.paramSerializer=F(f.paramSerializer)?l.get(f.paramSerializer):f.paramSerializer;var g=[function(b){var d=b.headers,e=hd(b.data,gd(d),v,b.transformRequest);return x(e)&&n(d,function(a,b){"content-type"===G(b)&&delete d[b]}),x(b.withCredentials)&&!x(a.withCredentials)&&(b.withCredentials=a.withCredentials),r(b,e).then(c,c)},v],h=k.when(f);for(n(K,function(a){(a.request||a.requestError)&&g.unshift(a.request,a.requestError),(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;){b=g.shift();var m=g.shift(),h=h.then(b,m)}return d?(h.success=function(a){return Sa(a,"fn"),h.then(function(b){a(b.data,b.status,b.headers,f)}),h},h.error=function(a){return Sa(a,"fn"),h.then(null,function(b){a(b.data,b.status,b.headers,f)}),h}):(h.success=id("success"),h.error=id("error")),h}function r(c,d){function g(a,c,d,e){function f(){l(c,a,d,e)}K&&(200<=a&&300>a?K.put(S,[a,c,fd(d),e]):K.remove(S)),b?h.$applyAsync(f):(f(),h.$$phase||h.$apply())}function l(a,b,d,e){b=-1<=b?b:0,(200<=b&&300>b?A.resolve:A.reject)({data:a,status:b,headers:gd(d),config:c,statusText:e})}function r(a){l(a.data,a.status,na(a.headers()),a.statusText)}function z(){var a=m.pendingRequests.indexOf(c);-1!==a&&m.pendingRequests.splice(a,1)}var K,M,A=k.defer(),Q=A.promise,P=c.headers,S=s(c.url,c.paramSerializer(c.params));return m.pendingRequests.push(c),Q.then(z,z),!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(K=E(c.cache)?c.cache:E(a.cache)?a.cache:I),K&&(M=K.get(S),y(M)?M&&D(M.then)?M.then(r,r):L(M)?l(M[1],M[0],na(M[2]),M[3]):l(M,200,{},"OK"):K.put(S,Q)),x(M)&&((M=jd(c.url)?f()[c.xsrfCookieName||a.xsrfCookieName]:v)&&(P[c.xsrfHeaderName||a.xsrfHeaderName]=M),e(c.method,S,d,g,P,c.timeout,c.withCredentials,c.responseType)),Q}function s(a,b){return 0=l&&(u.resolve(p),t(n.$$intervalId),delete g[n.$$intervalId]),w||a.$apply()},k),g[n.$$intervalId]=u,n}var g={};return f.cancel=function(a){return!!(a&&a.$$intervalId in g)&&(g[a.$$intervalId].reject("canceled"),b.clearInterval(a.$$intervalId),delete g[a.$$intervalId],!0)},f}]}function ec(a){a=a.split("/");for(var b=a.length;b--;)a[b]=qb(a[b]);return a.join("/")}function kd(a,b){var d=za(a);b.$$protocol=d.protocol,b.$$host=d.hostname,b.$$port=ca(d.port)||gg[d.protocol]||null}function ld(a,b){var d="/"!==a.charAt(0);d&&(a="/"+a);var c=za(a);b.$$path=decodeURIComponent(d&&"/"===c.pathname.charAt(0)?c.pathname.substring(1):c.pathname),b.$$search=zc(c.search),b.$$hash=decodeURIComponent(c.hash),b.$$path&&"/"!=b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function pa(a,b){if(0===b.indexOf(a))return b.substr(a.length)}function Ia(a){var b=a.indexOf("#");return-1==b?a:a.substr(0,b)}function kb(a){return a.replace(/(#.+)|#$/,"$1")}function fc(a,b,d){this.$$html5=!0,d=d||"",kd(a,this),this.$$parse=function(a){var d=pa(b,a);if(!F(d))throw Gb("ipthprfx",a,b);ld(d,this),this.$$path||(this.$$path="/"),this.$$compose()},this.$$compose=function(){var a=Ub(this.$$search),d=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=ec(this.$$path)+(a?"?"+a:"")+d,this.$$absUrl=b+this.$$url.substr(1)},this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;return y(f=pa(a,c))?(g=f,g=y(f=pa(d,f))?b+(pa("/",f)||f):a+g):y(f=pa(b,c))?g=b+f:b==c+"/"&&(g=b),g&&this.$$parse(g),!!g}}function gc(a,b,d){kd(a,this),this.$$parse=function(c){var f,e=pa(a,c)||pa(b,c);x(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",x(e)&&(a=c,this.replace())):(f=pa(d,e),x(f)&&(f=e)),ld(f,this),c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;0===f.indexOf(e)&&(f=f.replace(e,"")),g.exec(f)||(c=(f=g.exec(c))?f[1]:c),this.$$path=c,this.$$compose()},this.$$compose=function(){var b=Ub(this.$$search),e=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=ec(this.$$path)+(b?"?"+b:"")+e,this.$$absUrl=a+(this.$$url?d+this.$$url:"")},this.$$parseLinkUrl=function(b,d){return Ia(a)==Ia(b)&&(this.$$parse(b),!0)}}function md(a,b,d){this.$$html5=!0,gc.apply(this,arguments),this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;return a==Ia(c)?f=c:(g=pa(b,c))?f=a+d+g:b===c+"/"&&(f=b),f&&this.$$parse(f),!!f},this.$$compose=function(){var b=Ub(this.$$search),e=this.$$hash?"#"+qb(this.$$hash):"";this.$$url=ec(this.$$path)+(b?"?"+b:"")+e,this.$$absUrl=a+d+this.$$url}}function Hb(a){return function(){return this[a]}}function nd(a,b){return function(d){return x(d)?this[a]:(this[a]=b(d),this.$$compose(),this)}}function rf(){var a="",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return y(b)?(a=b,this):a},this.html5Mode=function(a){return Na(a)?(b.enabled=a,this):E(a)?(Na(a.enabled)&&(b.enabled=a.enabled),Na(a.requireBase)&&(b.requireBase=a.requireBase),Na(a.rewriteLinks)&&(b.rewriteLinks=a.rewriteLinks),this):b},this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(d,c,e,f,g){function h(a,b,d){var e=l.url(),f=l.$$state;try{c.url(a,b,d),l.$$state=c.state()}catch(g){throw l.url(e),l.$$state=f,g}}function k(a,b){d.$broadcast("$locationChangeSuccess",l.absUrl(),a,l.$$state,b)}var l,m;m=c.baseHref();var s,r=c.url();if(b.enabled){if(!m&&b.requireBase)throw Gb("nobase");s=r.substring(0,r.indexOf("/",r.indexOf("//")+2))+(m||"/"),m=e.history?fc:md}else s=Ia(r),m=gc;var I=s.substr(0,Ia(s).lastIndexOf("/")+1);l=new m(s,I,"#"+a),l.$$parseLinkUrl(r,r),l.$$state=c.state();var n=/^\s*(javascript|mailto):/i;f.on("click",function(a){if(b.rewriteLinks&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!=a.which&&2!=a.button){for(var e=C(a.target);"a"!==ra(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),k=e.attr("href")||e.attr("xlink:href");E(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=za(h.animVal).href),n.test(h)||!h||e.attr("target")||a.isDefaultPrevented()||!l.$$parseLinkUrl(h,k)||(a.preventDefault(),l.absUrl()!=c.url()&&(d.$apply(),g.angular["ff-684208-preventDefault"]=!0))}}),kb(l.absUrl())!=kb(r)&&c.url(l.absUrl(),!0);var t=!0;return c.onUrlChange(function(a,b){x(pa(I,a))?g.location.href=a:(d.$evalAsync(function(){var f,c=l.absUrl(),e=l.$$state;a=kb(a),l.$$parse(a),l.$$state=b,f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented,l.absUrl()===a&&(f?(l.$$parse(c),l.$$state=e,h(c,!1,e)):(t=!1,k(c,e)))}),d.$$phase||d.$digest())}),d.$watch(function(){var a=kb(c.url()),b=kb(l.absUrl()),f=c.state(),g=l.$$replace,m=a!==b||l.$$html5&&e.history&&f!==l.$$state;(t||m)&&(t=!1,d.$evalAsync(function(){var b=l.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,l.$$state,f).defaultPrevented;l.absUrl()===b&&(c?(l.$$parse(a),l.$$state=f):(m&&h(b,g,f===l.$$state?null:l.$$state),k(a,f)))})),l.$$replace=!1}),l}]}function sf(){var a=!0,b=this;this.debugEnabled=function(b){return y(b)?(a=b,this):a},this.$get=["$window",function(d){function c(a){return a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line)),a}function e(a){var b=d.console||{},e=b[a]||b.log||B;a=!1;try{a=!!e.apply}catch(k){}return a?function(){var a=[];return n(arguments,function(b){a.push(c(b))}),e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function Xa(a,b){if("__defineGetter__"===a||"__defineSetter__"===a||"__lookupGetter__"===a||"__lookupSetter__"===a||"__proto__"===a)throw ka("isecfld",b);return a}function hg(a){return a+""}function Aa(a,b){if(a){if(a.constructor===a)throw ka("isecfn",b);if(a.window===a)throw ka("isecwindow",b);if(a.children&&(a.nodeName||a.prop&&a.attr&&a.find))throw ka("isecdom",b);if(a===Object)throw ka("isecobj",b)}return a}function od(a,b){if(a){if(a.constructor===a)throw ka("isecfn",b);if(a===ig||a===jg||a===kg)throw ka("isecff",b)}}function Ib(a,b){if(a&&(a===(0).constructor||a===(!1).constructor||a==="".constructor||a==={}.constructor||a===[].constructor||a===Function.constructor))throw ka("isecaf",b)}function lg(a,b){return void 0!==a?a:b}function pd(a,b){return void 0===a?b:void 0===b?a:a+b}function R(a,b){var d,c;switch(a.type){case q.Program:d=!0,n(a.body,function(a){R(a.expression,b),d=d&&a.expression.constant}),a.constant=d;break;case q.Literal:a.constant=!0,a.toWatch=[];break;case q.UnaryExpression:R(a.argument,b),a.constant=a.argument.constant,a.toWatch=a.argument.toWatch;break;case q.BinaryExpression:R(a.left,b),R(a.right,b),a.constant=a.left.constant&&a.right.constant,a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case q.LogicalExpression:R(a.left,b),R(a.right,b),a.constant=a.left.constant&&a.right.constant,a.toWatch=a.constant?[]:[a];break;case q.ConditionalExpression:R(a.test,b),R(a.alternate,b),R(a.consequent,b),a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant,a.toWatch=a.constant?[]:[a];break;case q.Identifier:a.constant=!1,a.toWatch=[a];break;case q.MemberExpression:R(a.object,b),a.computed&&R(a.property,b),a.constant=a.object.constant&&(!a.computed||a.property.constant),a.toWatch=[a];break;case q.CallExpression:d=!!a.filter&&!b(a.callee.name).$stateful,c=[],n(a.arguments,function(a){R(a,b),d=d&&a.constant,a.constant||c.push.apply(c,a.toWatch)}),a.constant=d,a.toWatch=a.filter&&!b(a.callee.name).$stateful?c:[a];break;case q.AssignmentExpression:R(a.left,b),R(a.right,b),a.constant=a.left.constant&&a.right.constant,a.toWatch=[a];break;case q.ArrayExpression:d=!0,c=[],n(a.elements,function(a){R(a,b),d=d&&a.constant,a.constant||c.push.apply(c,a.toWatch)}),a.constant=d,a.toWatch=c;break;case q.ObjectExpression:d=!0,c=[],n(a.properties,function(a){R(a.value,b),d=d&&a.value.constant,a.value.constant||c.push.apply(c,a.value.toWatch)}),a.constant=d,a.toWatch=c;break;case q.ThisExpression:a.constant=!1,a.toWatch=[];break;case q.LocalsExpression:a.constant=!1,a.toWatch=[]}}function qd(a){if(1==a.length){a=a[0].expression;var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:v}}function rd(a){return a.type===q.Identifier||a.type===q.MemberExpression}function sd(a){if(1===a.body.length&&rd(a.body[0].expression))return{type:q.AssignmentExpression,left:a.body[0].expression,right:{type:q.NGValueParameter},operator:"="}}function td(a){return 0===a.body.length||1===a.body.length&&(a.body[0].expression.type===q.Literal||a.body[0].expression.type===q.ArrayExpression||a.body[0].expression.type===q.ObjectExpression)}function ud(a,b){this.astBuilder=a,this.$filter=b}function vd(a,b){this.astBuilder=a,this.$filter=b}function Jb(a){return"constructor"==a}function hc(a){return D(a.valueOf)?a.valueOf():mg.call(a)}function tf(){var a=Z(),b=Z();this.$get=["$filter",function(d){function c(c,f,r){var u,n,z;switch(r=r||K,typeof c){case"string":z=c=c.trim();var A=r?b:a;if(!(u=A[z])){":"===c.charAt(0)&&":"===c.charAt(1)&&(n=!0,c=c.substring(2)),u=r?I:s;var Q=new ic(u);u=new jc(Q,d,u).parse(c),u.constant?u.$$watchDelegate=l:n?u.$$watchDelegate=u.literal?k:h:u.inputs&&(u.$$watchDelegate=g),r&&(u=e(u)),A[z]=u}return m(u,f);case"function":return m(c,f);default:return m(B,f)}}function e(a){function b(c,d,e,f){var g=K;K=!0;try{return a(c,d,e,f)}finally{K=g}}if(!a)return a;b.$$watchDelegate=a.$$watchDelegate,b.assign=e(a.assign),b.constant=a.constant,b.literal=a.literal;for(var c=0;a.inputs&&c=this.promise.$$state.status&&d&&d.length&&a(function(){for(var a,e,f=0,g=d.length;fa)for(b in l++,f)sa.call(e,b)||(u--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var e,f,h,d=this,k=1I&&(x=4-I,y[x]||(y[x]=[]),y[x].push({msg:D(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:g,oldVal:k}))}catch(E){f(E)}if(!(s=z.$$watchersCount&&z.$$childHead||z!==this&&z.$$nextSibling))for(;z!==this&&!(s=z.$$nextSibling);)z=z.$parent}while(z=s);if((n||u.length)&&!I--)throw w.$$phase=null,d("infdig",b,y)}while(n||u.length);for(w.$$phase=null;v.length;)try{v.shift()()}catch(H){f(H)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy"),this.$$destroyed=!0,this===w&&h.$$applicationDestroyed(),s(this,-this.$$watchersCount);for(var b in this.$$listenerCount)I(this,this.$$listenerCount[b],b);a&&a.$$childHead==this&&(a.$$childHead=this.$$nextSibling),a&&a.$$childTail==this&&(a.$$childTail=this.$$prevSibling),this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling),this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling),this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=B,this.$on=this.$watch=this.$watchGroup=function(){return B},this.$$listeners={},this.$$nextSibling=null,l(this)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){w.$$phase||u.length||h.defer(function(){u.length&&w.$digest()}),u.push({scope:this,expression:g(a),locals:b})},$$postDigest:function(a){v.push(a)},$apply:function(a){try{r("$apply");try{return this.$eval(a)}finally{w.$$phase=null}}catch(b){f(b)}finally{try{w.$digest()}catch(c){throw f(c),c}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&z.push(b),a=g(a),p()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]),c.push(b);var d=this;do{d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++}while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,I(e,1,a))}},$emit:function(a,b){var d,l,m,c=[],e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=db([h],arguments,1);do{for(d=e.$$listeners[a]||c,h.currentScope=e,l=0,m=d.length;lxa)throw Ba("iequirks");var c=na(qa);c.isEnabled=function(){return a},c.trustAs=d.trustAs,c.getTrusted=d.getTrusted,c.valueOf=d.valueOf,a||(c.trustAs=c.getTrusted=function(a,b){return b},c.valueOf=ab),c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;return n(qa,function(a,b){var d=G(b);c[gb("parse_as_"+d)]=function(b){return e(a,b)},c[gb("get_trusted_"+d)]=function(b){return f(a,b)},c[gb("trust_as_"+d)]=function(b){return g(a,b)}}),c}]}function zf(){this.$get=["$window","$document",function(a,b){var g,d={},c=ca((/android (\d+)/.exec(G((a.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((a.navigator||{}).userAgent),f=b[0]||{},h=/^(Moz|webkit|ms)(?=[A-Z])/,k=f.body&&f.body.style,l=!1,m=!1;if(k){for(var r in k)if(l=h.exec(r)){g=l[0],g=g.substr(0,1).toUpperCase()+g.substr(1);break}g||(g="WebkitOpacity"in k&&"webkit"),l=!!("transition"in k||g+"Transition"in k),m=!!("animation"in k||g+"Animation"in k),!c||l&&m||(l=F(k.webkitTransition),m=F(k.webkitAnimation))}return{history:!(!a.history||!a.history.pushState||4>c||e),hasEvent:function(a){if("input"===a&&11>=xa)return!1;if(x(d[a])){var b=f.createElement("div");d[a]="on"+a in b}return d[a]},csp:Ea(),vendorPrefix:g,transitions:l,animations:m,android:c}}]}function Bf(){var a;this.httpOptions=function(b){return b?(a=b,this):a},this.$get=["$templateCache","$http","$q","$sce",function(b,d,c,e){function f(g,h){f.totalPendingRequests++,F(g)&&b.get(g)||(g=e.getTrustedResourceUrl(g));var k=d.defaults&&d.defaults.transformResponse;return L(k)?k=k.filter(function(a){return a!==cc}):k===cc&&(k=null),d.get(g,T({cache:b,transformResponse:k},a)).finally(function(){f.totalPendingRequests--}).then(function(a){return b.put(g,a.data),a.data},function(a){if(!h)throw ja("tpload",g,a.status,a.statusText);return c.reject(a)})}return f.totalPendingRequests=0,f}]}function Cf(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];return n(a,function(a){var c=ia.element(a).data("$binding");c&&n(c,function(c){d?new RegExp("(^|\\s)"+xd(b)+"(\\s|\\||$)").test(c)&&g.push(a):-1!=c.indexOf(b)&&g.push(a)})}),g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],h=0;hc&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length),e=0;a.charAt(e)==lc;e++);if(e==(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)==lc;)g--;for(c-=e,d=[],f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}return c>Hd&&(d=d.splice(0,Hd-1),b=c-1,c=1),{d:d,e:b,i:c}}function vg(a,b,d,c){var e=a.d,f=e.length-a.i;if(b=x(b)?Math.min(Math.max(d,f),c):+b,d=b+a.i,c=e[d],0h;)k.unshift(0),h++;for(0b.lgSize&&h.unshift(k.splice(-b.lgSize).join(""));k.length>b.gSize;)h.unshift(k.splice(-b.gSize).join(""));k.length&&h.unshift(k.join("")),k=h.join(d),f.length&&(k+=c+f.join("")),e&&(k+="e+"+e)}return 0>a&&!g?b.negPre+k+b.negSuf:b.posPre+k+b.posSuf}function Kb(a,b,d){var c="";for(0>a&&(c="-",a=-a),a=""+a;a.length-d)&&(e+=d),0===e&&-12==d&&(e=12),Kb(e,b,c)}}function Lb(a,b){return function(d,c){var e=d["get"+a]();return c[ub(b?"SHORT"+a:a)][e]}}function Id(a){var b=new Date(a,0,1).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Jd(a){return function(b){var d=Id(b.getFullYear());return b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d,b=1+Math.round(b/6048e5),Kb(b,a)}}function mc(a,b){return 0>=a.getFullYear()?b.ERAS[0]:b.ERAS[1]}function Cd(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,k=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=ca(b[9]+b[10]),g=ca(b[9]+b[11])),h.call(a,ca(b[1]),ca(b[2])-1,ca(b[3])),f=ca(b[4]||0)-f,g=ca(b[5]||0)-g,h=ca(b[6]||0),b=Math.round(1e3*parseFloat("0."+(b[7]||0))),k.call(a,f,g,h,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d,f){var k,l,g="",h=[];if(d=d||"mediumDate",d=a.DATETIME_FORMATS[d]||d,F(c)&&(c=wg.test(c)?ca(c):b(c)),N(c)&&(c=new Date(c)),!V(c)||!isFinite(c.getTime()))return c;for(;d;)(l=xg.exec(d))?(h=db(h,l,1),d=h.pop()):(h.push(d),d=null);var m=c.getTimezoneOffset();return f&&(m=xc(f,m),c=Tb(c,f,!0)),n(h,function(b){k=yg[b],g+=k?k(c,a.DATETIME_FORMATS,m):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")}),g}}function pg(){return function(a,b){return x(b)&&(b=2),eb(a,b)}}function qg(){return function(a,b,d){return b=1/0===Math.abs(Number(b))?Number(b):ca(b),isNaN(b)?a:(N(a)&&(a=a.toString()),L(a)||F(a)?(d=!d||isNaN(d)?0:ca(d),d=0>d?Math.max(0,a.length+d):d,0<=b?a.slice(d,d+b):0===d?a.slice(b,a.length):a.slice(Math.max(0,d+b),d)):a)}}function Ed(a){function b(b,d){return d=d?-1:1,b.map(function(b){var c=1,h=ab;if(D(b))h=b;else if(F(b)&&("+"!=b.charAt(0)&&"-"!=b.charAt(0)||(c="-"==b.charAt(0)?-1:1,b=b.substring(1)),""!==b&&(h=a(b),h.constant)))var k=h(),h=function(a){return a[k]};return{get:h,descending:c*d}})}function d(a){switch(typeof a){case"number":case"boolean":case"string":return!0;default:return!1}}return function(a,e,f){if(null==a)return a;if(!Ca(a))throw H("orderBy")("notarray",a);L(e)||(e=[e]),0===e.length&&(e=["+"]);var g=b(e,f);return g.push({get:function(){return{}},descending:f?-1:1}),a=Array.prototype.map.call(a,function(a,b){return{value:a,predicateValues:g.map(function(c){var e=c.get(a);return c=typeof e,null===e?(c="string",e="null"):"string"===c?e=e.toLowerCase():"object"===c&&("function"==typeof e.valueOf&&(e=e.valueOf(),d(e))||tc(e)&&(e=e.toString(),d(e))||(e=b)),{value:e,type:c}})}}),a.sort(function(a,b){for(var c=0,d=0,e=g.length;db||37<=b&&40>=b||m(a,this,this.value)}),e.hasEvent("paste")&&b.on("paste cut",m)}b.on("change",k),c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Ob(a,b){return function(d,c){var e,f;if(V(d))return d;if(F(d)){if('"'==d.charAt(0)&&'"'==d.charAt(d.length-1)&&(d=d.substring(1,d.length-1)),zg.test(d))return new Date(d);if(a.lastIndex=0,e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1e3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},n(e,function(a,c){c=t},g.$observe("min",function(a){t=s(a),h.$validate()})}if(y(g.max)||g.ngMax){var p;h.$validators.max=function(a){return!r(a)||x(p)||d(a)<=p},g.$observe("max",function(a){p=s(a),h.$validate()})}}}function Md(a,b,d,c){(c.$$hasNativeValidators=E(b[0].validity))&&c.$parsers.push(function(a){var c=b.prop("validity")||{};return c.badInput||c.typeMismatch?v:a})}function Nd(a,b,d,c,e){if(y(c)){if(a=a(c),!a.constant)throw nb("constexpr",d,c);return a(b)}return e}function oc(a,b){return a="ngClass"+a,["$animate",function(d){function c(a,b){var c=[],d=0;a:for(;d(?:<\/\1>|)$/,Wb=/<|&#?\w+;/,Lf=/<([\w:-]+)/,Mf=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,da={option:[1,'"],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};da.optgroup=da.option,da.tbody=da.tfoot=da.colgroup=da.caption=da.thead,da.th=da.td;var Tf=Node.prototype.contains||function(a){return!!(16&this.compareDocumentPosition(a))},Ra=U.prototype={ready:function(a){function b(){d||(d=!0,a())}var d=!1;"complete"===W.readyState?setTimeout(b):(this.on("DOMContentLoaded",b),U(O).on("load",b))},toString:function(){var a=[];return n(this,function(b){a.push(""+b)}),"["+a.join(", ")+"]"},eq:function(a){return C(0<=a?this[a]:this[this.length+a])},length:0,push:Bg,sort:[].sort,splice:[].splice},Db={};n("multiple selected checked disabled readOnly required open".split(" "),function(a){Db[G(a)]=a});var Uc={};n("input select option textarea button form details".split(" "),function(a){Uc[a]=!0});var cd={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};n({data:Zb,removeData:hb,hasData:function(a){for(var b in ib[a.ng339])return!0;return!1},cleanData:function(a){for(var b=0,d=a.length;b/,Wf=/^[^\(]*\(\s*([^\)]*)\)/m,Cg=/,/,Dg=/^\s*(_?)(\S+?)\1\s*$/,Uf=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,Ga=H("$injector");fb.$$annotate=function(a,b,d){var c;if("function"==typeof a){if(!(c=a.$inject)){if(c=[],a.length){if(b)throw F(d)&&d||(d=a.name||Xf(a)),Ga("strictdi",d);b=Vc(a),n(b[1].split(Cg),function(a){a.replace(Dg,function(a,b,d){c.push(d)})})}a.$inject=c}}else L(a)?(b=a.length-1,Sa(a[b],"fn"),c=a.slice(0,b)):Sa(a,"fn",!0);return c};var Rd=H("$animate"),$e=function(){this.$get=function(){}},af=function(){var a=new Ua,b=[];this.$get=["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;return b&&(b=F(b)?b.split(" "):L(b)?b:[],n(b,function(b){b&&(d=!0,a[b]=c)})),d}function f(){n(b,function(b){var c=a.get(b);if(c){var d=Yf(b.attr("class")),e="",f="";n(c,function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)}),n(b,function(a){e&&Bb(a,e),f&&Ab(a,f)}),a.remove(b)}}),b.length=0}return{enabled:B,on:B,off:B,pin:B,push:function(g,h,k,l){return l&&l(),k=k||{},k.from&&g.css(k.from),k.to&&g.css(k.to),(k.addClass||k.removeClass)&&(h=k.addClass,l=k.removeClass,k=a.get(g)||{},h=e(k,h,!0),l=e(k,l,!1),(h||l)&&(a.put(g,k),b.push(g),1===b.length&&c.$$postDigest(f))),g=new d,g.complete(),g}}}]},Ye=["$provide",function(a){var b=this;this.$$registeredAnimations=Object.create(null),this.register=function(d,c){if(d&&"."!==d.charAt(0))throw Rd("notcsel",d);var e=d+"-animation";b.$$registeredAnimations[d.substr(1)]=e,a.factory(e,c)},this.classNameFilter=function(a){if(1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null)&&/(\s+|\/)ng-animate(\s+|\/)/.test(this.$$classNameFilter.toString()))throw Rd("nongcls","ng-animate");return this.$$classNameFilter},this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var h;a:{for(h=0;h <= >= && || ! = |".split(" "),function(a){Pb[a]=!0});var Hg={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},ic=function(a){this.options=a};ic.prototype={constructor:ic,lex:function(a){for(this.text=a,this.index=0,this.tokens=[];this.index=a&&"string"==typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||" "===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){throw d=d||this.index,b=y(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d,ka("lexerr",a,b,this.text)},readNumber:function(){for(var a="",b=this.index;this.index","<=",">=");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var b,a=this.multiplicative();b=this.expect("+","-");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var b,a=this.unary();b=this.expect("*","/","%");)a={type:q.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:q.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.constants.hasOwnProperty(this.peek().text)?a=Oa(this.constants[this.consume().text]):this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:q.CallExpression,callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:q.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:q.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:q.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==this.peekToken().text)do{a.push(this.expression())}while(this.expect(","));return a},identifier:function(){var a=this.consume();return a.identifier||this.throwError("is not a valid identifier",a),{type:q.Identifier,name:a.text}},constant:function(){return{type:q.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text)do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","));return this.consume("]"),{type:q.ArrayExpression,elements:a}},object:function(){var b,a=[];if("}"!==this.peekToken().text)do{if(this.peek("}"))break;b={type:q.Property,kind:"init"},this.peek().constant?b.key=this.constant():this.peek().identifier?b.key=this.identifier():this.throwError("invalid key",this.peek()),this.consume(":"),b.value=this.expression(),a.push(b)}while(this.expect(","));return this.consume("}"),{type:q.ObjectExpression,properties:a}},throwError:function(a,b){throw ka("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index))},consume:function(a){if(0===this.tokens.length)throw ka("ueoe",this.text);var b=this.expect(a);return b||this.throwError("is unexpected, expecting ["+a+"]",this.peek()),b},peekToken:function(){if(0===this.tokens.length)throw ka("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return!!(a=this.peek(a,b,d,c))&&(this.tokens.shift(),a)},constants:{true:{type:q.Literal,value:!0},false:{type:q.Literal,value:!1},null:{type:q.Literal,value:null},undefined:{type:q.Literal,value:v},this:{type:q.ThisExpression},$locals:{type:q.LocalsExpression}}},ud.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:b,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]},R(c,d.$filter);var f,e="";return this.stage="assign",(f=sd(c))&&(this.state.computing="assign",e=this.nextId(),this.recurse(f,e),this.return_(e),e="fn.assign="+this.generateFunction("assign","s,v,l")),f=qd(c.body),d.stage="inputs",n(f,function(a,b){var c="fn"+b;d.state[c]={vars:[],body:[],own:{}},d.state.computing=c;var e=d.nextId();d.recurse(a,e),d.return_(e),d.state.inputs.push(c),a.watchId=b}),this.state.computing="fn",this.stage="main",this.recurse(c),e='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+e+this.watchFns()+"return fn;",e=new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue","ensureSafeAssignContext","ifDefined","plus","text",e)(this.$filter,Xa,Aa,od,hg,Ib,lg,pd,a),this.state=this.stage=v,e.literal=td(c),e.constant=c.constant,e},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;return n(b,function(b){a.push("var "+b+"="+d.generateFunction(b,"s"))}),b.length&&a.push("fn.inputs=["+b.join(",")+"];"),a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;return n(this.state.filters,function(d,c){a.push(d+"=$filter("+b.escape(c)+")")}),a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,h,l,m,k=this;if(c=c||B,!f&&y(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case q.Program:n(a.body,function(b,c){k.recurse(b.expression,v,v,function(a){h=a}),c!==a.body.length-1?k.current().body.push(h,";"):k.return_(h)});break;case q.Literal:m=this.escape(a.value),this.assign(b,m),c(m);break;case q.UnaryExpression:this.recurse(a.argument,v,v,function(a){h=a}),m=a.operator+"("+this.ifDefined(h,0)+")",this.assign(b,m),c(m);break;case q.BinaryExpression:this.recurse(a.left,v,v,function(a){g=a}),this.recurse(a.right,v,v,function(a){h=a}),m="+"===a.operator?this.plus(g,h):"-"===a.operator?this.ifDefined(g,0)+a.operator+this.ifDefined(h,0):"("+g+")"+a.operator+"("+h+")",this.assign(b,m),c(m);break;case q.LogicalExpression:b=b||this.nextId(),k.recurse(a.left,b),k.if_("&&"===a.operator?b:k.not(b),k.lazyRecurse(a.right,b)),c(b);break;case q.ConditionalExpression:b=b||this.nextId(),k.recurse(a.test,b),k.if_(b,k.lazyRecurse(a.alternate,b),k.lazyRecurse(a.consequent,b)),c(b);break;case q.Identifier:b=b||this.nextId(),d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,d.name=a.name),Xa(a.name),k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"===k.stage||"s",function(){e&&1!==e&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}")),k.assign(b,k.nonComputedMember("s",a.name))})},b&&k.lazyAssign(b,k.nonComputedMember("l",a.name))),(k.state.expensiveChecks||Jb(a.name))&&k.addEnsureSafeObject(b),c(b);break;case q.MemberExpression:g=d&&(d.context=this.nextId())||this.nextId(),b=b||this.nextId(),k.recurse(a.object,g,v,function(){k.if_(k.notNull(g),function(){e&&1!==e&&k.addEnsureSafeAssignContext(g),a.computed?(h=k.nextId(),k.recurse(a.property,h),k.getStringValue(h),k.addEnsureSafeMemberName(h),e&&1!==e&&k.if_(k.not(k.computedMember(g,h)),k.lazyAssign(k.computedMember(g,h),"{}")),m=k.ensureSafeObject(k.computedMember(g,h)),k.assign(b,m),d&&(d.computed=!0,d.name=h)):(Xa(a.property.name),e&&1!==e&&k.if_(k.not(k.nonComputedMember(g,a.property.name)),k.lazyAssign(k.nonComputedMember(g,a.property.name),"{}")),m=k.nonComputedMember(g,a.property.name),(k.state.expensiveChecks||Jb(a.property.name))&&(m=k.ensureSafeObject(m)),k.assign(b,m),d&&(d.computed=!1,d.name=a.property.name))},function(){k.assign(b,"undefined")}),c(b)},!!e);break;case q.CallExpression:b=b||this.nextId(),a.filter?(h=k.filter(a.callee.name),l=[],n(a.arguments,function(a){var b=k.nextId();k.recurse(a,b),l.push(b)}),m=h+"("+l.join(",")+")",k.assign(b,m),c(b)):(h=k.nextId(),g={},l=[],k.recurse(a.callee,h,g,function(){k.if_(k.notNull(h),function(){k.addEnsureSafeFunction(h),n(a.arguments,function(a){k.recurse(a,k.nextId(),v,function(a){l.push(k.ensureSafeObject(a))})}),g.name?(k.state.expensiveChecks||k.addEnsureSafeObject(g.context),m=k.member(g.context,g.name,g.computed)+"("+l.join(",")+")"):m=h+"("+l.join(",")+")",m=k.ensureSafeObject(m),k.assign(b,m)},function(){k.assign(b,"undefined")}),c(b)}));break;case q.AssignmentExpression:if(h=this.nextId(),g={},!rd(a.left))throw ka("lval");this.recurse(a.left,v,g,function(){k.if_(k.notNull(g.context),function(){k.recurse(a.right,h),k.addEnsureSafeObject(k.member(g.context,g.name,g.computed)),k.addEnsureSafeAssignContext(g.context),m=k.member(g.context,g.name,g.computed)+a.operator+h,k.assign(b,m),c(b||m)})},1);break;case q.ArrayExpression:l=[],n(a.elements,function(a){k.recurse(a,k.nextId(),v,function(a){l.push(a)})}),m="["+l.join(",")+"]",this.assign(b,m),c(m);break;case q.ObjectExpression:l=[],n(a.properties,function(a){k.recurse(a.value,k.nextId(),v,function(b){l.push(k.escape(a.key.type===q.Identifier?a.key.name:""+a.key.value)+":"+b)})}),m="{"+l.join(",")+"}",this.assign(b,m),c(m);break;case q.ThisExpression:this.assign(b,"s"),c("s");break;case q.LocalsExpression:this.assign(b,"l"),c("l");break;case q.NGValueParameter:this.assign(b,"v"),c("v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;return c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")")),c[d]},assign:function(a,b){if(a)return this.current().body.push(a,"=",b,";"),a},filter:function(a){return this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0)),this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){"),b(),c.push("}"),d&&(c.push("else{"),d(),c.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,b){return a+"."+b},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a),";")},addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),";")},addEnsureSafeAssignContext:function(a){this.current().body.push(this.ensureSafeAssignContext(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},ensureSafeAssignContext:function(a){return"ensureSafeAssignContext("+a+",text)"},lazyRecurse:function(a,b,d,c,e,f){var g=this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(F(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(N(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if(void 0===a)return"undefined";throw ka("esc")},nextId:function(a,b){var d="v"+this.state.nextId++;return a||this.current().vars.push(d+(b?"="+b:"")),d},current:function(){return this.state[this.state.computing]}},vd.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.expression=a,this.expensiveChecks=b,R(c,d.$filter);var e,f;(e=sd(c))&&(f=this.recurse(e)),e=qd(c.body);var g;e&&(g=[],n(e,function(a,b){var c=d.recurse(a);a.input=c,g.push(c),a.watchId=b}));var h=[];return n(c.body,function(a){h.push(d.recurse(a.expression))}),e=0===c.body.length?function(){}:1===c.body.length?h[0]:function(a,b){var c;return n(h,function(d){c=d(a,b)}),c},f&&(e.assign=function(a,b,c){return f(a,c,b)}),g&&(e.inputs=g),e.literal=td(c),e.constant=c.constant,e},recurse:function(a,b,d){var c,e,g,f=this;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case q.Literal:return this.value(a.value,b);case q.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case q.BinaryExpression:case q.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case q.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case q.Identifier:return Xa(a.name,f.expression),f.identifier(a.name,f.expensiveChecks||Jb(a.name),b,d,f.expression);case q.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(Xa(a.property.name,f.expression),e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d,f.expression):this.nonComputedMember(c,e,f.expensiveChecks,b,d,f.expression);case q.CallExpression:return g=[],n(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var r=[],n=0;n":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)>b(c,e,f,g),d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)<=b(c,e,f,g),d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)>=b(c,e,f,g),d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)&&b(c,e,f,g),d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){return c=a(c,e,f,g)||b(c,e,f,g),d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,h){return e=a(e,f,g,h)?b(e,f,g,h):d(e,f,g,h),c?{value:e}:e}},value:function(a,b){return function(){return b?{context:v,name:v,value:a}:a}},identifier:function(a,b,d,c,e){return function(f,g,h,k){return f=g&&a in g?g:f,c&&1!==c&&f&&!f[a]&&(f[a]={}),g=f?f[a]:v,b&&Aa(g,e),d?{context:f,name:a,value:g}:g}},computedMember:function(a,b,d,c,e){return function(f,g,h,k){var m,n,l=a(f,g,h,k);return null!=l&&(m=b(f,g,h,k),m+="",Xa(m,e),c&&1!==c&&(Ib(l),l&&!l[m]&&(l[m]={})),n=l[m],Aa(n,e)),d?{context:l,name:m,value:n}:n}},nonComputedMember:function(a,b,d,c,e,f){return function(g,h,k,l){return g=a(g,h,k,l),e&&1!==e&&(Ib(g),g&&!g[b]&&(g[b]={})),h=null!=g?g[b]:v,(d||Jb(b))&&Aa(h,f),c?{context:g,name:b,value:h}:h}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};var jc=function(a,b,d){this.lexer=a,this.$filter=b,this.options=d,this.ast=new q(this.lexer),this.astCompiler=d.csp?new vd(this.ast,b):new ud(this.ast,b)};jc.prototype={constructor:jc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};var mg=Object.prototype.valueOf,Ba=H("$sce"),qa={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},ja=H("$compile"),Y=W.createElement("a"),zd=za(O.location.href);Ad.$inject=["$document"],Lc.$inject=["$provide"];var Hd=22,Gd=".",lc="0";Bd.$inject=["$locale"],Dd.$inject=["$locale"];var yg={yyyy:aa("FullYear",4),yy:aa("FullYear",2,0,!0),y:aa("FullYear",1),MMMM:Lb("Month"),MMM:Lb("Month",!0),MM:aa("Month",2,1),M:aa("Month",1,1),dd:aa("Date",2),d:aa("Date",1),HH:aa("Hours",2),H:aa("Hours",1),hh:aa("Hours",2,-12),h:aa("Hours",1,-12),mm:aa("Minutes",2),m:aa("Minutes",1),ss:aa("Seconds",2),s:aa("Seconds",1),sss:aa("Milliseconds",3),EEEE:Lb("Day"),EEE:Lb("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){return a=-1*d,a=(0<=a?"+":"")+(Kb(Math[0=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},xg=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,wg=/^\-?\d+$/;Cd.$inject=["$locale"];var rg=ba(G),sg=ba(ub);Ed.$inject=["$parse"];var oe=ba({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===ga.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),vb={};n(Db,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}if("multiple"!=a){var c=va("ng-"+b),e=d;"checked"===a&&(e=function(a,b,e){e.ngModel!==e[c]&&d(a,b,e)}),vb[c]=function(){return{restrict:"A",priority:100,link:e}}}}),n(cd,function(a,b){vb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"==e.ngPattern.charAt(0)&&(c=e.ngPattern.match(Ag)))return void e.$set("ngPattern",new RegExp(c[1],c[2]));a.$watch(e[b],function(a){e.$set(b,a)})}}}}),n(["src","srcset","href"],function(a){var b=va("ng-"+a);vb[b]=function(){return{priority:99,link:function(d,c,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===ga.call(c.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null),e.$observe(b,function(b){b?(e.$set(g,b),xa&&f&&c.prop(f,e[g])):"href"===a&&e.$set(g,null)})}}}});var Mb={$addControl:B,$$renameControl:function(a,b){a.$name=b},$removeControl:B,$setValidity:B,$setDirty:B,$setPristine:B,$setSubmitted:B};Kd.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Sd=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||B}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Kd,compile:function(d,f){d.addClass(Ya).addClass(ob);var g=f.name?"name":!(!a||!f.ngForm)&&"ngForm";return{pre:function(a,d,e,f){var n=f[0];if(!("action"in e)){var s=function(b){a.$apply(function(){n.$commitViewValue(),n.$setSubmitted()}),b.preventDefault()};d[0].addEventListener("submit",s,!1),d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",s,!1)},0,!1)})}(f[1]||n.$$parentForm).$addControl(n);var q=g?c(n.$name):B;g&&(q(a,n),e.$observe(g,function(b){n.$name!==b&&(q(a,v),n.$$parentForm.$$renameControl(n,b),(q=c(n.$name))(a,n))})),d.on("$destroy",function(){n.$$parentForm.$removeControl(n),q(a,v),T(n,Mb)})}}}}}]},pe=Sd(),Ce=Sd(!0),zg=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,Ig=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+\])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,Jg=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,Kg=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Td=/^(\d{4})-(\d{2})-(\d{2})$/,Ud=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,pc=/^(\d{4})-W(\d\d)$/,Vd=/^(\d{4})-(\d\d)$/,Wd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Xd={text:function(a,b,d,c,e,f){lb(a,b,d,c,e,f),nc(c)},date:mb("date",Td,Ob(Td,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":mb("datetimelocal",Ud,Ob(Ud,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:mb("time",Wd,Ob(Wd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:mb("week",pc,function(a,b){if(V(a))return a;if(F(a)){pc.lastIndex=0;var d=pc.exec(a);if(d){var c=+d[1],e=+d[2],f=d=0,g=0,h=0,k=Id(c),e=7*(e-1);return b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),h=b.getMilliseconds()),new Date(c,0,k.getDate()+e,d,f,g,h)}}return NaN},"yyyy-Www"),month:mb("month",Vd,Ob(Vd,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f){if(Md(a,b,d,c),lb(a,b,d,c,e,f),c.$$parserName="number",c.$parsers.push(function(a){return c.$isEmpty(a)?null:Kg.test(a)?parseFloat(a):v}),c.$formatters.push(function(a){if(!c.$isEmpty(a)){if(!N(a))throw nb("numfmt",a);a=a.toString()}return a}),y(d.min)||d.ngMin){var g;c.$validators.min=function(a){return c.$isEmpty(a)||x(g)||a>=g},d.$observe("min",function(a){y(a)&&!N(a)&&(a=parseFloat(a,10)),g=N(a)&&!isNaN(a)?a:v,c.$validate()})}if(y(d.max)||d.ngMax){var h;c.$validators.max=function(a){return c.$isEmpty(a)||x(h)||a<=h},d.$observe("max",function(a){y(a)&&!N(a)&&(a=parseFloat(a,10)),h=N(a)&&!isNaN(a)?a:v,c.$validate()})}},url:function(a,b,d,c,e,f){lb(a,b,d,c,e,f),nc(c),c.$$parserName="url",c.$validators.url=function(a,b){var d=a||b;return c.$isEmpty(d)||Ig.test(d)}},email:function(a,b,d,c,e,f){lb(a,b,d,c,e,f),nc(c),c.$$parserName="email",c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||Jg.test(d)}},radio:function(a,b,d,c){x(d.name)&&b.attr("name",++pb),b.on("click",function(a){b[0].checked&&c.$setViewValue(d.value,a&&a.type)}),c.$render=function(){b[0].checked=d.value==c.$viewValue},d.$observe("value",c.$render)},checkbox:function(a,b,d,c,e,f,g,h){var k=Nd(h,a,"ngTrueValue",d.ngTrueValue,!0),l=Nd(h,a,"ngFalseValue",d.ngFalseValue,!1);b.on("click",function(a){c.$setViewValue(b[0].checked,a&&a.type)}),c.$render=function(){b[0].checked=c.$viewValue},c.$isEmpty=function(a){return!1===a},c.$formatters.push(function(a){return oa(a,k)}),c.$parsers.push(function(a){return a?k:l})},hidden:B,button:B,submit:B,reset:B,file:B},Fc=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,h){ h[0]&&(Xd[G(g.type)]||Xd.text)(e,f,g,h[0],b,a,d,c)}}}}],Lg=/^(true|false|\d+)$/,Ue=function(){return{restrict:"A",priority:100,compile:function(a,b){return Lg.test(b.ngValue)?function(a,b,e){e.$set("value",a.$eval(e.ngValue))}:function(a,b,e){a.$watch(e.ngValue,function(a){e.$set("value",a)})}}}},ue=["$compile",function(a){return{restrict:"AC",compile:function(b){return a.$$addBindingClass(b),function(b,c,e){a.$$addBindingInfo(c,e.ngBind),c=c[0],b.$watch(e.ngBind,function(a){c.textContent=x(a)?"":a})}}}}],we=["$interpolate","$compile",function(a,b){return{compile:function(d){return b.$$addBindingClass(d),function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate)),b.$$addBindingInfo(d,c.expressions),d=d[0],f.$observe("ngBindTemplate",function(a){d.textContent=x(a)?"":a})}}}}],ve=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=b(e.ngBindHtml,function(a){return(a||"").toString()});return d.$$addBindingClass(c),function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml),b.$watch(g,function(){c.html(a.getTrustedHtml(f(b))||"")})}}}}],Te=ba({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),xe=oc("",!0),ze=oc("Odd",0),ye=oc("Even",1),Ae=Ma({compile:function(a,b){b.$set("ngCloak",v),a.removeClass("ng-cloak")}}),Be=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Kc={},Mg={blur:!0,focus:!0};n("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=va("ng-"+a);Kc[b]=["$parse","$rootScope",function(d,c){return{restrict:"A",compile:function(e,f){var g=d(f[b],null,!0);return function(b,d){d.on(a,function(d){var e=function(){g(b,{$event:d})};Mg[a]&&c.$$phase?b.$evalAsync(e):b.$apply(e)})}}}}]});var Ee=["$animate",function(a){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(b,d,c,e,f){var g,h,k;b.$watch(c.ngIf,function(b){b?h||f(function(b,e){h=e,b[b.length++]=W.createComment(" end ngIf: "+c.ngIf+" "),g={clone:b},a.enter(b,d.parent(),d)}):(k&&(k.remove(),k=null),h&&(h.$destroy(),h=null),g&&(k=tb(g.clone),a.leave(k).then(function(){k=null}),g=null))})}}}],Fe=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:ia.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",h=e.autoscroll;return function(c,e,m,n,s){var v,t,p,q=0,w=function(){t&&(t.remove(),t=null),v&&(v.$destroy(),v=null),p&&(d.leave(p).then(function(){t=null}),t=p,p=null)};c.$watch(f,function(f){var m=function(){!y(h)||h&&!c.$eval(h)||b()},z=++q;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&z===q){var b=c.$new();n.template=a,a=s(b,function(a){w(),d.enter(a,null,e).then(m)}),v=b,p=a,v.$emit("$includeContentLoaded",f),c.$eval(g)}},function(){c.$$destroyed||z!==q||(w(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(w(),n.template=null)})}}}}],We=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){ga.call(d[0]).match(/SVG/)?(d.empty(),a(Nc(e.template,W).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],Ge=Ma({priority:450,compile:function(){return{pre:function(a,b,d){a.$eval(d.ngInit)}}}}),Se=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=b.attr(d.$attr.ngList)||", ",f="false"!==d.ngTrim,g=f?X(e):e;c.$parsers.push(function(a){if(!x(a)){var b=[];return a&&n(a.split(g),function(a){a&&b.push(f?X(a):a)}),b}}),c.$formatters.push(function(a){return L(a)?a.join(e):v}),c.$isEmpty=function(a){return!a||!a.length}}}},ob="ng-valid",Od="ng-invalid",Ya="ng-pristine",Nb="ng-dirty",Qd="ng-pending",nb=H("ngModel"),Ng=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,b,d,c,e,f,g,h,k,l){this.$modelValue=this.$viewValue=Number.NaN,this.$$rawModelValue=v,this.$validators={},this.$asyncValidators={},this.$parsers=[],this.$formatters=[],this.$viewChangeListeners=[],this.$untouched=!0,this.$touched=!1,this.$pristine=!0,this.$dirty=!1,this.$valid=!0,this.$invalid=!1,this.$error={},this.$$success={},this.$pending=v,this.$name=l(d.name||"",!1)(a),this.$$parentForm=Mb;var t,m=e(d.ngModel),r=m.assign,q=m,I=r,K=null,p=this;this.$$setOptions=function(a){if((p.$options=a)&&a.getterSetter){var b=e(d.ngModel+"()"),f=e(d.ngModel+"($$$p)");q=function(a){var c=m(a);return D(c)&&(c=b(a)),c},I=function(a,b){D(m(a))?f(a,{$$$p:p.$modelValue}):r(a,p.$modelValue)}}else if(!m.assign)throw nb("nonassign",d.ngModel,ta(c))},this.$render=B,this.$isEmpty=function(a){return x(a)||""===a||null===a||a!==a},this.$$updateEmptyClasses=function(a){p.$isEmpty(a)?(f.removeClass(c,"ng-not-empty"),f.addClass(c,"ng-empty")):(f.removeClass(c,"ng-empty"),f.addClass(c,"ng-not-empty"))};var w=0;Ld({ctrl:this,$element:c,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]},$animate:f}),this.$setPristine=function(){p.$dirty=!1,p.$pristine=!0,f.removeClass(c,Nb),f.addClass(c,Ya)},this.$setDirty=function(){p.$dirty=!0,p.$pristine=!1,f.removeClass(c,Ya),f.addClass(c,Nb),p.$$parentForm.$setDirty()},this.$setUntouched=function(){p.$touched=!1,p.$untouched=!0,f.setClass(c,"ng-untouched","ng-touched")},this.$setTouched=function(){p.$touched=!0,p.$untouched=!1,f.setClass(c,"ng-touched","ng-untouched")},this.$rollbackViewValue=function(){g.cancel(K),p.$viewValue=p.$$lastCommittedViewValue,p.$render()},this.$validate=function(){if(!N(p.$modelValue)||!isNaN(p.$modelValue)){var a=p.$$rawModelValue,b=p.$valid,c=p.$modelValue,d=p.$options&&p.$options.allowInvalid;p.$$runValidators(a,p.$$lastCommittedViewValue,function(e){d||b===e||(p.$modelValue=e?a:v,p.$modelValue!==c&&p.$$writeModelToScope())})}},this.$$runValidators=function(a,b,c){function f(a,b){h===w&&p.$setValidity(a,b)}function g(a){h===w&&c(a)}w++;var h=w;!function(){var a=p.$$parserName||"parse";return x(t)?(f(a,null),!0):(t||(n(p.$validators,function(a,b){f(b,null)}),n(p.$asyncValidators,function(a,b){f(b,null)})),f(a,t),t)}()?g(!1):function(){var c=!0;return n(p.$validators,function(d,e){var g=d(a,b);c=c&&g,f(e,g)}),!!c||(n(p.$asyncValidators,function(a,b){f(b,null)}),!1)}()?function(){var c=[],d=!0;n(p.$asyncValidators,function(e,g){var h=e(a,b);if(!h||!D(h.then))throw nb("nopromise",h);f(g,v),c.push(h.then(function(){f(g,!0)},function(a){d=!1,f(g,!1)}))}),c.length?k.all(c).then(function(){g(d)},B):g(!0)}():g(!1)},this.$commitViewValue=function(){var a=p.$viewValue;g.cancel(K),(p.$$lastCommittedViewValue!==a||""===a&&p.$$hasNativeValidators)&&(p.$$updateEmptyClasses(a),p.$$lastCommittedViewValue=a,p.$pristine&&this.$setDirty(),this.$$parseAndValidate())},this.$$parseAndValidate=function(){var b=p.$$lastCommittedViewValue;if(t=!x(b)||v)for(var c=0;ce||c.$isEmpty(b)||b.length<=e}}}}},Ic=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=0;d.$observe("minlength",function(a){e=ca(a)||0,c.$validate()}),c.$validators.minlength=function(a,b){return c.$isEmpty(b)||b.length>=e}}}}};O.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):(function(){var a;if(!Cc){var b=rb();(ua=x(b)?O.jQuery:b?O[b]:v)&&ua.fn.on?(C=ua,T(ua.fn,{scope:Ra.scope,isolateScope:Ra.isolateScope,controller:Ra.controller,injector:Ra.injector,inheritedData:Ra.inheritedData}),a=ua.cleanData,ua.cleanData=function(b){for(var c,f,e=0;null!=(f=b[e]);e++)(c=ua._data(f,"events"))&&c.$destroy&&ua(f).triggerHandler("$destroy");a(b)}):C=U,ia.element=C,Cc=!0}}(),function(a){T(a,{bootstrap:Ac,copy:Oa,extend:T,merge:Zd,equals:oa,element:C,forEach:n,injector:fb,noop:B,bind:vc,toJson:eb,fromJson:wc,identity:ab,isUndefined:x,isDefined:y,isString:F,isFunction:D,isObject:E,isNumber:N,isElement:Rb,isArray:L,version:me,isDate:V,lowercase:G,uppercase:ub,callbacks:{counter:0},getTestability:he,$$minErr:H,$$csp:Ea,reloadWithDebugInfo:ge}),(Vb=ke(O))("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:ne}),a.provider("$compile",Ec).directive({a:oe,input:Fc,textarea:Fc,form:pe,script:qe,select:re,style:se,option:te,ngBind:ue,ngBindHtml:ve,ngBindTemplate:we,ngClass:xe,ngClassEven:ye,ngClassOdd:ze,ngCloak:Ae,ngController:Be,ngForm:Ce,ngHide:De,ngIf:Ee,ngInclude:Fe,ngInit:Ge,ngNonBindable:He,ngPluralize:Ie,ngRepeat:Je,ngShow:Ke,ngStyle:Le,ngSwitch:Me,ngSwitchWhen:Ne,ngSwitchDefault:Oe,ngOptions:Pe,ngTransclude:Qe,ngModel:Re,ngList:Se,ngChange:Te,pattern:Gc,ngPattern:Gc,required:Hc,ngRequired:Hc,minlength:Ic,ngMinlength:Ic,maxlength:Jc,ngMaxlength:Jc,ngValue:Ue,ngModelOptions:Ve}).directive({ngInclude:We}).directive(vb).directive(Kc),a.provider({$anchorScroll:Xe,$animate:Ye,$animateCss:Ze,$$animateJs:$e,$$animateQueue:af,$$AnimateRunner:bf,$$animateAsyncRun:cf,$browser:df,$cacheFactory:ef,$controller:ff,$document:gf,$exceptionHandler:hf,$filter:Lc,$$forceReflow:jf,$interpolate:kf,$interval:lf,$http:mf,$httpParamSerializer:nf,$httpParamSerializerJQLike:of,$httpBackend:pf,$xhrFactory:qf,$location:rf,$log:sf,$parse:tf,$rootScope:uf,$q:vf,$$q:wf,$sce:xf,$sceDelegate:yf,$sniffer:zf,$templateCache:Af,$templateRequest:Bf,$$testability:Cf,$timeout:Df,$window:Ef,$$rAF:Ff,$$jqLite:Gf,$$HashMap:Hf,$$cookieReader:If})}])}(ia),ia.module("ngLocale",[],["$provide",function(a){function b(a){a+="";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a",short:"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-¤",negSuf:"",posPre:"¤",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,c){var e=0|a,f=c;return v===f&&(f=Math.min(b(a),3)),Math.pow(10,f),1==e&&0==f?"one":"other"}})}]),C(W).ready(function(){fe(W,Ac)}))}(window,document),!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend(''),function(D,r,Va){"use strict";function ya(a,b,c){if(!a)throw Ka("areq",b||"?",c||"required");return a}function za(a,b){return a||b?a?b?(ba(a)&&(a=a.join(" ")),ba(b)&&(b=b.join(" ")),a+" "+b):a:b:""}function La(a){var b={};return a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from),b}function X(a,b,c){var d="";return a=ba(a)?a:a&&R(a)&&a.length?a.split(/\s+/):[],s(a,function(a,g){a&&0=a&&(a=e,e=0,b.push(t),t=[]),t.push(g.fn),g.children.forEach(function(a){e++,c.push(a)}),a--}return t.length&&b.push(t),b}(c)}var M=[],r=U(a);return function(u,A,v){function z(a){a=a.hasAttribute("ng-animate-ref")?[a]:a.querySelectorAll("[ng-animate-ref]");var b=[];return s(a,function(a){var c=a.getAttribute("ng-animate-ref");c&&c.length&&b.push(a)}),b}function K(a){var b=[],c={};s(a,function(a,f){var d=G(a.element),h=0<=["enter","move"].indexOf(a.event),d=a.structural?z(d):[];if(d.length){var e=h?"to":"from";s(d,function(a){var b=a.getAttribute("ng-animate-ref");c[b]=c[b]||{},c[b][e]={animationID:f,element:I(a)}})}else b.push(a)});var d={},h={};return s(c,function(c,e){var l=c.from,t=c.to;if(l&&t){var g=a[l.animationID],E=a[t.animationID],k=l.animationID.toString();if(!h[k]){var z=h[k]={structural:!0,beforeStart:function(){g.beforeStart(),E.beforeStart()},close:function(){g.close(),E.close()},classes:J(g.classes,E.classes),from:g,to:E,anchors:[]};z.classes.length?b.push(z):(b.push(g),b.push(E))}h[k].anchors.push({out:l.element,in:t.element})}else l=l?l.animationID:t.animationID,t=l.toString(),d[t]||(d[t]=!0,b.push(a[l]))}),b}function J(a,b){a=a.split(" "),b=b.split(" ");for(var c=[],d=0;d=P&&b>=O&&(wa=!0,q())}function L(){function b(){if(!A){if(t(!1),s(m,function(a){l.style[a[0]]=a[1]}),z(a,f),e.addClass(a,ca),p.recalculateTimingStyles){if(ja=l.className+" "+da,ga=r(l,ja),F=v(l,ja,ga),$=F.maxDelay,n=Math.max($,0),0===(O=F.maxDuration))return void q();p.hasTransitions=0B.expectedEndTime)?H.cancel(B.timer):g.push(q)}L&&(k=H(c,k,!1),g[0]={timer:k,expectedEndTime:d},g.push(q),a.data("$$animateCss",g)),ea.length&&a.on(ea.join(" "),E),f.to&&(f.cleanupStyles&&Ga(x,l,Object.keys(f.to)),Ba(a,f))}}function c(){var b=a.data("$$animateCss");if(b){for(var d=1;d=31&&e.keyCode<=90},isNumPadKey:function(e){return 3===e.location&&e.keyCode>=97&&e.keyCode<=105},isNavigationKey:function(e){var t=m.KEY_CODE;return-1!=[t.SPACE,t.ENTER,t.UP_ARROW,t.DOWN_ARROW].indexOf(e.keyCode)},KEY_CODE:{COMMA:188,SEMICOLON:186,ENTER:13,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT_ARROW:37,UP_ARROW:38,RIGHT_ARROW:39,DOWN_ARROW:40,TAB:9,BACKSPACE:8,DELETE:46},CSS:{TRANSITIONEND:"transitionend"+(s?" webkitTransitionEnd":""),ANIMATIONEND:"animationend"+(s?" webkitAnimationEnd":""),TRANSFORM:i("transform"),TRANSFORM_ORIGIN:i("transformOrigin"),TRANSITION:i("transition"),TRANSITION_DURATION:i("transitionDuration"),ANIMATION_PLAY_STATE:i("animationPlayState"),ANIMATION_DURATION:i("animationDuration"),ANIMATION_NAME:i("animationName"),ANIMATION_TIMING:i("animationTimingFunction"),ANIMATION_DIRECTION:i("animationDirection")},MEDIA:{xs:"(max-width: 599px)","gt-xs":"(min-width: 600px)",sm:"(min-width: 600px) and (max-width: 959px)","gt-sm":"(min-width: 960px)",md:"(min-width: 960px) and (max-width: 1279px)","gt-md":"(min-width: 1280px)",lg:"(min-width: 1280px) and (max-width: 1919px)","gt-lg":"(min-width: 1920px)",xl:"(min-width: 1920px)",landscape:"(orientation: landscape)",portrait:"(orientation: portrait)",print:"print"},MEDIA_PRIORITY:["xl","gt-lg","lg","gt-md","md","gt-sm","sm","gt-xs","xs","landscape","portrait","print"]};return m}e.$inject=["$sniffer","$window","$document"],t.module("material.core").factory("$mdConstant",e)}(),function(){function e(e,n){function o(){return[].concat(v)}function i(){return v.length}function r(e){return v.length&&e>-1&&e-1}function h(){return v.length?v[0]:null}function f(){return v.length?v[v.length-1]:null}function g(e,o,i,a){i=i||b;for(var d=u(o);;){if(!r(d))return null;var s=d+(e?-1:1),l=null;if(r(s)?l=v[s]:n&&(l=e?f():h(),s=u(l)),null===l||s===a)return null;if(i(l))return l;t.isUndefined(a)&&(a=s),d=s}}var b=function(){return!0};e&&!t.isArray(e)&&(e=Array.prototype.slice.call(e)),n=!!n;var v=e||[];return{items:o,count:i,inRange:r,contains:p,indexOf:u,itemAt:s,findBy:l,add:c,remove:m,first:h,last:f,next:t.bind(null,g,!1),previous:t.bind(null,g,!0),hasPrevious:d,hasNext:a}}t.module("material.core").config(["$provide",function(t){t.decorator("$mdUtil",["$delegate",function(t){return t.iterator=e,t}])}])}(),function(){function e(e,n,o){function i(e){var n=u[e];t.isUndefined(n)&&(n=u[e]=r(e));var o=h[n];return t.isUndefined(o)&&(o=a(n)),o}function r(t){return e.MEDIA[t]||("("!==t.charAt(0)?"("+t+")":t)}function a(e){var t=p[e];return t||(t=p[e]=o.matchMedia(e)),t.addListener(d),h[t.media]=!!t.matches}function d(e){n.$evalAsync(function(){h[e.media]=!!e.matches})}function s(e){return p[e]}function l(t,n){for(var o=0;o-1}function g(e){return String(e).indexOf("%")>-1}function b(e){return e[0]||e}var v=l.startSymbol(),E=l.endSymbol(),$="{{"===v&&"}}"===E,C=function(e,n,o){var i=!1;if(e&&e.length){var r=u.getComputedStyle(e[0]);i=t.isDefined(r[n])&&(!o||r[n]==o)}return i},M={dom:{},now:e.performance?t.bind(e.performance,e.performance.now):Date.now||function(){return(new Date).getTime()},bidi:function(e,n,i,r){var a=!("rtl"==o[0].dir||"rtl"==o[0].body.dir);if(0==arguments.length)return a?"ltr":"rtl";var d=t.element(e);a&&t.isDefined(i)?d.css(n,h(i)):!a&&t.isDefined(r)&&d.css(n,h(r))},bidiProperty:function(e,n,i,r){var a=!("rtl"==o[0].dir||"rtl"==o[0].body.dir),d=t.element(e);a&&t.isDefined(n)?(d.css(n,h(r)),d.css(i,"")):!a&&t.isDefined(i)&&(d.css(i,h(r)),d.css(n,""))},clientRect:function(e,t,n){var o=b(e);t=b(t||o.offsetParent||document.body);var i=o.getBoundingClientRect(),r=n?t.getBoundingClientRect():{left:0,top:0,width:0,height:0};return{left:i.left-r.left,top:i.top-r.top,width:i.width,height:i.height}},offsetRect:function(e,t){return M.clientRect(e,t,!0)},nodesToArray:function(e){e=e||[];for(var t=[],n=0;ns.clientHeight+1&&(d(s,{position:"fixed",width:"100%",top:-o+"px"}),e.style.overflowY="scroll"),s.clientWidth
'),e.appendChild(o[0])),o.on("wheel",n),o.on("touchmove",n),function(){o.off("wheel"),o.off("touchmove"),o[0].parentNode.removeChild(o[0]),delete M.disableScrollAround._enableScrolling}}(n);return M.disableScrollAround._enableScrolling=function(){--M.disableScrollAround._count||(l(),c(),delete M.disableScrollAround._enableScrolling)}},enableScrolling:function(){var e=this.disableScrollAround._enableScrolling;e&&e()},floatingScrollbars:function(){if(this.floatingScrollbars.cached===n){var e=t.element("
").css({width:"100%","z-index":-1,position:"absolute",height:"35px","overflow-y":"scroll"});e.children().css("height","60px"),o[0].body.appendChild(e[0]),this.floatingScrollbars.cached=e[0].offsetWidth==e[0].childNodes[0].offsetWidth,e.remove()}return this.floatingScrollbars.cached},forceFocus:function(t){var n=t[0]||t;document.addEventListener("click",function i(e){e.target===n&&e.$focus&&(n.focus(),e.stopImmediatePropagation(),e.preventDefault(),n.removeEventListener("click",i))},!0);var o=document.createEvent("MouseEvents");o.initMouseEvent("click",!1,!0,e,{},0,0,0,0,!1,!1,!1,!1,0,null),o.$material=!0,o.$focus=!0,n.dispatchEvent(o)},createBackdrop:function(e,t){return a(M.supplant('',[t]))(e)},supplant:function(e,t,n){return n=n||/\{([^\{\}]*)\}/g,e.replace(n,function(e,n){var o=n.split("."),i=t;try{for(var r in o)o.hasOwnProperty(r)&&(i=i[o[r]])}catch(a){i=e}return"string"==typeof i||"number"==typeof i?i:e})},fakeNgModel:function(){return{$fake:!0,$setTouched:t.noop,$setViewValue:function(e){this.$viewValue=e,this.$render(e),this.$viewChangeListeners.forEach(function(e){e()})},$isEmpty:function(e){return 0===(""+e).length},$parsers:[],$formatters:[],$viewChangeListeners:[],$render:t.noop}},debounce:function(e,t,o,i){var a;return function(){var d=o,s=Array.prototype.slice.call(arguments);r.cancel(a),a=r(function(){a=n,e.apply(d,s)},t||10,i)}},throttle:function(e,t){var n;return function(){var o=this,i=arguments,r=M.now();(!n||r-n>t)&&(e.apply(o,i),n=r)}},time:function(e){var t=M.now();return e(),M.now()-t},valueOnUse:function(e,t,n){var o=null,i=Array.prototype.slice.call(arguments),r=i.length>3?i.slice(3):[];Object.defineProperty(e,t,{get:function(){return null===o&&(o=n.apply(e,r)),o}})},nextUid:function(){return""+i++},disconnectScope:function(e){if(e&&e.$root!==e&&!e.$$destroyed){var t=e.$parent;e.$$disconnected=!0,t.$$childHead===e&&(t.$$childHead=e.$$nextSibling),t.$$childTail===e&&(t.$$childTail=e.$$prevSibling),e.$$prevSibling&&(e.$$prevSibling.$$nextSibling=e.$$nextSibling),e.$$nextSibling&&(e.$$nextSibling.$$prevSibling=e.$$prevSibling),e.$$nextSibling=e.$$prevSibling=null}},reconnectScope:function(e){if(e&&e.$root!==e&&e.$$disconnected){var t=e,n=t.$parent;t.$$disconnected=!1,t.$$prevSibling=n.$$childTail,n.$$childHead?(n.$$childTail.$$nextSibling=t,n.$$childTail=t):n.$$childHead=n.$$childTail=t}},getClosest:function(e,n,o){if(t.isString(n)){var i=n.toUpperCase();n=function(e){return e.nodeName===i}}if(e instanceof t.element&&(e=e[0]),o&&(e=e.parentNode),!e)return null;do{if(n(e))return e}while(e=e.parentNode);return null},elementContains:function(n,o){return(e.Node&&e.Node.prototype&&Node.prototype.contains?t.bind(n,n.contains):t.bind(n,function(e){return n===o||!!(16&this.compareDocumentPosition(e))}))(o)},extractElementByName:function(e,n,o,i){function r(e){return a(e)||(o?d(e):null)}function a(e){if(e)for(var t=0,o=e.length;t");o[0].body.appendChild(n[0]);for(var i=["sticky","-webkit-sticky"],r=0;rt)&&p(n)}function o(){return i(M.now()-s,r,a,1e3)}function i(e,t,n,o){if(e>o)return t+n;var i=(e/=o)*e;return t+n*(i*e*-2+3*i)}var r=e.scrollTop,a=t-r,d=r-1?a(e,t,function(){return l(e)}):r(e,t,n)}function s(e,t){var n=l(e);n.indexOf(i.startSymbol())>-1||n||r(e,t,n)}function l(e){e=e[0]||e;for(var n,o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null,!1),i="";n=o.nextNode();)(function(t){for(;t.parentNode&&(t=t.parentNode)!==e;)if(t.getAttribute&&"true"===t.getAttribute("aria-hidden"))return!0})(n)||(i+=n.textContent);return i.trim()||""}function c(e,t){var i=e.hasChildNodes(),r=!1;if(i)for(var a=e.childNodes,d=0;d").html(o.trim()).contents(),s=i(d);return n={locals:e,element:d,link:function(o){if(e.$scope=o,l){var i=r(l,e,!0,c);h&&t.extend(i.instance,e);var a=i();d.data("$ngControllerController",a),d.children().data("$ngControllerController",a),n.controller=a}return s(o)}}})}}e.$inject=["$q","$templateRequest","$injector","$compile","$controller"],t.module("material.core").service("$mdCompiler",e)}(),function(){function n(){}function o(n,o,i){function r(e){return function(t,n){n.distancethis.options.maxDistance&&this.cancel()},onEnd:function(){this.onCancel()}}).handler("drag",{options:{minDistance:6,horizontal:!0,cancelMultiplier:1.5},onSetup:function(e,t){g&&(this.oldTouchAction=e[0].style[g],e[0].style[g]=!1===t.horizontal?"pan-y":"pan-x")},onCleanup:function(e){this.oldTouchAction&&(e[0].style[g]=this.oldTouchAction)},onStart:function(e){this.state.registeredParent||this.cancel()},onMove:function(e,t){var n,o;g||"touchmove"!==e.type||e.preventDefault(),this.state.dragPointer?this.dispatchDragMove(e):(this.state.options.horizontal?(n=Math.abs(t.distanceX)>this.state.options.minDistance,o=Math.abs(t.distanceY)>this.state.options.minDistance*this.state.options.cancelMultiplier):(n=Math.abs(t.distanceY)>this.state.options.minDistance,o=Math.abs(t.distanceX)>this.state.options.minDistance*this.state.options.cancelMultiplier),n?(this.state.dragPointer=d(e),c(e,this.state.dragPointer),this.dispatchEvent(e,"$md.dragstart",this.state.dragPointer)):o&&this.cancel())},dispatchDragMove:o.throttle(function(e){this.state.isRunning&&(c(e,this.state.dragPointer),this.dispatchEvent(e,"$md.drag",this.state.dragPointer))}),onEnd:function(e,t){this.state.dragPointer&&(c(e,this.state.dragPointer),this.dispatchEvent(e,"$md.dragend",this.state.dragPointer))}}).handler("swipe",{options:{minVelocity:.65,minDistance:10},onEnd:function(e,t){var n;Math.abs(t.velocityX)>this.state.options.minVelocity&&Math.abs(t.distanceX)>this.state.options.minDistance?(n="left"==t.directionX?"$md.swipeleft":"$md.swiperight",this.dispatchEvent(e,n)):Math.abs(t.velocityY)>this.state.options.minVelocity&&Math.abs(t.distanceY)>this.state.options.minDistance&&(n="up"==t.directionY?"$md.swipeup":"$md.swipedown",this.dispatchEvent(e,n))}})}function i(e){this.name=e,this.state={}}function r(){function n(e,n,o){o=o||u;var i=new t.element.Event(n);i.$material=!0,i.pointer=o,i.srcEvent=e,t.extend(i,{clientX:o.x,clientY:o.y,screenX:o.x,screenY:o.y,pageX:o.x,pageY:o.y,ctrlKey:e.ctrlKey,altKey:e.altKey,shiftKey:e.shiftKey,metaKey:e.metaKey}),t.element(o.target).trigger(i)}function o(t,n,o){o=o||u;var i;"click"===n||"mouseup"==n||"mousedown"==n?(i=document.createEvent("MouseEvents"),i.initMouseEvent(n,!0,!0,e,t.detail,o.x,o.y,o.x,o.y,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,t.button,t.relatedTarget||null)):(i=document.createEvent("CustomEvent"),i.initCustomEvent(n,!0,!0,{})),i.$material=!0,i.pointer=o,i.srcEvent=t,o.target.dispatchEvent(i)}var r=void 0!==e.jQuery&&t.element===e.jQuery;return i.prototype={options:{},dispatchEvent:r?n:o,onSetup:t.noop,onCleanup:t.noop,onStart:t.noop,onMove:t.noop,onEnd:t.noop,onCancel:t.noop,start:function(e,n){if(!this.state.isRunning){var o=this.getNearestParent(e.target),i=o&&o.$mdGesture[this.name]||{};this.state={isRunning:!0,options:t.extend({},this.options,i),registeredParent:o},this.onStart(e,n)}},move:function(e,t){this.state.isRunning&&this.onMove(e,t)},end:function(e,t){this.state.isRunning&&(this.onEnd(e,t),this.state.isRunning=!1)},cancel:function(e,t){this.onCancel(e,t),this.state={}},getNearestParent:function(e){for(var t=e;t;){if((t.$mdGesture||{})[this.name])return t;t=t.parentNode}return null},registerElement:function(e,t){function n(){delete e[0].$mdGesture[o.name],e.off("$destroy",n),o.onCleanup(e,t||{})}var o=this;return e[0].$mdGesture=e[0].$mdGesture||{},e[0].$mdGesture[this.name]=t||{},e.on("$destroy",n),o.onSetup(e,t||{}),n}},i}function a(e,n){function o(e){!e.clientX&&!e.clientY||e.$material||e.isIonicTap||l(e)||(e.preventDefault(),e.stopPropagation())}function i(e){0===e.clientX&&0===e.clientY||e.$material||e.isIonicTap||l(e)?(g=null,"label"==e.target.tagName.toLowerCase()&&(g={x:e.x,y:e.y})):(e.preventDefault(),e.stopPropagation(),g=null)}function r(e,t){var o;for(var i in h)(o=h[i])instanceof n&&("start"===e&&o.cancel(),o[e](t,u))}function a(e){if(!u){var t=+Date.now();p&&!s(e,p)&&t-p.endTime<1500||(u=d(e),r("start",e))}}function m(e){u&&s(e,u)&&(c(e,u),r("move",e))}function f(e){u&&s(e,u)&&(c(e,u),u.endTime=+Date.now(),r("end",e),p=u,u=null)}document.contains||(document.contains=function(e){return document.body.contains(e)}),!b&&e.isHijackingClicks&&(document.addEventListener("click",i,!0),document.addEventListener("mouseup",o,!0),document.addEventListener("mousedown",o,!0),document.addEventListener("focus",o,!0),b=!0);t.element(document).on("mousedown touchstart pointerdown",a).on("mousemove touchmove pointermove",m).on("mouseup mouseleave touchend touchcancel pointerup pointercancel",f).on("$$mdGestureReset",function(){p=u=null})}function d(e){var t=m(e),n={startTime:+Date.now(),target:e.target,type:e.type.charAt(0)};return n.startX=n.x=t.pageX,n.startY=n.y=t.pageY,n}function s(e,t){return e&&t&&e.type.charAt(0)===t.type}function l(e){return g&&g.x==e.x&&g.y==e.y}function c(e,t){var n=m(e),o=t.x=n.pageX,i=t.y=n.pageY;t.distanceX=o-t.startX,t.distanceY=i-t.startY,t.distance=Math.sqrt(t.distanceX*t.distanceX+t.distanceY*t.distanceY),t.directionX=t.distanceX>0?"right":t.distanceX<0?"left":"",t.directionY=t.distanceY>0?"down":t.distanceY<0?"up":"",t.duration=+Date.now()-t.startTime,t.velocityX=t.distanceX/t.duration,t.velocityY=t.distanceY/t.duration}function m(e){return e=e.originalEvent||e,e.touches&&e.touches[0]||e.changedTouches&&e.changedTouches[0]||e}o.$inject=["$$MdGestureHandler","$$rAF","$timeout"],a.$inject=["$mdGesture","$$MdGestureHandler"];var u,p,h={},f=!1,g=null,b=!1;t.module("material.core.gestures",[]).provider("$mdGesture",n).factory("$$MdGestureHandler",r).run(a),n.prototype={skipClickHijack:function(){return f=!0},$get:["$$MdGestureHandler","$$rAF","$timeout",function(e,t,n){return new o(e,t,n)}]}}(),function(){function e(){function e(e){function n(e){return s.optionsFactory=e.options,s.methods=(e.methods||[]).concat(a),l}function o(e,t){return d[e]=t,l}function i(t,n){if(n=n||{},n.methods=n.methods||[],n.options=n.options||function(){return{}},/^cancel|hide|show$/.test(t))throw new Error("Preset '"+t+"' in "+e+" is reserved!");if(n.methods.indexOf("_options")>-1)throw new Error("Method '_options' in "+e+" is reserved!");return s.presets[t]={methods:n.methods.concat(a),optionsFactory:n.options,argOption:n.argOption},l}function r(n,o){function i(e){return e=e||{},e._options&&(e=e._options),m.show(t.extend({},c,e))}function r(e){return m.destroy(e)}function a(t,n){var i={};return i[e]=u,o.invoke(t||function(){return n},{},i)}var l,c,m=n(),u={hide:m.hide,cancel:m.cancel,show:i,destroy:r};return l=s.methods||[],c=a(s.optionsFactory,{}),t.forEach(d,function(e,t){u[t]=e}),t.forEach(s.presets,function(e,n){function o(e){this._options=t.extend({},i,e)}var i=a(e.optionsFactory,{}),r=(e.methods||[]).concat(l);if(t.extend(i,{$type:n}),t.forEach(r,function(e){o.prototype[e]=function(t){return this._options[e]=t,this}}),e.argOption){var d="show"+n.charAt(0).toUpperCase()+n.slice(1);u[d]=function(e){var t=u[n](e);return u.show(t)}}u[n]=function(n){return arguments.length&&e.argOption&&!t.isObject(n)&&!t.isArray(n)?(new o)[e.argOption](n):new o(n)}}),u}r.$inject=["$$interimElement","$injector"];var a=["onHide","onShow","onRemove"],d={},s={presets:{}},l={setDefaults:n,addPreset:i,addMethod:o,$get:r};return l.addPreset("build",{methods:["controller","controllerAs","resolve","template","templateUrl","themable","transformTemplate","parent"]}),l}function o(e,o,i,r,a,d,s,l,c,m,u){return function(){function p(e){e=e||{};var t=new b(e||{});return(!e.skipHide&&$.length?v.cancel():o.when(!0)).finally(function(){$.push(t),t.show().catch(function(e){return e})}),t.deferred.promise}function h(e,t){function i(n){return n.remove(e,!1,t||{}).catch(function(e){return e}),n.deferred.promise}if(!$.length)return o.when(e);if(t=t||{},t.closeAll){var r=o.all($.reverse().map(i));return $=[],r}return t.closeTo!==n?o.all($.splice(t.closeTo).map(i)):i($.pop())}function f(e,n){var i=$.pop();return i?(i.remove(e,!0,n||{}).catch(function(e){return e}),i.deferred.promise.catch(t.noop)):o.when(e)}function g(e){var n=e?null:$.shift(),i=t.element(e).length?t.element(e)[0].parentNode:null;if(i){var r=$.filter(function(e){return e.options.element[0]===i});r.length>0&&(n=r[0],$.splice($.indexOf(n),1))}return n?n.remove(E,!1,{$destroy:!0}):o.when(E)}function b(u){function p(){return o(function(e,t){function n(e){y.deferred.reject(e),t(e)}u.onCompiling&&u.onCompiling(u),g(u).then(function(t){T=b(t,u),A=C(T,u,t.controller).then(e,n)},n)})}function h(e,n,i){function r(e){y.deferred.resolve(e)}function a(e){y.deferred.reject(e)}return T?(u=t.extend(u||{},i||{}),u.cancelAutoHide&&u.cancelAutoHide(),u.element.triggerHandler("$mdInterimElementRemove"),!0===u.$destroy?M(u.element,u).then(function(){n&&a(e)||r(e)}):(o.when(A).finally(function(){M(u.element,u).then(function(){n&&a(e)||r(e)},a)}),y.deferred.promise)):o.when(!1)}function g(e){return(e.skipCompile?null:c.compile(e))||o(function(t){t({locals:{},link:function(){return e.element}})})}function b(e,n){t.extend(e.locals,n);var o=e.link(n.scope);return n.element=o,n.parent=E(o,n),n.themable&&m(o),o}function E(n,o){var i=o.parent;if(i=t.isFunction(i)?i(o.scope,n,o):t.isString(i)?t.element(e[0].querySelector(i)):t.element(i),!(i||{}).length){var r;return d[0]&&d[0].querySelector&&(r=d[0].querySelector(":not(svg) > body")),r||(r=d[0]),"#comment"==r.nodeName&&(r=e[0].body),t.element(r)}return i}function $(){var e,o=t.noop;u.hideDelay&&(e=a(v.hide,u.hideDelay),o=function(){a.cancel(e)}),u.cancelAutoHide=function(){o(),u.cancelAutoHide=n}}function C(e,n,i){var r=n.onShowing||t.noop,a=n.onComplete||t.noop;return r(n.scope,e,n,i),o(function(t,r){try{o.when(n.onShow(n.scope,e,n,i)).then(function(){a(n.scope,e,n),$(),t(e)},r)}catch(d){r(d.message)}})}function M(e,n){var o=n.onRemoving||t.noop;return i(function(t,r){try{var a=i.when(n.onRemove(n.scope,e,n)||!0);o(e,a),1==n.$destroy?t(e):a.then(function(){!n.preserveScope&&n.scope&&n.scope.$destroy(),t(e)},r)}catch(d){r(d)}})}var y,T,A=o.when(!0);return u=function(e){return e=e||{},e.template&&(e.template=l.processTemplate(e.template)),t.extend({preserveScope:!1,cancelAutoHide:t.noop,scope:e.scope||r.$new(e.isolateScope),onShow:function(e,t,n){return s.enter(t,n.parent)},onRemove:function(e,t){return t&&s.leave(t)||o.when()}},e)}(u),y={options:u,deferred:o.defer(),show:p,remove:h}}var v,E=!1,$=[];return v={show:p,hide:h,cancel:f,destroy:g,$injector_:u}}}return o.$inject=["$document","$q","$$q","$rootScope","$timeout","$rootElement","$animate","$mdUtil","$mdCompiler","$mdTheming","$injector"],e.$get=o,e}t.module("material.core").provider("$$interimElement",e)}(),function(){!function(){function n(){var e=!!document.querySelector("[md-layouts-disabled]");A.enabled=!e}function o(){return A.enabled=!1,{restrict:"A",priority:"900"}}function i(e){return["$timeout",function(n){return{restrict:"A",priority:-10,compile:function(o){return A.enabled?(o.addClass(e),function(t,o){n(function(){o.removeClass(e)},10,!1)}):t.noop}}}]}function r(e){function n(t,n,o){var i=d(n,e),r=o.$observe(o.$normalize(e),i);i(p(e,o,"")),t.$on("$destroy",function(){r()})}return["$mdUtil","$interpolate","$log",function(o,i,r){return g=o,b=i,v=r,{restrict:"A",compile:function(o,i){var r;return A.enabled&&(l(e,i,o,v),c(e,p(e,i,""),m(o,e,i)),r=n),r||t.noop}}}]}function a(e){function n(t,n){n.addClass(e)}return["$mdUtil","$interpolate","$log",function(o,i,r){return g=o,b=i,v=r,{restrict:"A",compile:function(o,i){var r;return A.enabled&&(c(e,p(e,i,""),m(o,e,i)),n(null,o),r=n),r||t.noop}}}]}function d(e,n){var o;return function(i){var r=c(n,i||"");t.isDefined(r)&&(o&&e.removeClass(o),o=r?n+"-"+r.replace($,"-"):n,e.addClass(o))}}function s(e){var n=e.split("-");return["$log",function(o){return o.warn(e+"has been deprecated. Please use a `"+n[0]+"-gt-` variant."),t.noop}]}function l(e,t,n,o){var i,r,a,d=n[0].nodeName.toLowerCase();switch(e.replace(E,"")){case"flex":"md-button"!=d&&"fieldset"!=d||(r="<"+d+" "+e+">",a="https://github.com/philipwalton/flexbugs#9-some-html-elements-cant-be-flex-containers",i="Markup '{0}' may not work as expected in IE Browsers. Consult '{1}' for details.",o.warn(g.supplant(i,[r,a])))}}function c(e,n,o){var i=n;if(!u(n)){switch(e.replace(E,"")){case"layout":h(n,M)||(n=M[0]);break;case"flex":h(n,C)||isNaN(n)&&(n="");break;case"flex-offset":case"flex-order":n&&!isNaN(+n)||(n="0");break;case"layout-align":var r=f(n);n=g.supplant("{main}-{cross}",r);break;case"layout-padding":case"layout-margin":case"layout-fill":case"layout-wrap":case"layout-nowrap":case"layout-nowrap":n=""}n!=i&&(o||t.noop)(n)}return n}function m(e,t,n){return function(e){u(e)||(n[n.$normalize(t)]=e)}}function u(e){return(e||"").indexOf(b.startSymbol())>-1}function p(e,t,n){var o=t.$normalize(e);return t[o]?t[o].replace($,"-"):n||null}function h(e,t,n){e=n&&e?e.replace($,n):e;var o=!1;return e&&t.forEach(function(t){t=n?t.replace($,n):t,o=o||t===e}),o}function f(e){var t,n={main:"start",cross:"stretch"};return e=e||"",0!==e.indexOf("-")&&0!==e.indexOf(" ")||(e="none"+e),t=e.toLowerCase().trim().replace($,"-").split("-"),t.length&&"space"===t[0]&&(t=[t[0]+"-"+t[1],t[2]]),t.length>0&&(n.main=t[0]||n.main),t.length>1&&(n.cross=t[1]||n.cross),y.indexOf(n.main)<0&&(n.main="start"),T.indexOf(n.cross)<0&&(n.cross="stretch"),n}var g,b,v,E=/(-gt)?-(sm|md|lg|print)/g,$=/\s+/g,C=["grow","initial","auto","none","noshrink","nogrow"],M=["row","column"],y=["","start","center","end","stretch","space-around","space-between"],T=["","start","center","end","stretch"],A={enabled:!0,breakpoints:[]};!function(e){function d(e){return e.replace(m,"").replace(u,function(e,t,n,o){return o?n.toUpperCase():n})}var m=/^((?:x|data)[\:\-_])/i,u=/([\:\-\_]+(.))/g,p=["","xs","gt-xs","sm","gt-sm","md","gt-md","lg","gt-lg","xl","print"],h=["layout","flex","flex-order","flex-offset","layout-align"],f=["show","hide","layout-padding","layout-margin"];t.forEach(p,function(n){t.forEach(h,function(t){var o=n?t+"-"+n:t;e.directive(d(o),r(o))}),t.forEach(f,function(t){var o=n?t+"-"+n:t;e.directive(d(o),a(o))})}),e.provider("$$mdLayout",function(){return{$get:t.noop,validateAttributeValue:c,validateAttributeUsage:l,disableLayouts:function(e){A.enabled=!0!==e}}}).directive("mdLayoutCss",o).directive("ngCloak",i("ng-cloak")).directive("layoutWrap",a("layout-wrap")).directive("layoutNowrap",a("layout-nowrap")).directive("layoutNoWrap",a("layout-no-wrap")).directive("layoutFill",a("layout-fill")).directive("layoutLtMd",s("layout-lt-md")).directive("layoutLtLg",s("layout-lt-lg")).directive("flexLtMd",s("flex-lt-md")).directive("flexLtLg",s("flex-lt-lg")).directive("layoutAlignLtMd",s("layout-align-lt-md")).directive("layoutAlignLtLg",s("layout-align-lt-lg")).directive("flexOrderLtMd",s("flex-order-lt-md")).directive("flexOrderLtLg",s("flex-order-lt-lg")).directive("offsetLtMd",s("flex-offset-lt-md")).directive("offsetLtLg",s("flex-offset-lt-lg")).directive("hideLtMd",s("hide-lt-md")).directive("hideLtLg",s("hide-lt-lg")).directive("showLtMd",s("show-lt-md")).directive("showLtLg",s("show-lt-lg")).config(n)}(t.module("material.core.layout",["ng"]))}()}(),function(){t.module("material.core.meta",[]).provider("$$mdMeta",function(){function e(e){if(r[e])return!0;var n=document.getElementsByName(e)[0];return!!n&&(r[e]=t.element(n),!0)}function n(n,o){if(e(n),r[n])r[n].attr("content",o);else{var a=t.element('');i.append(a),r[n]=a}return function(){r[n].attr("content",""),r[n].remove(),delete r[n]}}function o(t){if(!e(t))throw Error("$$mdMeta: could not find a meta tag with the name '"+t+"'");return r[t].attr("content")}var i=t.element(document.head),r={},a={setMeta:n,getMeta:o};return t.extend({},a,{$get:function(){return a}})})}(),function(){function e(e,o){function i(e){return e&&""!==e}var r,a=[],d={};return r={notFoundError:function(t,n){e.error((n||"")+"No instance found for handle",t)},getInstances:function(){return a},get:function(e){if(!i(e))return null;var t,n,o;for(t=0,n=a.length;t');return this.$element.append(e),e},o.prototype.clearTimeout=function(){this.timeout&&(this.$timeout.cancel(this.timeout),this.timeout=null)},o.prototype.isRippleAllowed=function(){var e=this.$element[0];do{if(!e.tagName||"BODY"===e.tagName)break;if(e&&t.isFunction(e.hasAttribute)){if(e.hasAttribute("disabled"))return!1;if("false"===this.inkRipple()||"0"===this.inkRipple())return!1}}while(e=e.parentNode);return!0},o.prototype.inkRipple=function(){return this.$element.attr("md-ink-ripple")},o.prototype.createRipple=function(e,n){ if(this.isRippleAllowed()){var i=this,r=i.$mdColorUtil,d=t.element('
'),s=this.$element.prop("clientWidth"),l=this.$element.prop("clientHeight"),c=2*Math.max(Math.abs(s-e),e),m=2*Math.max(Math.abs(l-n),n),u=function(e,t,n){return e?Math.max(t,n):Math.sqrt(Math.pow(t,2)+Math.pow(n,2))}(this.options.fitRipple,c,m),p=this.calculateColor();d.css({left:e+"px",top:n+"px",background:"black",width:u+"px",height:u+"px",backgroundColor:r.rgbaToRgb(p),borderColor:r.rgbaToRgb(p)}),this.lastRipple=d,this.clearTimeout(),this.timeout=this.$timeout(function(){i.clearTimeout(),i.mousedown||i.fadeInComplete(d)},157.5,!1),this.options.dimBackground&&this.container.css({backgroundColor:p}),this.container.append(d),this.ripples.push(d),d.addClass("md-ripple-placed"),this.$mdUtil.nextTick(function(){d.addClass("md-ripple-scaled md-ripple-active"),i.$timeout(function(){i.clearRipples()},450,!1)},!1)}},o.prototype.fadeInComplete=function(e){this.lastRipple===e?this.timeout||this.mousedown||this.removeRipple(e):this.removeRipple(e)},o.prototype.removeRipple=function(e){var t=this;this.ripples.indexOf(e)<0||(this.ripples.splice(this.ripples.indexOf(e),1),e.removeClass("md-ripple-active"),e.addClass("md-ripple-remove"),0===this.ripples.length&&this.container.css({backgroundColor:""}),this.$timeout(function(){t.fadeOutComplete(e)},450,!1))},o.prototype.fadeOutComplete=function(e){e.remove(),this.lastRipple=null}}(),function(){!function(){function e(e){function n(n,o,i){return e.attach(n,o,t.extend({center:!1,dimBackground:!0,outline:!1,rippleSize:"full"},i))}return{attach:n}}e.$inject=["$mdInkRipple"],t.module("material.core").factory("$mdTabInkRipple",e)}()}(),function(){t.module("material.core.theming.palette",[]).constant("$mdColorPalette",{red:{50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 300 A100",contrastStrongLightColors:"400 500 600 700 A200 A400 A700"},pink:{50:"#fce4ec",100:"#f8bbd0",200:"#f48fb1",300:"#f06292",400:"#ec407a",500:"#e91e63",600:"#d81b60",700:"#c2185b",800:"#ad1457",900:"#880e4f",A100:"#ff80ab",A200:"#ff4081",A400:"#f50057",A700:"#c51162",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"500 600 A200 A400 A700"},purple:{50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400 A200 A400 A700"},"deep-purple":{50:"#ede7f6",100:"#d1c4e9",200:"#b39ddb",300:"#9575cd",400:"#7e57c2",500:"#673ab7",600:"#5e35b1",700:"#512da8",800:"#4527a0",900:"#311b92",A100:"#b388ff",A200:"#7c4dff",A400:"#651fff",A700:"#6200ea",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400 A200"},indigo:{50:"#e8eaf6",100:"#c5cae9",200:"#9fa8da",300:"#7986cb",400:"#5c6bc0",500:"#3f51b5",600:"#3949ab",700:"#303f9f",800:"#283593",900:"#1a237e",A100:"#8c9eff",A200:"#536dfe",A400:"#3d5afe",A700:"#304ffe",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100",contrastStrongLightColors:"300 400 A200 A400"},blue:{50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 300 400 A100",contrastStrongLightColors:"500 600 700 A200 A400 A700"},"light-blue":{50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea",contrastDefaultColor:"dark",contrastLightColors:"600 700 800 900 A700",contrastStrongLightColors:"600 700 800 A700"},cyan:{50:"#e0f7fa",100:"#b2ebf2",200:"#80deea",300:"#4dd0e1",400:"#26c6da",500:"#00bcd4",600:"#00acc1",700:"#0097a7",800:"#00838f",900:"#006064",A100:"#84ffff",A200:"#18ffff",A400:"#00e5ff",A700:"#00b8d4",contrastDefaultColor:"dark",contrastLightColors:"700 800 900",contrastStrongLightColors:"700 800 900"},teal:{50:"#e0f2f1",100:"#b2dfdb",200:"#80cbc4",300:"#4db6ac",400:"#26a69a",500:"#009688",600:"#00897b",700:"#00796b",800:"#00695c",900:"#004d40",A100:"#a7ffeb",A200:"#64ffda",A400:"#1de9b6",A700:"#00bfa5",contrastDefaultColor:"dark",contrastLightColors:"500 600 700 800 900",contrastStrongLightColors:"500 600 700"},green:{50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853",contrastDefaultColor:"dark",contrastLightColors:"500 600 700 800 900",contrastStrongLightColors:"500 600 700"},"light-green":{50:"#f1f8e9",100:"#dcedc8",200:"#c5e1a5",300:"#aed581",400:"#9ccc65",500:"#8bc34a",600:"#7cb342",700:"#689f38",800:"#558b2f",900:"#33691e",A100:"#ccff90",A200:"#b2ff59",A400:"#76ff03",A700:"#64dd17",contrastDefaultColor:"dark",contrastLightColors:"700 800 900",contrastStrongLightColors:"700 800 900"},lime:{50:"#f9fbe7",100:"#f0f4c3",200:"#e6ee9c",300:"#dce775",400:"#d4e157",500:"#cddc39",600:"#c0ca33",700:"#afb42b",800:"#9e9d24",900:"#827717",A100:"#f4ff81",A200:"#eeff41",A400:"#c6ff00",A700:"#aeea00",contrastDefaultColor:"dark",contrastLightColors:"900",contrastStrongLightColors:"900"},yellow:{50:"#fffde7",100:"#fff9c4",200:"#fff59d",300:"#fff176",400:"#ffee58",500:"#ffeb3b",600:"#fdd835",700:"#fbc02d",800:"#f9a825",900:"#f57f17",A100:"#ffff8d",A200:"#ffff00",A400:"#ffea00",A700:"#ffd600",contrastDefaultColor:"dark"},amber:{50:"#fff8e1",100:"#ffecb3",200:"#ffe082",300:"#ffd54f",400:"#ffca28",500:"#ffc107",600:"#ffb300",700:"#ffa000",800:"#ff8f00",900:"#ff6f00",A100:"#ffe57f",A200:"#ffd740",A400:"#ffc400",A700:"#ffab00",contrastDefaultColor:"dark"},orange:{50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00",contrastDefaultColor:"dark",contrastLightColors:"800 900",contrastStrongLightColors:"800 900"},"deep-orange":{50:"#fbe9e7",100:"#ffccbc",200:"#ffab91",300:"#ff8a65",400:"#ff7043",500:"#ff5722",600:"#f4511e",700:"#e64a19",800:"#d84315",900:"#bf360c",A100:"#ff9e80",A200:"#ff6e40",A400:"#ff3d00",A700:"#dd2c00",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 300 400 A100 A200",contrastStrongLightColors:"500 600 700 800 900 A400 A700"},brown:{50:"#efebe9",100:"#d7ccc8",200:"#bcaaa4",300:"#a1887f",400:"#8d6e63",500:"#795548",600:"#6d4c41",700:"#5d4037",800:"#4e342e",900:"#3e2723",A100:"#d7ccc8",A200:"#bcaaa4",A400:"#8d6e63",A700:"#5d4037",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 A100 A200",contrastStrongLightColors:"300 400"},grey:{50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#ffffff",A200:"#000000",A400:"#303030",A700:"#616161",contrastDefaultColor:"dark",contrastLightColors:"600 700 800 900 A200 A400 A700"},"blue-grey":{50:"#eceff1",100:"#cfd8dc",200:"#b0bec5",300:"#90a4ae",400:"#78909c",500:"#607d8b",600:"#546e7a",700:"#455a64",800:"#37474f",900:"#263238",A100:"#cfd8dc",A200:"#b0bec5",A400:"#78909c",A700:"#455a64",contrastDefaultColor:"light",contrastDarkColors:"50 100 200 300 A100 A200",contrastStrongLightColors:"400 500 700"}})}(),function(){!function(e){function t(e){var t=!!document.querySelector("[md-themes-disabled]");e.disableTheming(t)}function o(t,o){function i(e,t){return t=t||{},p[e]=a(e,t),h}function r(t,n){return a(t,e.extend({},p[t]||{},n))}function a(e,t){var n=w.filter(function(e){return!t[e]});if(n.length)throw new Error("Missing colors %1 in palette %2!".replace("%1",n.join(", ")).replace("%2",e));return t}function s(t,n){if(E[t])return E[t];n=n||"default";var o="string"==typeof n?E[n]:n,i=new c(t);return o&&e.forEach(o.colors,function(t,n){i.colors[n]={name:t.name,hues:e.extend({},t.hues)}}),E[t]=i,i}function c(t){function n(t){if((t=0===arguments.length||!!t)!==o.isDark){o.isDark=t,o.foregroundPalette=o.isDark?g:f,o.foregroundShadow=o.isDark?b:v;var n=o.isDark?A:T,i=o.isDark?T:A;return e.forEach(n,function(e,t){var n=o.colors[t],r=i[t];if(n)for(var a in n.hues)n.hues[a]===r[a]&&(n.hues[a]=e[a])}),o}}var o=this;o.name=t,o.colors={},o.dark=n,n(!1),M.forEach(function(t){var n=(o.isDark?A:T)[t];o[t+"Palette"]=function(i,r){var a=o.colors[t]={name:i,hues:e.extend({},n,r)};return Object.keys(a.hues).forEach(function(e){if(!n[e])throw new Error("Invalid hue name '%1' in theme %2's %3 color %4. Available hue names: %4".replace("%1",e).replace("%2",o.name).replace("%3",i).replace("%4",Object.keys(n).join(", ")))}),Object.keys(a.hues).map(function(e){return a.hues[e]}).forEach(function(e){if(-1==w.indexOf(e))throw new Error("Invalid hue value '%1' in theme %2's %3 color %4. Available hue values: %5".replace("%1",e).replace("%2",o.name).replace("%3",t).replace("%4",i).replace("%5",w.join(", ")))}),o},o[t+"Color"]=function(){var e=Array.prototype.slice.call(arguments);return console.warn("$mdThemingProviderTheme."+t+"Color() has been deprecated. Use $mdThemingProviderTheme."+t+"Palette() instead."),o[t+"Palette"].apply(o,e)}})}function m(t,o){function i(e){return e===n||""===e||a.THEMES[e]!==n}function r(n,r){function a(){return(l=r.controller("mdTheme")||n.data("$mdThemeController"))&&l.$mdTheme||("default"==C?"":C)}function d(e){if(e){i(e)||o.warn("Attempted to use unregistered theme '"+e+"'. Register it with $mdThemingProvider.theme().");var t=n.data("$mdThemeName");t&&n.removeClass("md-"+t+"-theme"),n.addClass("md-"+e+"-theme"),n.data("$mdThemeName",e),l&&n.data("$mdThemeController",l)}}var l=r.controller("mdTheme"),c=n.attr("md-theme-watch"),m=($||e.isDefined(c))&&"false"!=c;d(a()),($&&!function(){var e=r.controller("mdTheme");return!!e&&(n.on("$destroy",e.registerChanges(function(){d(a())})),!0)}()||!$&&m)&&n.on("$destroy",t.$watch(a,d))}var a=function(e,o){o===n&&(o=e,e=n),e===n&&(e=t),a.inherit(o,o)};return a.THEMES=e.extend({},E),a.PALETTES=e.extend({},p),a.inherit=r,a.registered=i,a.defaultTheme=function(){return C},a.generateTheme=function(e){l(E[e],e,k.nonce)},a.setBrowserColor=x,a}m.$inject=["$rootScope","$log"],p={};var h,E={},$=!1,C="default";e.extend(p,t);var y=function(e){var t=o.setMeta("theme-color",e),n=o.setMeta("msapplication-navbutton-color",e);return function(){t(),n()}},x=function(t){t=e.isObject(t)?t:{};var n=t.theme||"default",o=t.hue||"800",i=p[t.palette]||p[E[n].colors[t.palette||"primary"].name],r=e.isObject(i[o])?i[o].hex:i[o];return y(r)};return h={definePalette:i,extendPalette:r,theme:s,configuration:function(){return e.extend({},k,{defaultTheme:C,alwaysWatchTheme:$,registeredStyles:[].concat(k.registeredStyles)})},disableTheming:function(t){k.disableTheming=e.isUndefined(t)||!!t},registerStyles:function(e){k.registeredStyles.push(e)},setNonce:function(e){k.nonce=e},generateThemesOnDemand:function(e){k.generateOnDemand=e},setDefaultTheme:function(e){C=e},alwaysWatchTheme:function(e){$=e},enableBrowserColor:x,$get:m,_LIGHT_DEFAULT_HUES:T,_DARK_DEFAULT_HUES:A,_PALETTES:p,_THEMES:E,_parseRules:d,_rgba:u}}function i(t,n,o){return{priority:100,link:{pre:function(i,r,a){var d=[],s={registerChanges:function(t,n){return n&&(t=e.bind(n,t)),d.push(t),function(){var e=d.indexOf(t);e>-1&&d.splice(e,1)}},$setTheme:function(e){t.registered(e)||o.warn("attempted to use unregistered theme '"+e+"'"),s.$mdTheme=e,d.forEach(function(e){e()})}};r.data("$mdThemeController",s),s.$setTheme(n(a.mdTheme)(i)),a.$observe("mdTheme",s.$setTheme)}}}}function r(){return k.disableTheming=!0,{restrict:"A",priority:"900"}}function a(e){return e}function d(t,n,o){c(t,n),o=o.replace(/THEME_NAME/g,t.name);var i=[],r=t.colors[n],a=new RegExp("\\.md-"+t.name+"-theme","g"),d=new RegExp("('|\")?{{\\s*("+n+")-(color|contrast)-?(\\d\\.?\\d*)?\\s*}}(\"|')?","g"),s=/'?"?\{\{\s*([a-zA-Z]+)-(A?\d+|hue\-[0-3]|shadow|default)-?(\d\.?\d*)?(contrast)?\s*\}\}'?"?/g,l=p[r.name];return o=o.replace(s,function(e,n,o,i,r){return"foreground"===n?"shadow"==o?t.foregroundShadow:t.foregroundPalette[o]||t.foregroundPalette[1]:(0!==o.indexOf("hue")&&"default"!==o||(o=t.colors[n].hues[o]),u((p[t.colors[n].name][o]||"")[r?"contrast":"value"],i))}),e.forEach(r.hues,function(e,n){var r=o.replace(d,function(t,n,o,i,r){return u(l[e]["color"===i?"value":"contrast"],r)});if("default"!==n&&(r=r.replace(a,".md-"+t.name+"-theme.md-"+n)),"default"==t.name){var s=/((?:(?:(?: |>|\.|\w|-|:|\(|\)|\[|\]|"|'|=)+) )?)((?:(?:\w|\.|-)+)?)\.md-default-theme((?: |>|\.|\w|-|:|\(|\)|\[|\]|"|'|=)*)/g;r=r.replace(s,function(e,t,n,o){return e+", "+t+n+o})}i.push(r)}),i}function s(t,n){function o(t,n){var o=t.contrastDefaultColor,i=t.contrastLightColors||[],r=t.contrastStrongLightColors||[],a=t.contrastDarkColors||[];"string"==typeof i&&(i=i.split(" ")),"string"==typeof r&&(r=r.split(" ")),"string"==typeof a&&(a=a.split(" ")),delete t.contrastDefaultColor,delete t.contrastLightColors,delete t.contrastStrongLightColors,delete t.contrastDarkColors,e.forEach(t,function(n,d){if(!e.isObject(n)){var l=m(n);if(!l)throw new Error("Color %1, in palette %2's hue %3, is invalid. Hex or rgb(a) color expected.".replace("%1",n).replace("%2",t.name).replace("%3",d));t[d]={hex:t[d],value:l,contrast:function(){return"light"===o?a.indexOf(d)>-1?E:r.indexOf(d)>-1?C:$:i.indexOf(d)>-1?r.indexOf(d)>-1?C:$:E}()}}})}var i=document.head,r=i?i.firstElementChild:null,a=!k.disableTheming&&t.has("$MD_THEME_CSS")?t.get("$MD_THEME_CSS"):"";if(a+=k.registeredStyles.join(""),r&&0!==a.length){e.forEach(p,o);var d=a.split(/\}(?!(\}|'|"|;))/).filter(function(e){return e&&e.trim().length}).map(function(e){return e.trim()+"}"}),s=new RegExp("md-("+M.join("|")+")","g");M.forEach(function(e){x[e]=""}),d.forEach(function(e){for(var t,n=(e.match(s),0);t=M[n];n++)if(e.indexOf(".md-"+t)>-1)return x[t]+=e;for(n=0;t=M[n];n++)if(e.indexOf(t)>-1)return x[t]+=e;return x[y]+=e}),k.generateOnDemand||e.forEach(n.THEMES,function(e){h[e.name]||"default"!==n.defaultTheme()&&"default"===e.name||l(e,e.name,k.nonce)})}}function l(e,t,n){var o=document.head,i=o?o.firstElementChild:null;h[t]||(M.forEach(function(t){for(var r=d(e,t,x[t]);r.length;){var a=r.shift();if(a){var s=document.createElement("style");s.setAttribute("md-theme-style",""),n&&s.setAttribute("nonce",n),s.appendChild(document.createTextNode(a)),o.insertBefore(s,i)}}}),h[e.name]=!0)}function c(e,t){if(!p[(e.colors[t]||{}).name])throw new Error("You supplied an invalid color palette for theme %1's %2 palette. Available palettes: %3".replace("%1",e.name).replace("%2",t).replace("%3",Object.keys(p).join(", ")))}function m(t){if(e.isArray(t)&&3==t.length)return t;if(/^rgb/.test(t))return t.replace(/(^\s*rgba?\(|\)\s*$)/g,"").split(",").map(function(e,t){return 3==t?parseFloat(e,10):parseInt(e,10)});if("#"==t.charAt(0)&&(t=t.substring(1)),/^([a-fA-F0-9]{3}){1,2}$/g.test(t)){var n=t.length/3,o=t.substr(0,n),i=t.substr(n,n),r=t.substr(2*n);return 1===n&&(o+=o,i+=i,r+=r),[parseInt(o,16),parseInt(i,16),parseInt(r,16)]}}function u(t,n){return t?(4==t.length&&(t=e.copy(t),n?t.pop():n=t.pop()),n&&("number"==typeof n||"string"==typeof n&&n.length)?"rgba("+t.join(",")+","+n+")":"rgb("+t.join(",")+")"):"rgb('0,0,0')"}t.$inject=["$mdThemingProvider"],i.$inject=["$mdTheming","$interpolate","$log"],a.$inject=["$mdTheming"],o.$inject=["$mdColorPalette","$$mdMetaProvider"],s.$inject=["$injector","$mdTheming"],e.module("material.core.theming",["material.core.theming.palette","material.core.meta"]).directive("mdTheme",i).directive("mdThemable",a).directive("mdThemesDisabled",r).provider("$mdTheming",o).config(t).run(s);var p,h={},f={name:"dark",1:"rgba(0,0,0,0.87)",2:"rgba(0,0,0,0.54)",3:"rgba(0,0,0,0.38)",4:"rgba(0,0,0,0.12)"},g={name:"light",1:"rgba(255,255,255,1.0)",2:"rgba(255,255,255,0.7)",3:"rgba(255,255,255,0.5)",4:"rgba(255,255,255,0.12)"},b="1px 1px 0px rgba(0,0,0,0.4), -1px -1px 0px rgba(0,0,0,0.4)",v="",E=m("rgba(0,0,0,0.87)"),$=m("rgba(255,255,255,0.87)"),C=m("rgb(255,255,255)"),M=["primary","accent","warn","background"],y="primary",T={accent:{default:"A200","hue-1":"A100","hue-2":"A400","hue-3":"A700"},background:{default:"50","hue-1":"A100","hue-2":"100","hue-3":"300"}},A={background:{default:"A400","hue-1":"800","hue-2":"900","hue-3":"A200"}};M.forEach(function(e){var t={default:"500","hue-1":"300","hue-2":"800","hue-3":"A100"};T[e]||(T[e]=t),A[e]||(A[e]=t)});var w=["50","100","200","300","400","500","600","700","800","900","A100","A200","A400","A700"],k={disableTheming:!1,generateOnDemand:!1,registeredStyles:[],nonce:null},x={}}(e.angular)}(),function(){function n(n,o,i,r,a){var d;return d={translate3d:function(e,t,n,o){function i(n){return a(e,{to:n||t,addClass:o.transitionOutClass,removeClass:o.transitionInClass}).start()}return a(e,{from:t,to:n,addClass:o.transitionInClass,removeClass:o.transitionOutClass}).start().then(function(){return i})},waitTransitionEnd:function(t,n){var a=3e3;return o(function(o,d){function s(e){e&&e.target!==t[0]||(e&&i.cancel(c),t.off(r.CSS.TRANSITIONEND,s),o())}n=n||{},function(n){return n=n||e.getComputedStyle(t[0]),"0s"==n.transitionDuration||!n.transition&&!n.transitionProperty}(n.cachedTransitionStyles)&&(a=0);var c=i(s,n.timeout||a);t.on(r.CSS.TRANSITIONEND,s)})},calculateTransformValues:function(e,t){var o=t.element,i=t.bounds;if(o||i){var r=o?d.clientRect(o)||function(){var t=e?e.parent():null,n=t?t.parent():null;return n?d.clientRect(n):null}():d.copyRect(i),a=d.copyRect(e[0].getBoundingClientRect()),s=d.centerPointFor(a),l=d.centerPointFor(r);return{centerX:l.x-s.x,centerY:l.y-s.y,scaleX:Math.round(100*Math.min(.5,r.width/a.width))/100,scaleY:Math.round(100*Math.min(.5,r.height/a.height))/100}}return{centerX:0,centerY:0,scaleX:.5,scaleY:.5}},calculateZoomToOrigin:function(e,o){return t.bind(null,n.supplant,"translate3d( {centerX}px, {centerY}px, 0 ) scale( {scaleX}, {scaleY} )")(d.calculateTransformValues(e,o))},calculateSlideToOrigin:function(e,o){return t.bind(null,n.supplant,"translate3d( {centerX}px, {centerY}px, 0 )")(d.calculateTransformValues(e,o))},toCss:function(e){function n(e,n,i){t.forEach(n.split(" "),function(e){o[e]=i})}var o={};return t.forEach(e,function(e,a){if(!t.isUndefined(e))if("left top right bottom width height x y min-width min-height max-width max-height".indexOf(a)>=0)o[a]=e+"px";else switch(a){case"transition":n(a,r.CSS.TRANSITION,e);break;case"transform":n(a,r.CSS.TRANSFORM,e);break;case"transformOrigin":n(a,r.CSS.TRANSFORM_ORIGIN,e);break;case"font-size":o["font-size"]=e}}),o},toTransformCss:function(e,n,o){var i={};return t.forEach(r.CSS.TRANSFORM.split(" "),function(t){i[t]=e}),n&&(o=o||"all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) !important",i.transition=o),i},copyRect:function(e,n){return e?(n=n||{},t.forEach("left top right bottom width height".split(" "),function(t){n[t]=Math.round(e[t])}),n.width=n.width||n.right-n.left,n.height=n.height||n.bottom-n.top,n):null},clientRect:function(e){var n=t.element(e)[0].getBoundingClientRect();return function(e){return e&&e.width>0&&e.height>0}(n)?d.copyRect(n):null},centerPointFor:function(e){return e?{x:Math.round(e.left+e.width/2),y:Math.round(e.top+e.height/2)}:{x:0,y:0}}}}t.module("material.core").factory("$$mdAnimate",["$q","$timeout","$mdConstant","$animateCss",function(e,t,o,i){return function(r){return n(r,e,t,o,i)}}])}(),function(){t.version.minor>=4?t.module("material.core.animate",[]):function(){function e(e){return e.replace(/-[a-z]/g,function(e){return e.charAt(1).toUpperCase()})}var n=t.forEach,o=t.isDefined(document.documentElement.style.WebkitAppearance),i=o?"-webkit-":"",r=(o?"webkitTransitionEnd ":"")+"transitionend",a=(o?"webkitAnimationEnd ":"")+"animationend",d=["$document",function(e){return function(){return e[0].body.clientWidth+1}}],s=["$$rAF",function(e){return function(){var t=!1;return e(function(){t=!0}),function(n){t?n():e(n)}}}],l=["$q","$$rAFMutex",function(e,o){function i(e){this.setHost(e),this._doneCallbacks=[],this._runInAnimationFrame=o(),this._state=0}return i.prototype={setHost:function(e){this.host=e||{}},done:function(e){2===this._state?e():this._doneCallbacks.push(e)},progress:t.noop,getPromise:function(){if(!this.promise){var t=this;this.promise=e(function(e,n){t.done(function(t){!1===t?n():e()})})}return this.promise},then:function(e,t){return this.getPromise().then(e,t)},catch:function(e){return this.getPromise().catch(e)},finally:function(e){return this.getPromise().finally(e)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end(),this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel(),this._resolve(!1)},complete:function(e){var t=this;0===t._state&&(t._state=1,t._runInAnimationFrame(function(){t._resolve(e)}))},_resolve:function(e){2!==this._state&&(n(this._doneCallbacks,function(t){t(e)}),this._doneCallbacks.length=0,this._state=2)}},i.all=function(e,t){function o(n){r=r&&n,++i===e.length&&t(r)}var i=0,r=!0;n(e,function(e){e.done(o)})},i}];t.module("material.core.animate",[]).factory("$$forceReflow",d).factory("$$AnimateRunner",l).factory("$$rAFMutex",s).factory("$animateCss",["$window","$$rAF","$$AnimateRunner","$$forceReflow","$$jqLite","$timeout","$animate",function(t,d,s,l,c,m,u){function p(o,d){var l=[],c=C(o),p=c&&u.enabled(),g=!1,y=!1;p&&(d.transitionStyle&&l.push([i+"transition",d.transitionStyle]),d.keyframeStyle&&l.push([i+"animation",d.keyframeStyle]),d.delay&&l.push([i+"transition-delay",d.delay+"s"]),d.duration&&l.push([i+"transition-duration",d.duration+"s"]),g=d.keyframeStyle||d.to&&(d.duration>0||d.transitionStyle),y=!!d.addClass||!!d.removeClass,M(o,!0));var T=p&&(g||y);E(o,d);var A,w,k=!1;return{close:t.close,start:function(){function t(){if(!k)return k=!0,A&&w&&o.off(A,w),h(o,d),v(o,d),n(l,function(t){c.style[e(t[0])]=""}),u.complete(!0),u}var u=new s;return b(function(){if(M(o,!1),!T)return t();n(l,function(t){var n=t[0],o=t[1];c.style[e(n)]=o}),h(o,d);var s=f(o);if(0===s.duration)return t();var u=[];d.easing&&(s.transitionDuration&&u.push([i+"transition-timing-function",d.easing]),s.animationDuration&&u.push([i+"animation-timing-function",d.easing])),d.delay&&s.animationDelay&&u.push([i+"animation-delay",d.delay+"s"]),d.duration&&s.animationDuration&&u.push([i+"animation-duration",d.duration+"s"]),n(u,function(t){var n=t[0],o=t[1];c.style[e(n)]=o,l.push(t)});var p=s.delay,g=1e3*p,b=s.duration,v=1e3*b,E=Date.now();A=[],s.transitionDuration&&A.push(r),s.animationDuration&&A.push(a),A=A.join(" "),w=function(e){e.stopPropagation();var n=e.originalEvent||e,o=n.timeStamp||Date.now(),i=parseFloat(n.elapsedTime.toFixed(3));Math.max(o-E,0)>=g&&i>=b&&t()},o.on(A,w),$(o,d),m(t,g+1.5*v,!1)}),u}}}function h(e,t){t.addClass&&(c.addClass(e,t.addClass),t.addClass=null),t.removeClass&&(c.removeClass(e,t.removeClass),t.removeClass=null)}function f(e){function n(e){return o?"Webkit"+e.charAt(0).toUpperCase()+e.substr(1):e}var i=C(e),r=t.getComputedStyle(i),a=g(r[n("transitionDuration")]),d=g(r[n("animationDuration")]),s=g(r[n("transitionDelay")]),l=g(r[n("animationDelay")]);return d*=parseInt(r[n("animationIterationCount")],10)||1,{duration:Math.max(d,a),delay:Math.max(l,s),animationDuration:d,transitionDuration:a,animationDelay:l,transitionDelay:s}}function g(e){var t=0,o=(e||"").split(/\s*,\s*/);return n(o,function(e){"s"==e.charAt(e.length-1)&&(e=e.substring(0,e.length-1)),e=parseFloat(e)||0,t=t?Math.max(e,t):e}),t}function b(e){y&&y(),T.push(e),y=d(function(){y=null;for(var e=l(),t=0;t` will affect the bottom-sheet opening animations.",i[0])}l.disableBackdrop||(h=r.createBackdrop(o,"md-bottom-sheet-backdrop md-opaque"),h[0].tabIndex=-1,l.clickOutsideToClose&&h.on("click",function(){r.nextTick(d.cancel,!0)}),a.inherit(h,l.parent),e.enter(h,l.parent,null));var f=new p(i,l.parent);return l.bottomSheet=f,a.inherit(f.element,l.parent),l.disableParentScroll&&(l.restoreScroll=r.disableScrollAround(f.element,l.parent)),e.enter(f.element,l.parent,h).then(function(){var e=r.findFocusTarget(i)||t.element(i[0].querySelector("button")||i[0].querySelector("a")||i[0].querySelector(r.prefixer("ng-click",!0)))||h;l.escapeToClose&&(l.rootElementKeyupCallback=function(e){e.keyCode===n.KEY_CODE.ESCAPE&&r.nextTick(d.cancel,!0)},s.on("keyup",l.rootElementKeyupCallback),e&&e.focus())})}function u(t,n,o){var i=o.bottomSheet;return o.disableBackdrop||e.leave(h),e.leave(i.element).then(function(){o.disableParentScroll&&(o.restoreScroll(),delete o.restoreScroll),i.cleanup()})}function p(e,t){function a(t){e.css(n.CSS.TRANSITION_DURATION,"0ms")}function s(t){var o=t.pointer.distanceY;o<5&&(o=Math.max(-i,o/2)),e.css(n.CSS.TRANSFORM,"translate3d(0,"+(i+o)+"px,0)")}function c(t){if(t.pointer.distanceY>0&&(t.pointer.distanceY>20||Math.abs(t.pointer.velocityY)>o)){var i=e.prop("offsetHeight")-t.pointer.distanceY,a=Math.min(i/t.pointer.velocityY*.75,500);e.css(n.CSS.TRANSITION_DURATION,a+"ms"),r.nextTick(d.cancel,!0)}else e.css(n.CSS.TRANSITION_DURATION,""),e.css(n.CSS.TRANSFORM,"")}var m=l.register(t,"drag",{horizontal:!1});return t.on("$md.dragstart",a).on("$md.drag",s).on("$md.dragend",c),{element:e,cleanup:function(){m(),t.off("$md.dragstart",a),t.off("$md.drag",s),t.off("$md.dragend",c)}}}var h;return{themable:!0,onShow:m,onRemove:u,disableBackdrop:!1,escapeToClose:!0,clickOutsideToClose:!0,disableParentScroll:!0}}n.$inject=["$animate","$mdConstant","$mdUtil","$mdTheming","$mdBottomSheet","$rootElement","$mdGesture","$log"];var o=.5,i=80;return e("$mdBottomSheet").setDefaults({methods:["disableParentScroll","escapeToClose","clickOutsideToClose"],options:n})}e.$inject=["$mdBottomSheet"],n.$inject=["$$interimElementProvider"],t.module("material.components.bottomSheet",["material.core","material.components.backdrop"]).directive("mdBottomSheet",e).provider("$mdBottomSheet",n)}(),function(){function e(e){return{restrict:"E",link:function(t,n){e(n)}}}function n(e,n,o,i){function r(e){return t.isDefined(e.href)||t.isDefined(e.ngHref)||t.isDefined(e.ngLink)||t.isDefined(e.uiSref)}function a(e,t){return r(t)?'':''}function d(a,d,s){n(d),e.attach(a,d),o.expectWithoutText(d,"aria-label"),r(s)&&t.isDefined(s.ngDisabled)&&a.$watch(s.ngDisabled,function(e){d.attr("tabindex",e?-1:0)}),d.on("click",function(e){!0===s.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),d.hasClass("md-no-focus")||(a.mouseActive=!1,d.on("mousedown",function(){a.mouseActive=!0,i(function(){a.mouseActive=!1},100)}).on("focus",function(){!1===a.mouseActive&&d.addClass("md-focused")}).on("blur",function(e){d.removeClass("md-focused")}))}return{restrict:"EA",replace:!0,transclude:!0,template:a,link:d}}n.$inject=["$mdButtonInkRipple","$mdTheming","$mdAria","$timeout"],e.$inject=["$mdTheming"],t.module("material.components.button",["material.core"]).directive("mdButton",n).directive("a",e)}(),function(){function e(e){return{restrict:"E",link:function(t,n,o){n.addClass("_md"),e(n)}}}e.$inject=["$mdTheming"],t.module("material.components.card",["material.core"]).directive("mdCard",e)}(),function(){t.module("material.components.chips",["material.core","material.components.autocomplete"])}(),function(){function e(e,n,o,i,r,a){function d(d,s){function l(d,s,l,c){function u(e){var t=e.which||e.keyCode;t!==o.KEY_CODE.SPACE&&t!==o.KEY_CODE.ENTER||(e.preventDefault(),s.addClass("md-focused"),p(e))}function p(e){s[0].hasAttribute("disabled")||d.skipToggle||d.$apply(function(){var t=l.ngChecked?l.checked:!c.$viewValue;c.$setViewValue(t,e&&e.type),c.$render()})}function h(){s.toggleClass("md-checked",!!c.$viewValue&&!g)}function f(e){g=!1!==e,g&&s.attr("aria-checked","mixed"),s.toggleClass("md-indeterminate",g)}var g;c=c||r.fakeNgModel(),i(s),s.children().on("focus",function(){s.focus()}),r.parseAttributeBoolean(l.mdIndeterminate)&&(f(),d.$watch(l.mdIndeterminate,f)),l.ngChecked&&d.$watch(d.$eval.bind(d,l.ngChecked),function(e){c.$setViewValue(e),c.$render()}),function(e,t,n){l[e]&&d.$watch(l[e],function(e){n[e]&&s.attr(t,n[e])})}("ngDisabled","tabindex",{true:"-1",false:l.tabindex}),n.expectWithText(s,"aria-label"),e.link.pre(d,{on:t.noop,0:{}},l,[c]),d.mouseActive=!1,s.on("click",p).on("keypress",u).on("mousedown",function(){d.mouseActive=!0,a(function(){d.mouseActive=!1},100)}).on("focus",function(){!1===d.mouseActive&&s.addClass("md-focused")}).on("blur",function(){s.removeClass("md-focused")}),c.$render=h}return s.$set("tabindex",s.tabindex||"0"),s.$set("type","checkbox"),s.$set("role",s.type),{pre:function(e,t){t.on("click",function(e){this.hasAttribute("disabled")&&e.stopImmediatePropagation()})},post:l}}return e=e[0],{restrict:"E",transclude:!0,require:"?ngModel",priority:210,template:'
',compile:d}}e.$inject=["inputDirective","$mdAria","$mdConstant","$mdTheming","$mdUtil","$timeout"],t.module("material.components.checkbox",["material.core"]).directive("mdCheckbox",e)}(),function(){!function(){function e(e,n,o){function r(e,t){try{t&&e.css(s(t))}catch(n){o.error(n.message)}}function a(e){return d(c(e))}function d(t,o){o=o||!1;var i=e.PALETTES[t.palette][t.hue];return i=o?i.contrast:i.value,n.supplant("rgba({0}, {1}, {2}, {3})",[i[0],i[1],i[2],i[3]||t.opacity])}function s(e){var n={},o=e.hasOwnProperty("color");return t.forEach(e,function(e,t){var i=c(e),r=t.indexOf("background")>-1;n[t]=d(i),r&&!o&&(n.color=d(i,!0))}),n}function l(n){return t.isDefined(e.THEMES[n.split("-")[0]])}function c(n){var o=n.split("-"),i=t.isDefined(e.THEMES[o[0]]),r=i?o.splice(0,1)[0]:e.defaultTheme();return{theme:r,palette:m(o,r),hue:u(o,r),opacity:o[2]||1}}function m(t,o){var r=t.length>1&&-1!==i.indexOf(t[1]),a=t[0].replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();if(r&&(a=t[0]+"-"+t.splice(1,1)),-1===i.indexOf(a)){ var d=e.THEMES[o].colors[a];if(!d)throw new Error(n.supplant("mdColors: couldn't find '{palette}' in the palettes.",{palette:a}));a=d.name}return a}function u(t,o){var i=e.THEMES[o].colors;if("hue"===t[1]){var r=parseInt(t.splice(2,1)[0],10);if(r<1||r>3)throw new Error(n.supplant("mdColors: 'hue-{hueNumber}' is not a valid hue, can be only 'hue-1', 'hue-2' and 'hue-3'",{hueNumber:r}));if(t[1]="hue-"+r,!(t[0]in i))throw new Error(n.supplant("mdColors: 'hue-x' can only be used with [{availableThemes}], but was used with '{usedTheme}'",{availableThemes:Object.keys(i).join(", "),usedTheme:t[0]}));return i[t[0]].hues[t[1]]}return t[1]||i[t[0]in i?t[0]:"primary"].hues.default}return i=i||Object.keys(e.PALETTES),{applyThemeColors:r,getThemeColor:a,hasTheme:l}}function n(e,n,i,r){return{restrict:"A",require:["^?mdTheme"],compile:function(a,d){var l=function(){var e=d.mdColors,i=e.indexOf("::")>-1,r=!!i||o.test(d.mdColors);d.mdColors=e.replace("::","");var a=t.isDefined(d.mdColorsWatch);return!i&&!r&&(!a||n.parseAttributeBoolean(d.mdColorsWatch))}();return function(n,o,a,d){var s=d[0],c={},m=function(t){"string"!=typeof t&&(t=""),a.mdColors||(a.mdColors="{}");var o=r(a.mdColors)(n);return s&&Object.keys(o).forEach(function(n){var i=o[n];e.hasTheme(i)||(o[n]=(t||s.$mdTheme)+"-"+i)}),u(o),o},u=function(e){if(!t.equals(e,c)){var n=Object.keys(c);c.background&&!n.color&&n.push("color"),n.forEach(function(e){o.css(e,"")})}c=e},p=t.noop;s&&(p=s.registerChanges(function(t){e.applyThemeColors(o,m(t))})),n.$on("$destroy",function(){p()});try{l?n.$watch(m,t.bind(this,e.applyThemeColors,o),!0):e.applyThemeColors(o,m())}catch(h){i.error(h.message)}}}}}n.$inject=["$mdColors","$mdUtil","$log","$parse"],e.$inject=["$mdTheming","$mdUtil","$log"];var o=/^{((\s|,)*?["'a-zA-Z-]+?\s*?:\s*?('|")[a-zA-Z0-9-.]*('|"))+\s*}$/,i=null;t.module("material.components.colors",["material.core"]).directive("mdColors",n).service("$mdColors",e)}()}(),function(){function e(e){function t(e,t){this.$scope=e,this.$element=t}return{restrict:"E",controller:["$scope","$element",t],link:function(t,o){o.addClass("_md"),e(o),t.$broadcast("$mdContentLoaded",o),n(o[0])}}}function n(e){t.element(e).on("$md.pressdown",function(t){"t"===t.pointer.type&&(t.$materialScrollFixed||(t.$materialScrollFixed=!0,0===e.scrollTop?e.scrollTop=1:e.scrollHeight===e.scrollTop+e.offsetHeight&&(e.scrollTop-=1)))})}e.$inject=["$mdTheming"],t.module("material.components.content",["material.core"]).directive("mdContent",e)}(),function(){t.module("material.components.datepicker",["material.core","material.components.icon","material.components.virtualRepeat"])}(),function(){function e(e,n,o){return{restrict:"E",link:function(i,r){r.addClass("_md"),n(r),e(function(){function e(){r.toggleClass("md-content-overflow",a.scrollHeight>a.clientHeight)}var n,a=r[0].querySelector("md-dialog-content");a&&(n=a.getElementsByTagName("img"),e(),t.element(n).on("load",e)),i.$on("$destroy",function(){o.destroy(r)})})}}}function o(e){function o(e,t){return{template:['',' ','

{{ dialog.title }}

','
','
',"

{{::dialog.mdTextContent}}

","
",' ',' '," ","
"," ",' '," {{ dialog.cancel }}"," ",' '," {{ dialog.ok }}"," "," ","
"].join("").replace(/\s\s+/g,""),controller:function(){var n="prompt"==this.$type;n&&this.initialValue&&(this.result=this.initialValue),this.hide=function(){e.hide(!n||this.result)},this.abort=function(){e.cancel()},this.keypress=function(n){n.keyCode===t.KEY_CODE.ENTER&&e.hide(this.result)}},controllerAs:"dialog",bindToController:!0}}function i(e,o,i,d,s,l,c,m,u,p,h){function f(e){E(e),e.contentElement&&(e.restoreContentElement=$(e))}function g(e,t,n,o){if(o){if(o.mdHtmlContent=o.htmlContent||n.htmlContent||"",o.mdTextContent=o.textContent||n.textContent||o.content||n.content||"",o.mdHtmlContent&&!p.has("$sanitize"))throw Error("The ngSanitize module must be loaded in order to use htmlContent.");if(o.mdHtmlContent&&o.mdTextContent)throw Error("md-dialog cannot have both `htmlContent` and `textContent`")}}function b(e,n,o,r){function a(){n[0].querySelector(".md-actions")&&u.warn("Using a class of md-actions is deprecated, please use .")}function d(){if(o.focusOnOpen){(i.findFocusTarget(n)||function(){var e=n[0].querySelector(".dialog-close");if(!e){var t=n[0].querySelectorAll(".md-actions button, md-dialog-actions button");e=t[t.length-1]}return e}()||s).focus()}}t.element(l[0].body).addClass("md-dialog-is-showing");var s=n.find("md-dialog");if(s.hasClass("ng-cloak")){u.warn("$mdDialog: using `` will affect the dialog opening animations.",n[0])}return C(o),T(s,o),y(e,n,o),M(n,o),k(n,o).then(function(){A(n,o),a(),d()})}function v(e,n,o){function d(){t.element(l[0].body).removeClass("md-dialog-is-showing"),o.contentElement?(o.reverseContainerStretch(),o.restoreContentElement()):n.remove(),o.$destroy||o.origin.focus()}return o.deactivateListeners(),o.unlockScreenReader(),o.hideBackdrop(o.$destroy),r&&r.parentNode&&r.parentNode.removeChild(r),a&&a.parentNode&&a.parentNode.removeChild(a),o.$destroy?d():function(){return x(n,o)}().then(d)}function E(e){if(!e.theme&&(e.theme=h.defaultTheme(),e.targetEvent&&e.targetEvent.target)){var n=t.element(e.targetEvent.target);e.theme=(n.controller("mdTheme")||{}).$mdTheme||e.theme}}function $(e){function n(e){var t=e.parentNode,n=e.nextElementSibling;return function(){n?t.insertBefore(e,n):t.appendChild(e)}}var o=e.contentElement,i=null;return t.isString(o)?(o=document.querySelector(o),i=n(o)):(o=o[0]||o,i=document.contains(o)?n(o):function(){o.parentNode.removeChild(o)}),e.element=t.element(o),e.skipCompile=!0,i}function C(e){function o(e,o){var i=t.element(e||{});if(i&&i.length){var r={top:0,left:0,height:0,width:0},a=t.isFunction(i[0].getBoundingClientRect);return t.extend(o||{},{element:a?i:n,bounds:a?i[0].getBoundingClientRect():t.extend({},r,i[0]),focus:t.bind(i,i.focus)})}}function i(e,n){return t.isString(e)&&(e=l[0].querySelector(e)),t.element(e||n)}e.origin=t.extend({element:null,bounds:null,focus:t.noop},e.origin||{}),e.parent=i(e.parent,m),e.closeTo=o(i(e.closeTo)),e.openFrom=o(i(e.openFrom)),e.targetEvent&&(e.origin=o(e.targetEvent.target,e.origin))}function M(n,o){var r=t.element(c),a=i.debounce(function(){w(n,o)},60),s=[],l=function(){var t="alert"==o.$type?e.hide:e.cancel;i.nextTick(t,!0)};if(o.escapeToClose){var m=o.parent,u=function(e){e.keyCode===d.KEY_CODE.ESCAPE&&(e.stopPropagation(),e.preventDefault(),l())};n.on("keydown",u),m.on("keydown",u),s.push(function(){n.off("keydown",u),m.off("keydown",u)})}if(r.on("resize",a),s.push(function(){r.off("resize",a)}),o.clickOutsideToClose){var p,h=n,f=function(e){p=e.target},g=function(e){p===h[0]&&e.target===h[0]&&(e.stopPropagation(),e.preventDefault(),l())};h.on("mousedown",f),h.on("mouseup",g),s.push(function(){h.off("mousedown",f),h.off("mouseup",g)})}o.deactivateListeners=function(){s.forEach(function(e){e()}),o.deactivateListeners=null}}function y(e,t,n){n.disableParentScroll&&(n.restoreScroll=i.disableScrollAround(t,n.parent)),n.hasBackdrop&&(n.backdrop=i.createBackdrop(e,"md-dialog-backdrop md-opaque"),s.enter(n.backdrop,n.parent)),n.hideBackdrop=function(e){n.backdrop&&(e?n.backdrop.remove():s.leave(n.backdrop)),n.disableParentScroll&&(n.restoreScroll(),delete n.restoreScroll),n.hideBackdrop=null}}function T(e,t){var n="alert"===t.$type?"alertdialog":"dialog",d=e.find("md-dialog-content"),s=e.attr("id"),l="dialogContent_"+(s||i.nextUid());e.attr({role:n,tabIndex:"-1"}),0===d.length&&(d=e,s&&(l=s)),d.attr("id",l),e.attr("aria-describedby",l),t.ariaLabel?o.expect(e,"aria-label",t.ariaLabel):o.expectAsync(e,"aria-label",function(){var e=d.text().split(/\s+/);return e.length>3&&(e=e.slice(0,3).concat("...")),e.join(" ")}),r=document.createElement("div"),r.classList.add("md-dialog-focus-trap"),r.tabIndex=0,a=r.cloneNode(!1);var c=function(){e.focus()};r.addEventListener("focus",c),a.addEventListener("focus",c),e[0].parentNode.insertBefore(r,e[0]),e.after(a)}function A(e,t){function n(e){for(;e.parentNode;){if(e===document.body)return;for(var t=e.parentNode.children,i=0;i'+function(e){return t.autoWrap&&!/<\/md-dialog>/g.test(e)?""+(e||"")+"":e||""}(e)+""}}}o.$inject=["$mdDialog","$mdConstant"],i.$inject=["$mdDialog","$mdAria","$mdUtil","$mdConstant","$animate","$document","$window","$rootElement","$log","$injector","$mdTheming"];var r,a;return e("$mdDialog").setDefaults({methods:["disableParentScroll","hasBackdrop","clickOutsideToClose","escapeToClose","targetEvent","closeTo","openFrom","parent","fullscreen","contentElement"],options:i}).addPreset("alert",{methods:["title","htmlContent","textContent","content","ariaLabel","ok","theme","css"],options:o}).addPreset("confirm",{methods:["title","htmlContent","textContent","content","ariaLabel","ok","cancel","theme","css"],options:o}).addPreset("prompt",{methods:["title","htmlContent","textContent","initialValue","content","placeholder","ariaLabel","ok","cancel","theme","css"],options:o})}e.$inject=["$$rAF","$mdTheming","$mdDialog"],o.$inject=["$$interimElementProvider"],t.module("material.components.dialog",["material.core","material.components.backdrop"]).directive("mdDialog",e).provider("$mdDialog",o)}(),function(){function e(e){return{restrict:"E",link:e}}e.$inject=["$mdTheming"],t.module("material.components.divider",["material.core"]).directive("mdDivider",e)}(),function(){!function(){function e(e){return{restrict:"E",require:["^?mdFabSpeedDial","^?mdFabToolbar"],compile:function(t,n){var o=t.children();e.prefixer().hasAttribute(o,"ng-repeat")?o.addClass("md-fab-action-item"):o.wrap('
')}}}e.$inject=["$mdUtil"],t.module("material.components.fabActions",["material.core"]).directive("mdFabActions",e)}()}(),function(){!function(){function e(e,n,o,i,r,a){function l(e){"click"==e.type&&k(e),"focusout"!=e.type||D||(D=a(function(){S.close()},100,!1)),"focusin"==e.type&&D&&(a.cancel(D),D=null)}function c(){S.currentActionIndex=-1}function u(){n[0].scrollHeight>0?o.addClass(n,"_md-animations-ready").then(function(){n.removeClass("md-animations-waiting")}):N<10&&(a(u,100),N+=1)}function p(){n.on("keydown",g),i.nextTick(function(){t.element(document).on("click touchend",f)})}function h(){n.off("keydown",g),t.element(document).off("click touchend",f)}function f(e){if(e.target){var t=i.getClosest(e.target,"md-fab-trigger"),n=i.getClosest(e.target,"md-fab-actions");t||n||S.close()}}function g(e){switch(e.which){case r.KEY_CODE.ESCAPE:return S.close(),e.preventDefault(),!1;case r.KEY_CODE.LEFT_ARROW:return C(e),!1;case r.KEY_CODE.UP_ARROW:return M(e),!1;case r.KEY_CODE.RIGHT_ARROW:return y(e),!1;case r.KEY_CODE.DOWN_ARROW:return T(e),!1}}function b(e){E(e,-1)}function v(e){E(e,1)}function E(e,n){var o=$();S.currentActionIndex=S.currentActionIndex+n,S.currentActionIndex=Math.min(o.length-1,S.currentActionIndex),S.currentActionIndex=Math.max(0,S.currentActionIndex);var i=t.element(o[S.currentActionIndex]).children()[0];t.element(i).attr("tabindex",0),i.focus(),e.preventDefault(),e.stopImmediatePropagation()}function $(){var e=_()[0].querySelectorAll(".md-fab-action-item");return t.forEach(e,function(e){t.element(t.element(e).children()[0]).attr("tabindex",-1)}),e}function C(e){"left"===S.direction?v(e):b(e)}function M(e){"down"===S.direction?b(e):v(e)}function y(e){"left"===S.direction?b(e):v(e)}function T(e){"up"===S.direction?b(e):v(e)}function A(e){return i.getClosest(e,"md-fab-trigger")}function w(e){return i.getClosest(e,"md-fab-actions")}function k(e){A(e.target)&&S.toggle(),w(e.target)&&S.close()}function x(){return n.find("md-fab-trigger")}function _(){return n.find("md-fab-actions")}var S=this;S.open=function(){e.$evalAsync("vm.isOpen = true")},S.close=function(){e.$evalAsync("vm.isOpen = false"),n.find("md-fab-trigger")[0].focus()},S.toggle=function(){e.$evalAsync("vm.isOpen = !vm.isOpen")},function(){S.direction=S.direction||"down",S.isOpen=S.isOpen||!1,c(),n.addClass("md-animations-waiting")}(),function(){var o=["click","focusin","focusout"];t.forEach(o,function(e){n.on(e,l)}),e.$on("$destroy",function(){t.forEach(o,function(e){n.off(e,l)}),h()})}(),function(){e.$watch("vm.direction",function(e,t){o.removeClass(n,"md-"+t),o.addClass(n,"md-"+e),c()});var t,i;e.$watch("vm.isOpen",function(e){c(),t&&i||(t=x(),i=_()),e?p():h();var r=e?"md-is-open":"",a=e?"":"md-is-open";t.attr("aria-haspopup",!0),t.attr("aria-expanded",e),i.attr("aria-hidden",!e),o.setClass(n,r,a)})}();var N=0;u();var D}e.$inject=["$scope","$element","$animate","$mdUtil","$mdConstant","$timeout"],t.module("material.components.fabShared",["material.core"]).controller("MdFabController",e)}()}(),function(){!function(){function n(){function e(e,t){t.prepend('
')}return{restrict:"E",scope:{direction:"@?mdDirection",isOpen:"=?mdOpen"},bindToController:!0,controller:"MdFabController",controllerAs:"vm",link:e}}function o(n){function o(e){n(e,r,!1)}function i(n){if(!n.hasClass("md-animations-waiting")||n.hasClass("_md-animations-ready")){var o=n[0],i=n.controller("mdFabSpeedDial"),r=o.querySelectorAll(".md-fab-action-item"),a=o.querySelector("md-fab-trigger"),d=o.querySelector("._md-css-variables"),s=parseInt(e.getComputedStyle(d).zIndex);t.forEach(r,function(e,t){var n=e.style;n.transform=n.webkitTransform="",n.transitionDelay="",n.opacity=1,n.zIndex=r.length-t+s}),a.style.zIndex=s+r.length+1,i.isOpen||t.forEach(r,function(e,t){var n,o,r=e.style,d=(a.clientHeight-e.clientHeight)/2,s=(a.clientWidth-e.clientWidth)/2;switch(i.direction){case"up":n=e.scrollHeight*(t+1)+d,o="Y";break;case"down":n=-(e.scrollHeight*(t+1)+d),o="Y";break;case"left":n=e.scrollWidth*(t+1)+s,o="X";break;case"right":n=-(e.scrollWidth*(t+1)+s),o="X"}var l="translate"+o+"("+n+"px)";r.transform=r.webkitTransform=l})}}return{addClass:function(e,t,n){e.hasClass("md-fling")?(i(e),o(n)):n()},removeClass:function(e,t,n){i(e),o(n)}}}function i(n){function o(e){n(e,r,!1)}function i(n){var o=n[0],i=n.controller("mdFabSpeedDial"),r=o.querySelectorAll(".md-fab-action-item"),d=o.querySelector("._md-css-variables"),s=parseInt(e.getComputedStyle(d).zIndex);t.forEach(r,function(e,t){var n=e.style,o=t*a;n.opacity=i.isOpen?1:0,n.transform=n.webkitTransform=i.isOpen?"scale(1)":"scale(0)",n.transitionDelay=(i.isOpen?o:r.length-o)+"ms",n.zIndex=r.length-t+s})}var a=65;return{addClass:function(e,t,n){i(e),o(n)},removeClass:function(e,t,n){i(e),o(n)}}}o.$inject=["$timeout"],i.$inject=["$timeout"];var r=300;t.module("material.components.fabSpeedDial",["material.core","material.components.fabShared","material.components.fabActions"]).directive("mdFabSpeedDial",n).animation(".md-fling",o).animation(".md-scale",i).service("mdFabSpeedDialFlingAnimation",o).service("mdFabSpeedDialScaleAnimation",i)}()}(),function(){!function(){function n(){function e(e,t,n){t.addClass("md-fab-toolbar"),t.find("md-fab-trigger").find("button").prepend('
')}return{restrict:"E",transclude:!0,template:'
',scope:{direction:"@?mdDirection",isOpen:"=?mdOpen"},bindToController:!0,controller:"MdFabController",controllerAs:"vm",link:e}}function o(){function n(n,o,i){if(o){var r=n[0],a=n.controller("mdFabToolbar"),d=r.querySelector(".md-fab-toolbar-background"),s=r.querySelector("md-fab-trigger button"),l=r.querySelector("md-toolbar"),c=r.querySelector("md-fab-trigger button md-icon"),m=n.find("md-fab-actions").children();if(s&&d){var u=e.getComputedStyle(s).getPropertyValue("background-color"),p=r.offsetWidth,h=(r.offsetHeight,p/s.offsetWidth*2);d.style.backgroundColor=u,d.style.borderRadius=p+"px",a.isOpen?(l.style.pointerEvents="inherit",d.style.width=s.offsetWidth+"px",d.style.height=s.offsetHeight+"px",d.style.transform="scale("+h+")",d.style.transitionDelay="0ms",c&&(c.style.transitionDelay=".3s"),t.forEach(m,function(e,t){e.style.transitionDelay=25*(m.length-t)+"ms"})):(l.style.pointerEvents="none",d.style.transform="scale(1)",d.style.top="0",n.hasClass("md-right")&&(d.style.left="0",d.style.right=null),n.hasClass("md-left")&&(d.style.right="0",d.style.left=null),d.style.transitionDelay="200ms",c&&(c.style.transitionDelay="0ms"),t.forEach(m,function(e,t){e.style.transitionDelay=200+25*t+"ms"}))}}}return{addClass:function(e,t,o){n(e,t,o),o()},removeClass:function(e,t,o){n(e,t,o),o()}}}t.module("material.components.fabToolbar",["material.core","material.components.fabShared","material.components.fabActions"]).directive("mdFabToolbar",n).animation(".md-fab-toolbar",o).service("mdFabToolbarAnimation",o)}()}(),function(){function e(e,o,i,r){function a(n,a,d,s){function c(){s.layoutDelegate=t.noop,T();for(var e in o.MEDIA)r.getQuery(o.MEDIA[e]).removeListener(y)}function m(e){null==e?s.invalidateLayout():r(e)&&s.invalidateLayout()}function u(e){var o=g(),r={tileSpans:b(o),colCount:v(),rowMode:C(),rowHeight:$(),gutter:E()};if(e||!t.equals(r,A)){var d=i(r.colCount,r.tileSpans,o).map(function(e,n){return{grid:{element:a,style:f(r.colCount,n,r.gutter,r.rowMode,r.rowHeight)},tiles:e.map(function(e,i){return{element:t.element(o[i]),style:h(e.position,e.spans,r.colCount,n,r.gutter,r.rowMode,r.rowHeight)}})}}).reflow().performance();n.mdOnLayout({$event:{performance:d}}),A=r}}function p(e){return w+e+k}function h(e,t,n,o,i,r,a){var d=1/n*100,s=(n-1)/n,l=x({share:d,gutterShare:s,gutter:i}),c={left:_({unit:l,offset:e.col,gutter:i}),width:S({unit:l,span:t.col,gutter:i}),paddingTop:"",marginTop:"",top:"",height:""};switch(r){case"fixed":c.top=_({unit:a,offset:e.row,gutter:i}),c.height=S({unit:a,span:t.row,gutter:i});break;case"ratio":var m=d/a,u=x({share:m,gutterShare:s,gutter:i});c.paddingTop=S({unit:u,span:t.row,gutter:i}),c.marginTop=_({unit:u,offset:e.row,gutter:i});break;case"fit":var p=(o-1)/o,m=1/o*100,u=x({share:m,gutterShare:p,gutter:i});c.top=_({unit:u,offset:e.row,gutter:i}),c.height=S({unit:u,span:t.row,gutter:i})}return c}function f(e,t,n,o,i){var r={};switch(o){case"fixed":r.height=S({unit:i,span:t,gutter:n}),r.paddingBottom="";break;case"ratio":var a=1===e?0:(e-1)/e,d=1/e*100,s=d*(1/i),l=x({share:s,gutterShare:a,gutter:n});r.height="",r.paddingBottom=S({unit:l,span:t,gutter:n})}return r}function g(){return[].filter.call(a.children(),function(e){return"MD-GRID-TILE"==e.tagName&&!e.$$mdDestroyed})}function b(e){return[].map.call(e,function(e){var n=t.element(e).controller("mdGridTile");return{row:parseInt(r.getResponsiveAttribute(n.$attrs,"md-rowspan"),10)||1,col:parseInt(r.getResponsiveAttribute(n.$attrs,"md-colspan"),10)||1}})}function v(){var e=parseInt(r.getResponsiveAttribute(d,"md-cols"),10);if(isNaN(e))throw"md-grid-list: md-cols attribute was not found, or contained a non-numeric value";return e}function E(){return M(r.getResponsiveAttribute(d,"md-gutter")||1)}function $(){var e=r.getResponsiveAttribute(d,"md-row-height");if(!e)throw"md-grid-list: md-row-height attribute was not found";switch(C()){case"fixed":return M(e);case"ratio":var t=e.split(":");return parseFloat(t[0])/parseFloat(t[1]);case"fit":return 0}}function C(){var e=r.getResponsiveAttribute(d,"md-row-height");if(!e)throw"md-grid-list: md-row-height attribute was not found";return"fit"==e?"fit":-1!==e.indexOf(":")?"ratio":"fixed"}function M(e){return/\D$/.test(e)?e:e+"px"}a.addClass("_md"),a.attr("role","list"),s.layoutDelegate=u;var y=t.bind(s,s.invalidateLayout),T=function(){for(var e in o.MEDIA)r(e),r.getQuery(o.MEDIA[e]).addListener(y);return r.watchResponsiveAttributes(["md-cols","md-row-height","md-gutter"],d,m)}();n.$on("$destroy",c);var A,w=e.startSymbol(),k=e.endSymbol(),x=e(p("share")+"% - ("+p("gutter")+" * "+p("gutterShare")+")"),_=e("calc(("+p("unit")+" + "+p("gutter")+") * "+p("offset")+")"),S=e("calc(("+p("unit")+") * "+p("span")+" + ("+p("span")+" - 1) * "+p("gutter")+")")}return{restrict:"E",controller:n,scope:{mdOnLayout:"&"},link:a}}function n(e){this.layoutInvalidated=!1,this.tilesInvalidated=!1,this.$timeout_=e.nextTick,this.layoutDelegate=t.noop}function o(e){function n(t,n){var o,a,d,s,l,c;return s=e.time(function(){a=i(t,n)}),o={layoutInfo:function(){return a},map:function(t){return l=e.time(function(){var e=o.layoutInfo();d=t(e.positioning,e.rowCount)}),o},reflow:function(t){return c=e.time(function(){(t||r)(d.grid,d.tiles)}),o},performance:function(){return{tileCount:n.length,layoutTime:s,mapTime:l,reflowTime:c,totalTime:s+l+c}}}}function o(e,t){e.element.css(e.style),t.forEach(function(e){e.element.css(e.style)})}function i(e,t){function n(t,n){if(t.col>e)throw"md-grid-list: Tile at position "+n+" has a colspan ("+t.col+") that exceeds the column count ("+e+")";for(var a=0,c=0;c-a=e?o():(a=l.indexOf(0,d),-1!==a&&-1!==(c=r(a+1))?d=c+1:(a=c=0,o()));return i(a,t.col,t.row),d=a+t.col,{col:a,row:s}}function o(){d=0,s++,i(0,e,-1)}function i(e,t,n){for(var o=e;o",transclude:!0,scope:{},controller:["$attrs",function(e){this.$attrs=e}],link:n}}function r(){return{template:"
",transclude:!0}}n.$inject=["$mdUtil"],o.$inject=["$mdUtil"],e.$inject=["$interpolate","$mdConstant","$mdGridLayout","$mdMedia"],i.$inject=["$mdMedia"],t.module("material.components.gridList",["material.core"]).directive("mdGridList",e).directive("mdGridTile",i).directive("mdGridTileFooter",r).directive("mdGridTileHeader",r).factory("$mdGridLayout",o),n.prototype={invalidateTiles:function(){this.tilesInvalidated=!0,this.invalidateLayout()},invalidateLayout:function(){this.layoutInvalidated||(this.layoutInvalidated=!0,this.$timeout_(t.bind(this,this.layout)))},layout:function(){try{this.layoutDelegate(this.tilesInvalidated)}finally{this.layoutInvalidated=!1,this.tilesInvalidated=!1}}}}(),function(){t.module("material.components.icon",["material.core"])}(),function(){function n(e,t){function n(t){var n=t[0].querySelector(r),o=t[0].querySelector(a);return n&&t.addClass("md-icon-left"),o&&t.addClass("md-icon-right"),function(t,n){e(n)}}function o(e,n,o,i){var r=this;r.isErrorGetter=o.mdIsError&&t(o.mdIsError),r.delegateClick=function(){r.input.focus()},r.element=n,r.setFocused=function(e){n.toggleClass("md-input-focused",!!e)},r.setHasValue=function(e){n.toggleClass("md-input-has-value",!!e)},r.setHasPlaceholder=function(e){n.toggleClass("md-input-has-placeholder",!!e)},r.setInvalid=function(e){e?i.addClass(n,"md-input-invalid"):i.removeClass(n,"md-input-invalid")},e.$watch(function(){return r.label&&r.input},function(e){e&&!r.label.attr("for")&&r.label.attr("for",r.input.attr("id"))})}o.$inject=["$scope","$element","$attrs","$animate"];var i=["INPUT","TEXTAREA","SELECT","MD-SELECT"],r=i.reduce(function(e,t){return e.concat(["md-icon ~ "+t,".md-icon ~ "+t])},[]).join(","),a=i.reduce(function(e,t){return e.concat([t+" ~ md-icon",t+" ~ .md-icon"])},[]).join(",");return{restrict:"E",compile:n,controller:o}}function o(){return{restrict:"E",require:"^?mdInputContainer",link:function(e,t,n,o){!o||n.mdNoFloat||t.hasClass("md-container-ignore")||(o.label=t,e.$on("$destroy",function(){o.label=null}))}}}function i(e,n,o,i,r){function a(a,d,s,l){function c(e){return h.setHasValue(!g.$isEmpty(e)),e}function u(){h.setHasValue(d.val().length>0||(d[0].validity||{}).badInput)}var h=l[0],f=!!l[1],g=l[1]||e.fakeNgModel(),b=l[2],v=t.isDefined(s.readonly),E=e.parseAttributeBoolean(s.mdNoAsterisk),$=d[0].tagName.toLowerCase();if(h){if("hidden"===s.type)return void d.attr("aria-hidden","true");if(h.input){if(h.input[0].contains(d[0]))return;throw new Error(" can only have *one* ,
This field is required
'),t.put("app/directives/header-item/header-item.html",''),t.put("app/directives/header-item/header-view.html","
")}]),function(t,e,i){var n=t.L,o={},tileCount=0;o.version="0.7.1","object"==typeof module&&"object"==typeof module.exports?module.exports=o:"function"==typeof define&&define.amd&&define(o),o.noConflict=function(){return t.L=n,this},t.L=o,o.Util={extend:function(t){var e,i,n,o,s=Array.prototype.slice.call(arguments,1);for(i=0,n=s.length;n>i;i++){o=s[i]||{};for(e in o)o.hasOwnProperty(e)&&(t[e]=o[e])}return t},bind:function(t,e){var i=arguments.length>2?Array.prototype.slice.call(arguments,2):null;return function(){return t.apply(e,i||arguments)}},stamp:function(){var t=0,e="_leaflet_id";return function(i){return i[e]=i[e]||++t,i[e]}}(),invokeEach:function(t,e,i){var n,o;if("object"==typeof t){o=Array.prototype.slice.call(arguments,3);for(n in t)e.apply(i,[n,t[n]].concat(o));return!0}return!1},limitExecByInterval:function(t,e,i){var n,o;return function s(){var a=arguments;return n?void(o=!0):(n=!0,setTimeout(function(){n=!1,o&&(s.apply(i,a),o=!1)},e),void t.apply(i,a))}},falseFn:function(){return!1},formatNum:function(t,e){var i=Math.pow(10,e||5);return Math.round(t*i)/i},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},splitWords:function(t){return o.Util.trim(t).split(/\s+/)},setOptions:function(t,e){return t.options=o.extend({},t.options,e),t.options},getParamString:function(t,e,i){var n=[];for(var o in t)n.push(encodeURIComponent(i?o.toUpperCase():o)+"="+encodeURIComponent(t[o]));return(e&&-1!==e.indexOf("?")?"&":"?")+n.join("&")},template:function(t,e){return t.replace(/\{ *([\w_]+) *\}/g,function(t,n){var o=e[n];if(o===i)throw new Error("No value provided for variable "+t);return"function"==typeof o&&(o=o(e)),o})},isArray:Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},emptyImageUrl:"data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="},function(){function e(e){var i,n,o=["webkit","moz","o","ms"];for(i=0;it;t++)n._initHooks[t].call(this)}},e},o.Class.include=function(t){o.extend(this.prototype,t)},o.Class.mergeOptions=function(t){o.extend(this.prototype.options,t)},o.Class.addInitHook=function(t){var e=Array.prototype.slice.call(arguments,1),i="function"==typeof t?t:function(){this[t].apply(this,e)};this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(i)};var s="_leaflet_events";o.Mixin={},o.Mixin.Events={addEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d=this[s]=this[s]||{},p=i&&i!==this&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)r={action:e,context:i||this},h=t[n],p?(l=h+"_idx",u=l+"_len",c=d[l]=d[l]||{},c[p]||(c[p]=[],d[u]=(d[u]||0)+1),c[p].push(r)):(d[h]=d[h]||[],d[h].push(r));return this},hasEventListeners:function(t){var e=this[s];return!!e&&(t in e&&e[t].length>0||t+"_idx"in e&&e[t+"_idx_len"]>0)},removeEventListener:function(t,e,i){if(!this[s])return this;if(!t)return this.clearAllEventListeners();if(o.Util.invokeEach(t,this.removeEventListener,this,e,i))return this;var n,a,r,h,l,u,c,d,p,_=this[s],m=i&&i!==this&&o.stamp(i);for(t=o.Util.splitWords(t),n=0,a=t.length;a>n;n++)if(r=t[n],u=r+"_idx",c=u+"_len",d=_[u],e){if(h=m&&d?d[m]:_[r]){for(l=h.length-1;l>=0;l--)h[l].action!==e||i&&h[l].context!==i||(p=h.splice(l,1),p[0].action=o.Util.falseFn);i&&d&&0===h.length&&(delete d[m],_[c]--)}}else delete _[r],delete _[u],delete _[c];return this},clearAllEventListeners:function(){return delete this[s],this},fireEvent:function(t,e){if(!this.hasEventListeners(t))return this;var i,n,a,r,h,l=o.Util.extend({},e,{type:t,target:this}),u=this[s];if(u[t])for(i=u[t].slice(),n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context,l);r=u[t+"_idx"];for(h in r)if(i=r[h].slice())for(n=0,a=i.length;a>n;n++)i[n].action.call(i[n].context,l);return this},addOneTimeEventListener:function(t,e,i){if(o.Util.invokeEach(t,this.addOneTimeEventListener,this,e,i))return this;var n=o.bind(function(){this.removeEventListener(t,e,i).removeEventListener(t,n,i)},this);return this.addEventListener(t,e,i).addEventListener(t,n,i)}},o.Mixin.Events.on=o.Mixin.Events.addEventListener,o.Mixin.Events.off=o.Mixin.Events.removeEventListener,o.Mixin.Events.once=o.Mixin.Events.addOneTimeEventListener,o.Mixin.Events.fire=o.Mixin.Events.fireEvent,function(){var n="ActiveXObject"in t,s=n&&!e.addEventListener,a=navigator.userAgent.toLowerCase(),r=-1!==a.indexOf("webkit"),h=-1!==a.indexOf("chrome"),l=-1!==a.indexOf("phantom"),u=-1!==a.indexOf("android"),c=-1!==a.search("android [23]"),d=-1!==a.indexOf("gecko"),p=typeof orientation!=i+"",_=t.navigator&&t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints&&!t.PointerEvent,m=t.PointerEvent&&t.navigator.pointerEnabled&&t.navigator.maxTouchPoints||_,f="devicePixelRatio"in t&&t.devicePixelRatio>1||"matchMedia"in t&&t.matchMedia("(min-resolution:144dpi)")&&t.matchMedia("(min-resolution:144dpi)").matches,g=e.documentElement,v=n&&"transition"in g.style,y="WebKitCSSMatrix"in t&&"m11"in new t.WebKitCSSMatrix&&!c,P="MozPerspective"in g.style,L="OTransition"in g.style,x=!t.L_DISABLE_3D&&(v||y||P||L)&&!l,w=!t.L_NO_TOUCH&&!l&&function(){var t="ontouchstart";if(m||t in g)return!0;var i=e.createElement("div"),n=!1;return!!i.setAttribute&&(i.setAttribute(t,"return;"),"function"==typeof i[t]&&(n=!0),i.removeAttribute(t),i=null,n)}();o.Browser={ie:n,ielt9:s,webkit:r,gecko:d&&!r&&!t.opera&&!n,android:u,android23:c,chrome:h,ie3d:v,webkit3d:y,gecko3d:P,opera3d:L,any3d:x,mobile:p,mobileWebkit:p&&r,mobileWebkit3d:p&&y,mobileOpera:p&&t.opera,touch:w,msPointer:_,pointer:m,retina:f}}(),o.Point=function(t,e,i){this.x=i?Math.round(t):t,this.y=i?Math.round(e):e},o.Point.prototype={clone:function(){return new o.Point(this.x,this.y)},add:function(t){return this.clone()._add(o.point(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(o.point(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},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},distanceTo:function(t){t=o.point(t);var e=t.x-this.x,i=t.y-this.y;return Math.sqrt(e*e+i*i)},equals:function(t){return t=o.point(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=o.point(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+o.Util.formatNum(this.x)+", "+o.Util.formatNum(this.y)+")"}},o.point=function(t,e,n){return t instanceof o.Point?t:o.Util.isArray(t)?new o.Point(t[0],t[1]):t===i||null===t?t:new o.Point(t,e,n)},o.Bounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.Bounds.prototype={extend:function(t){return t=o.point(t),this.min||this.max?(this.min.x=Math.min(t.x,this.min.x),this.max.x=Math.max(t.x,this.max.x),this.min.y=Math.min(t.y,this.min.y),this.max.y=Math.max(t.y,this.max.y)):(this.min=t.clone(),this.max=t.clone()),this},getCenter:function(t){return new o.Point((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return new o.Point(this.min.x,this.max.y)},getTopRight:function(){return new o.Point(this.max.x,this.min.y)},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var e,i;return t="number"==typeof t[0]||t instanceof o.Point?o.point(t):o.bounds(t),t instanceof o.Bounds?(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=o.bounds(t);var e=this.min,i=this.max,n=t.min,s=t.max,a=s.x>=e.x&&n.x<=i.x,r=s.y>=e.y&&n.y<=i.y;return a&&r},isValid:function(){return!(!this.min||!this.max)}},o.bounds=function(t,e){return!t||t instanceof o.Bounds?t:new o.Bounds(t,e)},o.Transformation=function(t,e,i,n){this._a=t,this._b=e,this._c=i,this._d=n},o.Transformation.prototype={transform:function(t,e){return this._transform(t.clone(),e)},_transform:function(t,e){return e=e||1,t.x=e*(this._a*t.x+this._b),t.y=e*(this._c*t.y+this._d),t},untransform:function(t,e){return e=e||1,new o.Point((t.x/e-this._b)/this._a,(t.y/e-this._d)/this._c)}},o.DomUtil={get:function(t){return"string"==typeof t?e.getElementById(t):t},getStyle:function(t,i){var n=t.style[i];if(!n&&t.currentStyle&&(n=t.currentStyle[i]),(!n||"auto"===n)&&e.defaultView){var o=e.defaultView.getComputedStyle(t,null);n=o?o[i]:null}return"auto"===n?null:n},getViewportOffset:function(t){var i,n=0,s=0,a=t,r=e.body,h=e.documentElement;do{if(n+=a.offsetTop||0,s+=a.offsetLeft||0,n+=parseInt(o.DomUtil.getStyle(a,"borderTopWidth"),10)||0,s+=parseInt(o.DomUtil.getStyle(a,"borderLeftWidth"),10)||0,i=o.DomUtil.getStyle(a,"position"),a.offsetParent===r&&"absolute"===i)break;if("fixed"===i){n+=r.scrollTop||h.scrollTop||0,s+=r.scrollLeft||h.scrollLeft||0;break}if("relative"===i&&!a.offsetLeft){var l=o.DomUtil.getStyle(a,"width"),u=o.DomUtil.getStyle(a,"max-width"),c=a.getBoundingClientRect();("none"!==l||"none"!==u)&&(s+=c.left+a.clientLeft),n+=c.top+(r.scrollTop||h.scrollTop||0);break}a=a.offsetParent}while(a);a=t;do{if(a===r)break;n-=a.scrollTop||0,s-=a.scrollLeft||0,a=a.parentNode}while(a);return new o.Point(s,n)},documentIsLtr:function(){return o.DomUtil._docIsLtrCached||(o.DomUtil._docIsLtrCached=!0,o.DomUtil._docIsLtr="ltr"===o.DomUtil.getStyle(e.body,"direction")),o.DomUtil._docIsLtr},create:function(t,i,n){var o=e.createElement(t);return o.className=i,n&&n.appendChild(o),o},hasClass:function(t,e){if(t.classList!==i)return t.classList.contains(e);var n=o.DomUtil._getClass(t);return n.length>0&&new RegExp("(^|\\s)"+e+"(\\s|$)").test(n)},addClass:function(t,e){if(t.classList!==i)for(var n=o.Util.splitWords(e),s=0,a=n.length;a>s;s++)t.classList.add(n[s]);else if(!o.DomUtil.hasClass(t,e)){var r=o.DomUtil._getClass(t);o.DomUtil._setClass(t,(r?r+" ":"")+e)}},removeClass:function(t,e){t.classList!==i?t.classList.remove(e):o.DomUtil._setClass(t,o.Util.trim((" "+o.DomUtil._getClass(t)+" ").replace(" "+e+" "," ")))},_setClass:function(t,e){t.className.baseVal===i?t.className=e:t.className.baseVal=e},_getClass:function(t){return t.className.baseVal===i?t.className:t.className.baseVal},setOpacity:function(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(o){if(1===e)return}e=Math.round(100*e),i?(i.Enabled=100!==e,i.Opacity=e):t.style.filter+=" progid:"+n+"(opacity="+e+")"}},testProp:function(t){for(var i=e.documentElement.style,n=0;ni||i===e?e:t),new o.LatLng(this.lat,i)}},o.latLng=function(t,e){return t instanceof o.LatLng?t:o.Util.isArray(t)?"number"==typeof t[0]||"string"==typeof t[0]?new o.LatLng(t[0],t[1],t[2]):null:t===i||null===t?t:"object"==typeof t&&"lat"in t?new o.LatLng(t.lat,"lng"in t?t.lng:t.lon):e===i?null:new o.LatLng(t,e)},o.LatLngBounds=function(t,e){if(t)for(var i=e?[t,e]:t,n=0,o=i.length;o>n;n++)this.extend(i[n])},o.LatLngBounds.prototype={extend:function(t){if(!t)return this;var e=o.latLng(t);return t=null!==e?e:o.latLngBounds(t),t instanceof o.LatLng?this._southWest||this._northEast?(this._southWest.lat=Math.min(t.lat,this._southWest.lat),this._southWest.lng=Math.min(t.lng,this._southWest.lng),this._northEast.lat=Math.max(t.lat,this._northEast.lat),this._northEast.lng=Math.max(t.lng,this._northEast.lng)):(this._southWest=new o.LatLng(t.lat,t.lng),this._northEast=new o.LatLng(t.lat,t.lng)):t instanceof o.LatLngBounds&&(this.extend(t._southWest),this.extend(t._northEast)),this},pad:function(t){var e=this._southWest,i=this._northEast,n=Math.abs(e.lat-i.lat)*t,s=Math.abs(e.lng-i.lng)*t;return new o.LatLngBounds(new o.LatLng(e.lat-n,e.lng-s),new o.LatLng(i.lat+n,i.lng+s))},getCenter:function(){return new o.LatLng((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 o.LatLng(this.getNorth(),this.getWest())},getSouthEast:function(){return new o.LatLng(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 o.LatLng?o.latLng(t):o.latLngBounds(t);var e,i,n=this._southWest,s=this._northEast;return t instanceof o.LatLngBounds?(e=t.getSouthWest(),i=t.getNorthEast()):e=i=t,e.lat>=n.lat&&i.lat<=s.lat&&e.lng>=n.lng&&i.lng<=s.lng},intersects:function(t){t=o.latLngBounds(t);var e=this._southWest,i=this._northEast,n=t.getSouthWest(),s=t.getNorthEast(),a=s.lat>=e.lat&&n.lat<=i.lat,r=s.lng>=e.lng&&n.lng<=i.lng;return a&&r},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t){return!!t&&(t=o.latLngBounds(t),this._southWest.equals(t.getSouthWest())&&this._northEast.equals(t.getNorthEast()))},isValid:function(){return!(!this._southWest||!this._northEast)}},o.latLngBounds=function(t,e){return!t||t instanceof o.LatLngBounds?t:new o.LatLngBounds(t,e)},o.Projection={},o.Projection.SphericalMercator={MAX_LATITUDE:85.0511287798,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=t.lng*e,a=n*e;return a=Math.log(Math.tan(Math.PI/4+a/2)),new o.Point(s,a)},unproject:function(t){var e=o.LatLng.RAD_TO_DEG,i=t.x*e,n=(2*Math.atan(Math.exp(t.y))-Math.PI/2)*e;return new o.LatLng(n,i)}},o.Projection.LonLat={project:function(t){return new o.Point(t.lng,t.lat)},unproject:function(t){return new o.LatLng(t.y,t.x)}},o.CRS={latLngToPoint:function(t,e){var i=this.projection.project(t),n=this.scale(e);return this.transformation._transform(i,n)},pointToLatLng:function(t,e){var i=this.scale(e),n=this.transformation.untransform(t,i);return this.projection.unproject(n)},project:function(t){return this.projection.project(t)},scale:function(t){return 256*Math.pow(2,t)},getSize:function(t){var e=this.scale(t) ;return o.point(e,e)}},o.CRS.Simple=o.extend({},o.CRS,{projection:o.Projection.LonLat,transformation:new o.Transformation(1,0,-1,0),scale:function(t){return Math.pow(2,t)}}),o.CRS.EPSG3857=o.extend({},o.CRS,{code:"EPSG:3857",projection:o.Projection.SphericalMercator,transformation:new o.Transformation(.5/Math.PI,.5,-.5/Math.PI,.5),project:function(t){return this.projection.project(t).multiplyBy(6378137)}}),o.CRS.EPSG900913=o.extend({},o.CRS.EPSG3857,{code:"EPSG:900913"}),o.CRS.EPSG4326=o.extend({},o.CRS,{code:"EPSG:4326",projection:o.Projection.LonLat,transformation:new o.Transformation(1/360,.5,-1/360,.5)}),o.Map=o.Class.extend({includes:o.Mixin.Events,options:{crs:o.CRS.EPSG3857,fadeAnimation:o.DomUtil.TRANSITION&&!o.Browser.android23,trackResize:!0,markerZoomAnimation:o.DomUtil.TRANSITION&&o.Browser.any3d},initialize:function(t,e){e=o.setOptions(this,e),this._initContainer(t),this._initLayout(),this._onResize=o.bind(this._onResize,this),this._initEvents(),e.maxBounds&&this.setMaxBounds(e.maxBounds),e.center&&e.zoom!==i&&this.setView(o.latLng(e.center),e.zoom,{reset:!0}),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._tileLayersNum=0,this.callInitHooks(),this._addLayers(e.layers)},setView:function(t,e){return e=e===i?this.getZoom():e,this._resetView(o.latLng(t),this._limitZoom(e)),this},setZoom:function(t,e){return this._loaded?this.setView(this.getCenter(),t,{zoom:e}):(this._zoom=this._limitZoom(t),this)},zoomIn:function(t,e){return this.setZoom(this._zoom+(t||1),e)},zoomOut:function(t,e){return this.setZoom(this._zoom-(t||1),e)},setZoomAround:function(t,e,i){var n=this.getZoomScale(e),s=this.getSize().divideBy(2),a=t instanceof o.Point?t:this.latLngToContainerPoint(t),r=a.subtract(s).multiplyBy(1-1/n),h=this.containerPointToLatLng(s.add(r));return this.setView(h,e,{zoom:i})},fitBounds:function(t,e){e=e||{},t=t.getBounds?t.getBounds():o.latLngBounds(t);var i=o.point(e.paddingTopLeft||e.padding||[0,0]),n=o.point(e.paddingBottomRight||e.padding||[0,0]),s=this.getBoundsZoom(t,!1,i.add(n)),a=n.subtract(i).divideBy(2),r=this.project(t.getSouthWest(),s),h=this.project(t.getNorthEast(),s),l=this.unproject(r.add(h).divideBy(2).add(a),s);return s=e&&e.maxZoom?Math.min(e.maxZoom,s):s,this.setView(l,s,e)},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){return this.fire("movestart"),this._rawPanBy(o.point(t)),this.fire("move"),this.fire("moveend")},setMaxBounds:function(t){return t=o.latLngBounds(t),this.options.maxBounds=t,t?(this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds,this)):this.off("moveend",this._panInsideMaxBounds,this)},panInsideBounds:function(t,e){var i=this.getCenter(),n=this._limitCenter(i,this._zoom,t);return i.equals(n)?this:this.panTo(n,e)},addLayer:function(t){var e=o.stamp(t);return this._layers[e]?this:(this._layers[e]=t,!t.options||isNaN(t.options.maxZoom)&&isNaN(t.options.minZoom)||(this._zoomBoundLayers[e]=t,this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum++,this._tileLayersToLoad++,t.on("load",this._onTileLayerLoad,this)),this._loaded&&this._layerAdd(t),this)},removeLayer:function(t){var e=o.stamp(t);return this._layers[e]?(this._loaded&&t.onRemove(this),delete this._layers[e],this._loaded&&this.fire("layerremove",{layer:t}),this._zoomBoundLayers[e]&&(delete this._zoomBoundLayers[e],this._updateZoomLevels()),this.options.zoomAnimation&&o.TileLayer&&t instanceof o.TileLayer&&(this._tileLayersNum--,this._tileLayersToLoad--,t.off("load",this._onTileLayerLoad,this)),this):this},hasLayer:function(t){return!!t&&o.stamp(t)in this._layers},eachLayer:function(t,e){for(var i in this._layers)t.call(e,this._layers[i]);return this},invalidateSize:function(t){if(!this._loaded)return this;t=o.extend({animate:!1,pan:!0},!0===t?{animate:!0}:t);var e=this.getSize();this._sizeChanged=!0,this._initialCenter=null;var i=this.getSize(),n=e.divideBy(2).round(),s=i.divideBy(2).round(),a=n.subtract(s);return a.x||a.y?(t.animate&&t.pan?this.panBy(a):(t.pan&&this._rawPanBy(a),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(o.bind(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:e,newSize:i})):this},addHandler:function(t,e){if(!e)return this;var i=this[t]=new e(this);return this._handlers.push(i),this.options[t]&&i.enable(),this},remove:function(){this._loaded&&this.fire("unload"),this._initEvents("off");try{delete this._container._leaflet}catch(t){this._container._leaflet=i}return this._clearPanes(),this._clearControlPos&&this._clearControlPos(),this._clearHandlers(),this},getCenter:function(){return this._checkIfLoaded(),this._initialCenter&&!this._moved()?this._initialCenter:this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),e=this.unproject(t.getBottomLeft()),i=this.unproject(t.getTopRight());return new o.LatLngBounds(e,i)},getMinZoom:function(){return this.options.minZoom===i?this._layersMinZoom===i?0:this._layersMinZoom:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===i?this._layersMaxZoom===i?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,e,i){t=o.latLngBounds(t);var n,s=this.getMinZoom()-(e?1:0),a=this.getMaxZoom(),r=this.getSize(),h=t.getNorthWest(),l=t.getSouthEast(),u=!0;i=o.point(i||[0,0]);do{s++,n=this.project(l,s).subtract(this.project(h,s)).add(i),u=e?n.x=s);return u&&e?null:e?s:s-1},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new o.Point(this._container.clientWidth,this._container.clientHeight),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(){var t=this._getTopLeftPoint();return new o.Bounds(t,t.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._initialTopLeftPoint},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t){var e=this.options.crs;return e.scale(t)/e.scale(this._zoom)},getScaleZoom:function(t){return this._zoom+Math.log(t)/Math.LN2},project:function(t,e){return e=e===i?this._zoom:e,this.options.crs.latLngToPoint(o.latLng(t),e)},unproject:function(t,e){return e=e===i?this._zoom:e,this.options.crs.pointToLatLng(o.point(t),e)},layerPointToLatLng:function(t){var e=o.point(t).add(this.getPixelOrigin());return this.unproject(e)},latLngToLayerPoint:function(t){return this.project(o.latLng(t))._round()._subtract(this.getPixelOrigin())},containerPointToLayerPoint:function(t){return o.point(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return o.point(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var e=this.containerPointToLayerPoint(o.point(t));return this.layerPointToLatLng(e)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(o.latLng(t)))},mouseEventToContainerPoint:function(t){return o.DomEvent.getMousePosition(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var e=this._container=o.DomUtil.get(t);if(!e)throw new Error("Map container not found.");if(e._leaflet)throw new Error("Map container is already initialized.");e._leaflet=!0},_initLayout:function(){var t=this._container;o.DomUtil.addClass(t,"leaflet-container"+(o.Browser.touch?" leaflet-touch":"")+(o.Browser.retina?" leaflet-retina":"")+(o.Browser.ielt9?" leaflet-oldie":"")+(this.options.fadeAnimation?" leaflet-fade-anim":""));var e=o.DomUtil.getStyle(t,"position");"absolute"!==e&&"relative"!==e&&"fixed"!==e&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._mapPane=t.mapPane=this._createPane("leaflet-map-pane",this._container),this._tilePane=t.tilePane=this._createPane("leaflet-tile-pane",this._mapPane),t.objectsPane=this._createPane("leaflet-objects-pane",this._mapPane),t.shadowPane=this._createPane("leaflet-shadow-pane"),t.overlayPane=this._createPane("leaflet-overlay-pane"),t.markerPane=this._createPane("leaflet-marker-pane"),t.popupPane=this._createPane("leaflet-popup-pane");var e=" leaflet-zoom-hide";this.options.markerZoomAnimation||(o.DomUtil.addClass(t.markerPane,e),o.DomUtil.addClass(t.shadowPane,e),o.DomUtil.addClass(t.popupPane,e))},_createPane:function(t,e){return o.DomUtil.create("div",t,e||this._panes.objectsPane)},_clearPanes:function(){this._container.removeChild(this._mapPane)},_addLayers:function(t){t=t?o.Util.isArray(t)?t:[t]:[];for(var e=0,i=t.length;i>e;e++)this.addLayer(t[e])},_resetView:function(t,e,i,n){var s=this._zoom!==e;n||(this.fire("movestart"),s&&this.fire("zoomstart")),this._zoom=e,this._initialCenter=t,this._initialTopLeftPoint=this._getNewTopLeftPoint(t),i?this._initialTopLeftPoint._add(this._getMapPanePos()):o.DomUtil.setPosition(this._mapPane,new o.Point(0,0)),this._tileLayersToLoad=this._tileLayersNum;var a=!this._loaded;this._loaded=!0,a&&(this.fire("load"),this.eachLayer(this._layerAdd,this)),this.fire("viewreset",{hard:!i}),this.fire("move"),(s||n)&&this.fire("zoomend"),this.fire("moveend",{hard:!i})},_rawPanBy:function(t){o.DomUtil.setPosition(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_updateZoomLevels:function(){var t,e=1/0,n=-1/0,o=this._getZoomSpan();for(t in this._zoomBoundLayers){var s=this._zoomBoundLayers[t];isNaN(s.options.minZoom)||(e=Math.min(e,s.options.minZoom)),isNaN(s.options.maxZoom)||(n=Math.max(n,s.options.maxZoom))}t===i?this._layersMaxZoom=this._layersMinZoom=i:(this._layersMaxZoom=n,this._layersMinZoom=e),o!==this._getZoomSpan()&&this.fire("zoomlevelschange")},_panInsideMaxBounds:function(){this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(e){if(o.DomEvent){e=e||"on",o.DomEvent[e](this._container,"click",this._onMouseClick,this);var i,n,s=["dblclick","mousedown","mouseup","mouseenter","mouseleave","mousemove","contextmenu"];for(i=0,n=s.length;n>i;i++)o.DomEvent[e](this._container,s[i],this._fireMouseEvent,this);this.options.trackResize&&o.DomEvent[e](t,"resize",this._onResize,this)}},_onResize:function(){o.Util.cancelAnimFrame(this._resizeRequest),this._resizeRequest=o.Util.requestAnimFrame(function(){this.invalidateSize({debounceMoveend:!0})},this,!1,this._container)},_onMouseClick:function(t){!this._loaded||!t._simulated&&(this.dragging&&this.dragging.moved()||this.boxZoom&&this.boxZoom.moved())||o.DomEvent._skipped(t)||(this.fire("preclick"),this._fireMouseEvent(t))},_fireMouseEvent:function(t){if(this._loaded&&!o.DomEvent._skipped(t)){var e=t.type;if(e="mouseenter"===e?"mouseover":"mouseleave"===e?"mouseout":e,this.hasEventListeners(e)){"contextmenu"===e&&o.DomEvent.preventDefault(t);var i=this.mouseEventToContainerPoint(t),n=this.containerPointToLayerPoint(i),s=this.layerPointToLatLng(n);this.fire(e,{latlng:s,layerPoint:n,containerPoint:i,originalEvent:t})}}},_onTileLayerLoad:function(){this._tileLayersToLoad--,this._tileLayersNum&&!this._tileLayersToLoad&&this.fire("tilelayersload")},_clearHandlers:function(){for(var t=0,e=this._handlers.length;e>t;t++)this._handlers[t].disable()},whenReady:function(t,e){return this._loaded?t.call(e||this,this):this.on("load",t,e),this},_layerAdd:function(t){t.onAdd(this),this.fire("layeradd",{layer:t})},_getMapPanePos:function(){return o.DomUtil.getPosition(this._mapPane)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(){return this.getPixelOrigin().subtract(this._getMapPanePos())},_getNewTopLeftPoint:function(t,e){var i=this.getSize()._divideBy(2);return this.project(t,e)._subtract(i)._round()},_latLngToNewLayerPoint:function(t,e,i){var n=this._getNewTopLeftPoint(i,e).add(this._getMapPanePos());return this.project(t,e)._subtract(n)},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,e,i){if(!i)return t;var n=this.project(t,e),s=this.getSize().divideBy(2),a=new o.Bounds(n.subtract(s),n.add(s)),r=this._getBoundsOffset(a,i,e);return this.unproject(n.add(r),e)},_limitOffset:function(t,e){if(!e)return t;var i=this.getPixelBounds(),n=new o.Bounds(i.min.add(t),i.max.add(t));return t.add(this._getBoundsOffset(n,e))},_getBoundsOffset:function(t,e,i){var n=this.project(e.getNorthWest(),i).subtract(t.min),s=this.project(e.getSouthEast(),i).subtract(t.max),a=this._rebound(n.x,-s.x),r=this._rebound(n.y,-s.y);return new o.Point(a,r)},_rebound:function(t,e){return t+e>0?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();return Math.max(e,Math.min(i,t))}}),o.map=function(t,e){return new o.Map(t,e)},o.Projection.Mercator={MAX_LATITUDE:85.0840591556,R_MINOR:6356752.314245179,R_MAJOR:6378137,project:function(t){var e=o.LatLng.DEG_TO_RAD,i=this.MAX_LATITUDE,n=Math.max(Math.min(i,t.lat),-i),s=this.R_MAJOR,a=this.R_MINOR,r=t.lng*e*s,h=n*e,l=a/s,u=Math.sqrt(1-l*l),c=u*Math.sin(h);c=Math.pow((1-c)/(1+c),.5*u);var d=Math.tan(.5*(.5*Math.PI-h))/c;return h=-s*Math.log(d),new o.Point(r,h)},unproject:function(t){for(var e,i=o.LatLng.RAD_TO_DEG,n=this.R_MAJOR,s=this.R_MINOR,a=t.x*i/n,r=s/n,h=Math.sqrt(1-r*r),l=Math.exp(-t.y/n),u=Math.PI/2-2*Math.atan(l),p=15,_=.1;Math.abs(_)>1e-7&&--p>0;)e=h*Math.sin(u),_=Math.PI/2-2*Math.atan(l*Math.pow((1-e)/(1+e),.5*h))-u,u+=_;return new o.LatLng(u*i,a)}},o.CRS.EPSG3395=o.extend({},o.CRS,{code:"EPSG:3395",projection:o.Projection.Mercator,transformation:function(){var t=o.Projection.Mercator,e=t.R_MAJOR,i=.5/(Math.PI*e);return new o.Transformation(i,.5,-i,.5)}()}),o.TileLayer=o.Class.extend({includes:o.Mixin.Events,options:{minZoom:0,maxZoom:18,tileSize:256,subdomains:"abc",errorTileUrl:"",attribution:"",zoomOffset:0,opacity:1,unloadInvisibleTiles:o.Browser.mobile,updateWhenIdle:o.Browser.mobile},initialize:function(t,e){e=o.setOptions(this,e),e.detectRetina&&o.Browser.retina&&e.maxZoom>0&&(e.tileSize=Math.floor(e.tileSize/2),e.zoomOffset++,e.minZoom>0&&e.minZoom--,this.options.maxZoom--),e.bounds&&(e.bounds=o.latLngBounds(e.bounds)),this._url=t;var i=this.options.subdomains;"string"==typeof i&&(this.options.subdomains=i.split(""))},onAdd:function(t){this._map=t,this._animated=t._zoomAnimated,this._initContainer(),t.on({viewreset:this._reset,moveend:this._update},this),this._animated&&t.on({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||(this._limitedUpdate=o.Util.limitExecByInterval(this._update,150,this),t.on("move",this._limitedUpdate,this)),this._reset(),this._update()},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this._container.parentNode.removeChild(this._container),t.off({viewreset:this._reset,moveend:this._update},this),this._animated&&t.off({zoomanim:this._animateZoom,zoomend:this._endZoomAnim},this),this.options.updateWhenIdle||t.off("move",this._limitedUpdate,this),this._container=null,this._map=null},bringToFront:function(){var t=this._map._panes.tilePane;return this._container&&(t.appendChild(this._container),this._setAutoZIndex(t,Math.max)),this},bringToBack:function(){var t=this._map._panes.tilePane;return this._container&&(t.insertBefore(this._container,t.firstChild),this._setAutoZIndex(t,Math.min)),this},getAttribution:function(){return this.options.attribution},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},setUrl:function(t,e){return this._url=t,e||this.redraw(),this},redraw:function(){return this._map&&(this._reset({hard:!0}),this._update()),this},_updateZIndex:function(){this._container&&this.options.zIndex!==i&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t,e){var i,n,o,s=t.children,a=-e(1/0,-1/0);for(n=0,o=s.length;o>n;n++)s[n]!==this._container&&(i=parseInt(s[n].style.zIndex,10),isNaN(i)||(a=e(a,i)));this.options.zIndex=this._container.style.zIndex=(isFinite(a)?a:0)+e(1,-1)},_updateOpacity:function(){var t,e=this._tiles;if(o.Browser.ielt9)for(t in e)o.DomUtil.setOpacity(e[t],this.options.opacity);else o.DomUtil.setOpacity(this._container,this.options.opacity)},_initContainer:function(){var t=this._map._panes.tilePane;if(!this._container){if(this._container=o.DomUtil.create("div","leaflet-layer"),this._updateZIndex(),this._animated){var e="leaflet-tile-container";this._bgBuffer=o.DomUtil.create("div",e,this._container),this._tileContainer=o.DomUtil.create("div",e,this._container)}else this._tileContainer=this._container;t.appendChild(this._container),this.options.opacity<1&&this._updateOpacity()}},_reset:function(t){for(var e in this._tiles)this.fire("tileunload",{tile:this._tiles[e]});this._tiles={},this._tilesToLoad=0,this.options.reuseTiles&&(this._unusedTiles=[]),this._tileContainer.innerHTML="",this._animated&&t&&t.hard&&this._clearBgBuffer(),this._initContainer()},_getTileSize:function(){var t=this._map,e=t.getZoom()+this.options.zoomOffset,i=this.options.maxNativeZoom,n=this.options.tileSize;return i&&e>i&&(n=Math.round(t.getZoomScale(e)/t.getZoomScale(i)*n)),n},_update:function(){if(this._map){var t=this._map,e=t.getPixelBounds(),i=t.getZoom(),n=this._getTileSize();if(!(i>this.options.maxZoom||in;n++)this._addTile(a[n],l);this._tileContainer.appendChild(l)}},_tileShouldBeLoaded:function(t){if(t.x+":"+t.y in this._tiles)return!1;var e=this.options;if(!e.continuousWorld){var i=this._getWrapTileNum();if(e.noWrap&&(t.x<0||t.x>=i.x)||t.y<0||t.y>=i.y)return!1}if(e.bounds){var n=e.tileSize,o=t.multiplyBy(n),s=o.add([n,n]),a=this._map.unproject(o),r=this._map.unproject(s);if(e.continuousWorld||e.noWrap||(a=a.wrap(),r=r.wrap()),!e.bounds.intersects([a,r]))return!1}return!0},_removeOtherTiles:function(t){var e,i,n,o;for(o in this._tiles)e=o.split(":"),i=parseInt(e[0],10),n=parseInt(e[1],10),(it.max.x||nt.max.y)&&this._removeTile(o)},_removeTile:function(t){var e=this._tiles[t];this.fire("tileunload",{tile:e,url:e.src}),this.options.reuseTiles?(o.DomUtil.removeClass(e,"leaflet-tile-loaded"),this._unusedTiles.push(e)):e.parentNode===this._tileContainer&&this._tileContainer.removeChild(e),o.Browser.android||(e.onload=null,e.src=o.Util.emptyImageUrl),delete this._tiles[t]},_addTile:function(t,e){var i=this._getTilePos(t),n=this._getTile();o.DomUtil.setPosition(n,i,o.Browser.chrome),this._tiles[t.x+":"+t.y]=n,this._loadTile(n,t),n.parentNode!==this._tileContainer&&e.appendChild(n)},_getZoomForUrl:function(){var t=this.options,e=this._map.getZoom();return t.zoomReverse&&(e=t.maxZoom-e),e+=t.zoomOffset,t.maxNativeZoom?Math.min(e,t.maxNativeZoom):e},_getTilePos:function(t){var e=this._map.getPixelOrigin(),i=this._getTileSize();return t.multiplyBy(i).subtract(e)},getTileUrl:function(t){return o.Util.template(this._url,o.extend({s:this._getSubdomain(t),z:t.z,x:t.x,y:t.y},this.options))},_getWrapTileNum:function(){return this._map.options.crs.getSize(this._map.getZoom()).divideBy(this.options.tileSize)},_adjustTilePoint:function(t){var e=this._getWrapTileNum();this.options.continuousWorld||this.options.noWrap||(t.x=(t.x%e.x+e.x)%e.x),this.options.tms&&(t.y=e.y-t.y-1),t.z=this._getZoomForUrl()},_getSubdomain:function(t){var e=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[e]},_getTile:function(){if(this.options.reuseTiles&&this._unusedTiles.length>0){var t=this._unusedTiles.pop();return this._resetTile(t),t}return this._createTile()},_resetTile:function(){},_createTile:function(){var t=o.DomUtil.create("img","leaflet-tile");return t.alt="Map Tile "+tileCount++,t.style.width=t.style.height=this._getTileSize()+"px",t.galleryimg="no",t.onselectstart=t.onmousemove=o.Util.falseFn,o.Browser.ielt9&&this.options.opacity!==i&&o.DomUtil.setOpacity(t,this.options.opacity),o.Browser.mobileWebkit3d&&(t.style.WebkitBackfaceVisibility="hidden"),t},_loadTile:function(t,e){t._layer=this,t.onload=this._tileOnLoad,t.onerror=this._tileOnError,this._adjustTilePoint(e),t.src=this.getTileUrl(e),this.fire("tileloadstart",{tile:t,url:t.src})},_tileLoaded:function(){this._tilesToLoad--,this._animated&&o.DomUtil.addClass(this._tileContainer,"leaflet-zoom-animated"),this._tilesToLoad||(this.fire("load"),this._animated&&(clearTimeout(this._clearBgBufferTimer),this._clearBgBufferTimer=setTimeout(o.bind(this._clearBgBuffer,this),500)))},_tileOnLoad:function(){var t=this._layer;this.src!==o.Util.emptyImageUrl&&(o.DomUtil.addClass(this,"leaflet-tile-loaded"),t.fire("tileload",{tile:this,url:this.src})),t._tileLoaded()},_tileOnError:function(){var t=this._layer;t.fire("tileerror",{tile:this,url:this.src});var e=t.options.errorTileUrl;e&&(this.src=e),t._tileLoaded()}}),o.tileLayer=function(t,e){return new o.TileLayer(t,e)},o.TileLayer.WMS=o.TileLayer.extend({defaultWmsParams:{service:"WMS",request:"GetMap",version:"1.1.1",layers:"",styles:"",format:"image/jpeg",transparent:!1},initialize:function(t,e){this._url=t;var i=o.extend({},this.defaultWmsParams),n=e.tileSize||this.options.tileSize;i.width=i.height=e.detectRetina&&o.Browser.retina?2*n:n;for(var s in e)this.options.hasOwnProperty(s)||"crs"===s||(i[s]=e[s]);this.wmsParams=i,o.setOptions(this,e)},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var e=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[e]=this._crs.code,o.TileLayer.prototype.onAdd.call(this,t)},getTileUrl:function(t){var e=this._map,i=this.options.tileSize,n=t.multiplyBy(i),s=n.add([i,i]),a=this._crs.project(e.unproject(n,t.z)),r=this._crs.project(e.unproject(s,t.z)),h=this._wmsVersion>=1.3&&this._crs===o.CRS.EPSG4326?[r.y,a.x,a.y,r.x].join(","):[a.x,r.y,r.x,a.y].join(","),l=o.Util.template(this._url,{s:this._getSubdomain(t)});return l+o.Util.getParamString(this.wmsParams,l,!0)+"&BBOX="+h},setParams:function(t,e){return o.extend(this.wmsParams,t),e||this.redraw(),this}}),o.tileLayer.wms=function(t,e){return new o.TileLayer.WMS(t,e)},o.TileLayer.Canvas=o.TileLayer.extend({options:{async:!1},initialize:function(t){o.setOptions(this,t)},redraw:function(){this._map&&(this._reset({hard:!0}),this._update());for(var t in this._tiles)this._redrawTile(this._tiles[t]);return this},_redrawTile:function(t){this.drawTile(t,t._tilePoint,this._map._zoom)},_createTile:function(){var t=o.DomUtil.create("canvas","leaflet-tile");return t.width=t.height=this.options.tileSize,t.onselectstart=t.onmousemove=o.Util.falseFn,t},_loadTile:function(t,e){t._layer=this,t._tilePoint=e,this._redrawTile(t),this.options.async||this.tileDrawn(t)},drawTile:function(){},tileDrawn:function(t){this._tileOnLoad.call(t)}}),o.tileLayer.canvas=function(t){return new o.TileLayer.Canvas(t)},o.ImageOverlay=o.Class.extend({includes:o.Mixin.Events,options:{opacity:1},initialize:function(t,e,i){this._url=t,this._bounds=o.latLngBounds(e),o.setOptions(this,i)},onAdd:function(t){this._map=t,this._image||this._initImage(),t._panes.overlayPane.appendChild(this._image),t.on("viewreset",this._reset,this),t.options.zoomAnimation&&o.Browser.any3d&&t.on("zoomanim",this._animateZoom,this),this._reset()},onRemove:function(t){t.getPanes().overlayPane.removeChild(this._image),t.off("viewreset",this._reset,this),t.options.zoomAnimation&&t.off("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},bringToFront:function(){return this._image&&this._map._panes.overlayPane.appendChild(this._image),this},bringToBack:function(){var t=this._map._panes.overlayPane;return this._image&&t.insertBefore(this._image,t.firstChild),this},setUrl:function(t){this._url=t,this._image.src=this._url},getAttribution:function(){return this.options.attribution},_initImage:function(){this._image=o.DomUtil.create("img","leaflet-image-layer"),this._map.options.zoomAnimation&&o.Browser.any3d?o.DomUtil.addClass(this._image,"leaflet-zoom-animated"):o.DomUtil.addClass(this._image,"leaflet-zoom-hide"),this._updateOpacity(),o.extend(this._image,{galleryimg:"no",onselectstart:o.Util.falseFn,onmousemove:o.Util.falseFn,onload:o.bind(this._onImageLoad,this),src:this._url})},_animateZoom:function(t){var e=this._map,i=this._image,n=e.getZoomScale(t.zoom),s=this._bounds.getNorthWest(),a=this._bounds.getSouthEast(),r=e._latLngToNewLayerPoint(s,t.zoom,t.center),h=e._latLngToNewLayerPoint(a,t.zoom,t.center)._subtract(r),l=r._add(h._multiplyBy(.5*(1-1/n)));i.style[o.DomUtil.TRANSFORM]=o.DomUtil.getTranslateString(l)+" scale("+n+") "},_reset:function(){var t=this._image,e=this._map.latLngToLayerPoint(this._bounds.getNorthWest()),i=this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);o.DomUtil.setPosition(t,e),t.style.width=i.x+"px",t.style.height=i.y+"px"},_onImageLoad:function(){this.fire("load")},_updateOpacity:function(){o.DomUtil.setOpacity(this._image,this.options.opacity)}}),o.imageOverlay=function(t,e,i){return new o.ImageOverlay(t,e,i)},o.Icon=o.Class.extend({options:{className:""},initialize:function(t){o.setOptions(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){if("icon"===t)throw new Error("iconUrl not set in Icon options (see the docs).");return null}var n;return n=e&&"IMG"===e.tagName?this._createImg(i,e):this._createImg(i),this._setIconStyles(n,t),n},_setIconStyles:function(t,e){var i,n=this.options,s=o.point(n[e+"Size"]);i="shadow"===e?o.point(n.shadowAnchor||n.iconAnchor):o.point(n.iconAnchor),!i&&s&&(i=s.divideBy(2,!0)),t.className="leaflet-marker-"+e+" "+n.className,i&&(t.style.marginLeft=-i.x+"px",t.style.marginTop=-i.y+"px"),s&&(t.style.width=s.x+"px",t.style.height=s.y+"px")},_createImg:function(t,i){return i=i||e.createElement("img"),i.src=t,i},_getIconUrl:function(t){return o.Browser.retina&&this.options[t+"RetinaUrl"]?this.options[t+"RetinaUrl"]:this.options[t+"Url"]}}),o.icon=function(t){return new o.Icon(t)},o.Icon.Default=o.Icon.extend({options:{iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]},_getIconUrl:function(t){var e=t+"Url";if(this.options[e])return this.options[e];o.Browser.retina&&"icon"===t&&(t+="-2x");var i=o.Icon.Default.imagePath;if(!i)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");return i+"/marker-"+t+".png"}}),o.Icon.Default.imagePath=function(){var t,i,n,s,a=e.getElementsByTagName("script"),r=/[\/^]leaflet[\-\._]?([\w\-\._]*)\.js\??/;for(t=0,i=a.length;i>t;t++)if(n=a[t].src,n.match(r))return s=n.split(r)[0],(s?s+"/":"")+"images"}(),o.Marker=o.Class.extend({includes:o.Mixin.Events,options:{icon:new o.Icon.Default,title:"",alt:"",clickable:!0,draggable:!1,keyboard:!0,zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250},initialize:function(t,e){o.setOptions(this,e),this._latlng=o.latLng(t)},onAdd:function(t){this._map=t,t.on("viewreset",this.update,this),this._initIcon(),this.update(),this.fire("add"),t.options.zoomAnimation&&t.options.markerZoomAnimation&&t.on("zoomanim",this._animateZoom,this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){this.dragging&&this.dragging.disable(),this._removeIcon(),this._removeShadow(),this.fire("remove"),t.off({viewreset:this.update,zoomanim:this._animateZoom},this),this._map=null},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=o.latLng(t),this.update(),this.fire("move",{latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update(),this},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup),this},update:function(){if(this._icon){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,e=this._map,i=e.options.zoomAnimation&&e.options.markerZoomAnimation,n=i?"leaflet-zoom-animated":"leaflet-zoom-hide",s=t.icon.createIcon(this._icon),a=!1;s!==this._icon&&(this._icon&&this._removeIcon(),a=!0,t.title&&(s.title=t.title),t.alt&&(s.alt=t.alt)),o.DomUtil.addClass(s,n),t.keyboard&&(s.tabIndex="0"),this._icon=s,this._initInteraction(),t.riseOnHover&&o.DomEvent.on(s,"mouseover",this._bringToFront,this).on(s,"mouseout",this._resetZIndex,this);var r=t.icon.createShadow(this._shadow),h=!1;r!==this._shadow&&(this._removeShadow(),h=!0),r&&o.DomUtil.addClass(r,n),this._shadow=r,t.opacity<1&&this._updateOpacity();var l=this._map._panes;a&&l.markerPane.appendChild(this._icon),r&&h&&l.shadowPane.appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&o.DomEvent.off(this._icon,"mouseover",this._bringToFront).off(this._icon,"mouseout",this._resetZIndex),this._map._panes.markerPane.removeChild(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&this._map._panes.shadowPane.removeChild(this._shadow),this._shadow=null},_setPos:function(t){o.DomUtil.setPosition(this._icon,t),this._shadow&&o.DomUtil.setPosition(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon.style.zIndex=this._zIndex+t},_animateZoom:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(e)},_initInteraction:function(){if(this.options.clickable){var t=this._icon,e=["dblclick","mousedown","mouseover","mouseout","contextmenu"];o.DomUtil.addClass(t,"leaflet-clickable"),o.DomEvent.on(t,"click",this._onMouseClick,this),o.DomEvent.on(t,"keypress",this._onKeyPress,this);for(var i=0;is?(e.height=s+"px",o.DomUtil.addClass(t,a)):o.DomUtil.removeClass(t,a),this._containerWidth=this._container.offsetWidth},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),e=this._animated,i=o.point(this.options.offset);e&&o.DomUtil.setPosition(this._container,t),this._containerBottom=-i.y-(e?0:t.y),this._containerLeft=-Math.round(this._containerWidth/2)+i.x+(e?0:t.x),this._container.style.bottom=this._containerBottom+"px",this._container.style.left=this._containerLeft+"px"}},_zoomAnimation:function(t){var e=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);o.DomUtil.setPosition(this._container,e)},_adjustPan:function(){if(this.options.autoPan){var t=this._map,e=this._container.offsetHeight,i=this._containerWidth,n=new o.Point(this._containerLeft,-e-this._containerBottom);this._animated&&n._add(o.DomUtil.getPosition(this._container));var s=t.layerPointToContainerPoint(n),a=o.point(this.options.autoPanPadding),r=o.point(this.options.autoPanPaddingTopLeft||a),h=o.point(this.options.autoPanPaddingBottomRight||a),l=t.getSize(),u=0,c=0;s.x+i+h.x>l.x&&(u=s.x+i-l.x+h.x),s.x-u-r.x<0&&(u=s.x-r.x),s.y+e+h.y>l.y&&(c=s.y+e-l.y+h.y),s.y-c-r.y<0&&(c=s.y-r.y),(u||c)&&t.fire("autopanstart").panBy([u,c])}},_onCloseButtonClick:function(t){this._close(),o.DomEvent.stop(t)}}),o.popup=function(t,e){return new o.Popup(t,e)},o.Map.include({openPopup:function(t,e,i){if(this.closePopup(),!(t instanceof o.Popup)){var n=t;t=new o.Popup(i).setLatLng(e).setContent(n)}return t._isOpen=!0,this._popup=t,this.addLayer(t)},closePopup:function(t){return t&&t!==this._popup||(t=this._popup,this._popup=null),t&&(this.removeLayer(t),t._isOpen=!1),this}}),o.Marker.include({openPopup:function(){return this._popup&&this._map&&!this._map.hasLayer(this._popup)&&(this._popup.setLatLng(this._latlng),this._map.openPopup(this._popup)),this},closePopup:function(){return this._popup&&this._popup._close(),this},togglePopup:function(){return this._popup&&(this._popup._isOpen?this.closePopup():this.openPopup()),this},bindPopup:function(t,e){var i=o.point(this.options.icon.options.popupAnchor||[0,0]);return i=i.add(o.Popup.prototype.options.offset),e&&e.offset&&(i=i.add(e.offset)),e=o.extend({offset:i},e),this._popupHandlersAdded||(this.on("click",this.togglePopup,this).on("remove",this.closePopup,this).on("move",this._movePopup,this),this._popupHandlersAdded=!0),t instanceof o.Popup?(o.setOptions(t,e),this._popup=t):this._popup=new o.Popup(e,this).setContent(t),this},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},unbindPopup:function(){return this._popup&&(this._popup=null,this.off("click",this.togglePopup,this).off("remove",this.closePopup,this).off("move",this._movePopup,this),this._popupHandlersAdded=!1),this},getPopup:function(){return this._popup},_movePopup:function(t){this._popup.setLatLng(t.latlng)}}),o.LayerGroup=o.Class.extend({initialize:function(t){this._layers={};var e,i;if(t)for(e=0,i=t.length;i>e;e++)this.addLayer(t[e])},addLayer:function(t){var e=this.getLayerId(t);return this._layers[e]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var e=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[e]&&this._map.removeLayer(this._layers[e]),delete this._layers[e],this},hasLayer:function(t){return!!t&&(t in this._layers||this.getLayerId(t)in this._layers)},clearLayers:function(){return this.eachLayer(this.removeLayer,this),this},invoke:function(t){var e,i,n=Array.prototype.slice.call(arguments,1);for(e in this._layers)i=this._layers[e],i[t]&&i[t].apply(i,n);return this},onAdd:function(t){this._map=t,this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t),this._map=null},addTo:function(t){return t.addLayer(this),this},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=[];for(var e in this._layers)t.push(this._layers[e]);return t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return o.stamp(t)}}),o.layerGroup=function(t){return new o.LayerGroup(t)},o.FeatureGroup=o.LayerGroup.extend({includes:o.Mixin.Events,statics:{EVENTS:"click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},addLayer:function(t){return this.hasLayer(t)?this:("on"in t&&t.on(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.addLayer.call(this,t),this._popupContent&&t.bindPopup&&t.bindPopup(this._popupContent,this._popupOptions),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.off(o.FeatureGroup.EVENTS,this._propagateEvent,this),o.LayerGroup.prototype.removeLayer.call(this,t),this._popupContent&&this.invoke("unbindPopup"),this.fire("layerremove",{layer:t})):this},bindPopup:function(t,e){return this._popupContent=t,this._popupOptions=e,this.invoke("bindPopup",t,e)},openPopup:function(t){for(var e in this._layers){this._layers[e].openPopup(t);break}return 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=new o.LatLngBounds;return this.eachLayer(function(e){t.extend(e instanceof o.Marker?e.getLatLng():e.getBounds())}),t},_propagateEvent:function(t){t=o.extend({layer:t.target,target:this},t),this.fire(t.type,t)}}),o.featureGroup=function(t){return new o.FeatureGroup(t)},o.Path=o.Class.extend({includes:[o.Mixin.Events],statics:{CLIP_PADDING:function(){var e=o.Browser.mobile?1280:2e3,i=(e/Math.max(t.outerWidth,t.outerHeight)-1)/2;return Math.max(0,Math.min(.5,i))}()},options:{stroke:!0,color:"#0033ff",dashArray:null,lineCap:null,lineJoin:null,weight:5,opacity:.5,fill:!1,fillColor:null,fillOpacity:.2,clickable:!0},initialize:function(t){o.setOptions(this,t)},onAdd:function(t){this._map=t,this._container||(this._initElements(),this._initEvents()),this.projectLatlngs(),this._updatePath(),this._container&&this._map._pathRoot.appendChild(this._container),this.fire("add"),t.on({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},addTo:function(t){return t.addLayer(this),this},onRemove:function(t){t._pathRoot.removeChild(this._container),this.fire("remove"),this._map=null,o.Browser.vml&&(this._container=null,this._stroke=null,this._fill=null),t.off({viewreset:this.projectLatlngs,moveend:this._updatePath},this)},projectLatlngs:function(){},setStyle:function(t){return o.setOptions(this,t),this._container&&this._updateStyle(),this},redraw:function(){return this._map&&(this.projectLatlngs(),this._updatePath()),this}}),o.Map.include({_updatePathViewport:function(){var t=o.Path.CLIP_PADDING,e=this.getSize(),i=o.DomUtil.getPosition(this._mapPane),n=i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()),s=n.add(e.multiplyBy(1+2*t)._round());this._pathViewport=new o.Bounds(n,s)}}),o.Path.SVG_NS="http://www.w3.org/2000/svg",o.Browser.svg=!(!e.createElementNS||!e.createElementNS(o.Path.SVG_NS,"svg").createSVGRect),o.Path=o.Path.extend({statics:{SVG:o.Browser.svg},bringToFront:function(){var t=this._map._pathRoot,e=this._container;return e&&t.lastChild!==e&&t.appendChild(e),this},bringToBack:function(){var t=this._map._pathRoot,e=this._container,i=t.firstChild;return e&&i!==e&&t.insertBefore(e,i),this},getPathString:function(){},_createElement:function(t){return e.createElementNS(o.Path.SVG_NS,t)},_initElements:function(){this._map._initPathRoot(),this._initPath(),this._initStyle()},_initPath:function(){this._container=this._createElement("g"),this._path=this._createElement("path"),this.options.className&&o.DomUtil.addClass(this._path,this.options.className),this._container.appendChild(this._path)},_initStyle:function(){this.options.stroke&&(this._path.setAttribute("stroke-linejoin","round"),this._path.setAttribute("stroke-linecap","round")),this.options.fill&&this._path.setAttribute("fill-rule","evenodd"),this.options.pointerEvents&&this._path.setAttribute("pointer-events",this.options.pointerEvents),this.options.clickable||this.options.pointerEvents||this._path.setAttribute("pointer-events","none"),this._updateStyle()},_updateStyle:function(){this.options.stroke?(this._path.setAttribute("stroke",this.options.color),this._path.setAttribute("stroke-opacity",this.options.opacity),this._path.setAttribute("stroke-width",this.options.weight),this.options.dashArray?this._path.setAttribute("stroke-dasharray",this.options.dashArray):this._path.removeAttribute("stroke-dasharray"),this.options.lineCap&&this._path.setAttribute("stroke-linecap",this.options.lineCap),this.options.lineJoin&&this._path.setAttribute("stroke-linejoin",this.options.lineJoin)):this._path.setAttribute("stroke","none"),this.options.fill?(this._path.setAttribute("fill",this.options.fillColor||this.options.color),this._path.setAttribute("fill-opacity",this.options.fillOpacity)):this._path.setAttribute("fill","none")},_updatePath:function(){var t=this.getPathString();t||(t="M0 0"),this._path.setAttribute("d",t)},_initEvents:function(){if(this.options.clickable){(o.Browser.svg||!o.Browser.vml)&&o.DomUtil.addClass(this._path,"leaflet-clickable"),o.DomEvent.on(this._container,"click",this._onMouseClick,this);for(var t=["dblclick","mousedown","mouseover","mouseout","mousemove","contextmenu"],e=0;e';var i=t.firstChild;return i.style.behavior="url(#default#VML)",i&&"object"==typeof i.adj}catch(n){return!1}}(),o.Path=o.Browser.svg||!o.Browser.vml?o.Path:o.Path.extend({statics:{VML:!0,CLIP_PADDING:.02},_createElement:function(){try{return e.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return e.createElement("')}}catch(t){return function(t){return e.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}}}(),_initPath:function(){var t=this._container=this._createElement("shape");o.DomUtil.addClass(t,"leaflet-vml-shape"+(this.options.className?" "+this.options.className:"")),this.options.clickable&&o.DomUtil.addClass(t,"leaflet-clickable"),t.coordsize="1 1",this._path=this._createElement("path"),t.appendChild(this._path),this._map._pathRoot.appendChild(t)},_initStyle:function(){this._updateStyle()},_updateStyle:function(){var t=this._stroke,e=this._fill,i=this.options,n=this._container;n.stroked=i.stroke,n.filled=i.fill,i.stroke?(t||(t=this._stroke=this._createElement("stroke"),t.endcap="round",n.appendChild(t)),t.weight=i.weight+"px",t.color=i.color,t.opacity=i.opacity,t.dashStyle=i.dashArray?o.Util.isArray(i.dashArray)?i.dashArray.join(" "):i.dashArray.replace(/( *, *)/g," "):"",i.lineCap&&(t.endcap=i.lineCap.replace("butt","flat")),i.lineJoin&&(t.joinstyle=i.lineJoin)):t&&(n.removeChild(t),this._stroke=null),i.fill?(e||(e=this._fill=this._createElement("fill"),n.appendChild(e)),e.color=i.fillColor||i.color,e.opacity=i.fillOpacity):e&&(n.removeChild(e),this._fill=null)},_updatePath:function(){var t=this._container.style;t.display="none",this._path.v=this.getPathString()+" ",t.display=""}}),o.Map.include(o.Browser.svg||!o.Browser.vml?{}:{_initPathRoot:function(){if(!this._pathRoot){var t=this._pathRoot=e.createElement("div");t.className="leaflet-vml-container",this._panes.overlayPane.appendChild(t),this.on("moveend",this._updatePathViewport),this._updatePathViewport()}}}),o.Browser.canvas=function(){return!!e.createElement("canvas").getContext}(),o.Path=o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?o.Path:o.Path.extend({statics:{CANVAS:!0,SVG:!1},redraw:function(){return this._map&&(this.projectLatlngs(),this._requestUpdate()),this},setStyle:function(t){return o.setOptions(this,t),this._map&&(this._updateStyle(),this._requestUpdate()),this},onRemove:function(t){t.off("viewreset",this.projectLatlngs,this).off("moveend",this._updatePath,this),this.options.clickable&&(this._map.off("click",this._onClick,this),this._map.off("mousemove",this._onMouseMove,this)),this._requestUpdate(),this._map=null},_requestUpdate:function(){this._map&&!o.Path._updateRequest&&(o.Path._updateRequest=o.Util.requestAnimFrame(this._fireMapMoveEnd,this._map))},_fireMapMoveEnd:function(){o.Path._updateRequest=null,this.fire("moveend")},_initElements:function(){this._map._initPathRoot(),this._ctx=this._map._canvasCtx},_updateStyle:function(){var t=this.options;t.stroke&&(this._ctx.lineWidth=t.weight,this._ctx.strokeStyle=t.color),t.fill&&(this._ctx.fillStyle=t.fillColor||t.color)},_drawPath:function(){var t,e,i,n,s,a;for(this._ctx.beginPath(),t=0,i=this._parts.length;i>t;t++){for(e=0,n=this._parts[t].length;n>e;e++)s=this._parts[t][e],a=(0===e?"move":"line")+"To",this._ctx[a](s.x,s.y);this instanceof o.Polygon&&this._ctx.closePath()}},_checkIfEmpty:function(){return!this._parts.length},_updatePath:function(){if(!this._checkIfEmpty()){var t=this._ctx,e=this.options;this._drawPath(),t.save(),this._updateStyle(),e.fill&&(t.globalAlpha=e.fillOpacity,t.fill()),e.stroke&&(t.globalAlpha=e.opacity,t.stroke()),t.restore()}},_initEvents:function(){this.options.clickable&&(this._map.on("mousemove",this._onMouseMove,this),this._map.on("click",this._onClick,this))},_onClick:function(t){this._containsPoint(t.layerPoint)&&this.fire("click",t)},_onMouseMove:function(t){this._map&&!this._map._animatingZoom&&(this._containsPoint(t.layerPoint)?(this._ctx.canvas.style.cursor="pointer",this._mouseInside=!0,this.fire("mouseover",t)):this._mouseInside&&(this._ctx.canvas.style.cursor="",this._mouseInside=!1,this.fire("mouseout",t)))}}),o.Map.include(o.Path.SVG&&!t.L_PREFER_CANVAS||!o.Browser.canvas?{}:{_initPathRoot:function(){var t,i=this._pathRoot;i||(i=this._pathRoot=e.createElement("canvas"),i.style.position="absolute",t=this._canvasCtx=i.getContext("2d"),t.lineCap="round",t.lineJoin="round",this._panes.overlayPane.appendChild(i),this.options.zoomAnimation&&(this._pathRoot.className="leaflet-zoom-animated",this.on("zoomanim",this._animatePathZoom),this.on("zoomend",this._endPathZoom)),this.on("moveend",this._updateCanvasViewport),this._updateCanvasViewport())},_updateCanvasViewport:function(){if(!this._pathZooming){this._updatePathViewport();var t=this._pathViewport,e=t.min,i=t.max.subtract(e),n=this._pathRoot;o.DomUtil.setPosition(n,e),n.width=i.x,n.height=i.y,n.getContext("2d").translate(-e.x,-e.y)}}}),o.LineUtil={simplify:function(t,e){if(!e||!t.length)return t.slice();var i=e*e;return t=this._reducePoints(t,i),t=this._simplifyDP(t,i)},pointToSegmentDistance:function(t,e,i){return Math.sqrt(this._sqClosestPointOnSegment(t,e,i,!0))},closestPointOnSegment:function(t,e,i){return this._sqClosestPointOnSegment(t,e,i)},_simplifyDP:function(t,e){var n=t.length,o=typeof Uint8Array!=i+""?Uint8Array:Array,s=new o(n);s[0]=s[n-1]=1,this._simplifyDPStep(t,s,e,0,n-1);var a,r=[];for(a=0;n>a;a++)s[a]&&r.push(t[a]);return r},_simplifyDPStep:function(t,e,i,n,o){var s,a,r,h=0;for(a=n+1;o-1>=a;a++)(r=this._sqClosestPointOnSegment(t[a],t[n],t[o],!0))>h&&(s=a,h=r);h>i&&(e[s]=1,this._simplifyDPStep(t,e,i,n,s),this._simplifyDPStep(t,e,i,s,o))},_reducePoints:function(t,e){for(var i=[t[0]],n=1,o=0,s=t.length;s>n;n++)this._sqDist(t[n],t[o])>e&&(i.push(t[n]),o=n);return s-1>o&&i.push(t[s-1]),i},clipSegment:function(t,e,i,n){var o,s,a,r=n?this._lastCode:this._getBitCode(t,i),h=this._getBitCode(e,i);for(this._lastCode=h;;){if(!(r|h))return[t,e];if(r&h)return!1;o=r||h,s=this._getEdgeIntersection(t,e,o,i),a=this._getBitCode(s,i),o===r?(t=s,r=a):(e=s,h=a)}},_getEdgeIntersection:function(t,e,i,n){var s=e.x-t.x,a=e.y-t.y,r=n.min,h=n.max;return 8&i?new o.Point(t.x+s*(h.y-t.y)/a,h.y):4&i?new o.Point(t.x+s*(r.y-t.y)/a,r.y):2&i?new o.Point(h.x,t.y+a*(h.x-t.x)/s):1&i?new o.Point(r.x,t.y+a*(r.x-t.x)/s):void 0},_getBitCode:function(t,e){var i=0;return t.xe.max.x&&(i|=2),t.ye.max.y&&(i|=8),i},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n},_sqClosestPointOnSegment:function(t,e,i,n){var s,a=e.x,r=e.y,h=i.x-a,l=i.y-r,u=h*h+l*l;return u>0&&(s=((t.x-a)*h+(t.y-r)*l)/u,s>1?(a=i.x,r=i.y):s>0&&(a+=h*s,r+=l*s)),h=t.x-a,l=t.y-r,n?h*h+l*l:new o.Point(a,r)}},o.Polyline=o.Path.extend({initialize:function(t,e){o.Path.prototype.initialize.call(this,e),this._latlngs=this._convertLatLngs(t)},options:{smoothFactor:1,noClip:!1},projectLatlngs:function(){this._originalPoints=[];for(var t=0,e=this._latlngs.length;e>t;t++)this._originalPoints[t]=this._map.latLngToLayerPoint(this._latlngs[t])},getPathString:function(){for(var t=0,e=this._parts.length,i="";e>t;t++)i+=this._getPathPartStr(this._parts[t]);return i},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._latlngs=this._convertLatLngs(t),this.redraw()},addLatLng:function(t){return this._latlngs.push(o.latLng(t)),this.redraw()},spliceLatLngs:function(){var t=[].splice.apply(this._latlngs,arguments);return this._convertLatLngs(this._latlngs,!0),this.redraw(),t},closestLayerPoint:function(t){for(var e,i,n=1/0,s=this._parts,a=null,r=0,h=s.length;h>r;r++)for(var l=s[r],u=1,c=l.length;c>u;u++){e=l[u-1],i=l[u];var d=o.LineUtil._sqClosestPointOnSegment(t,e,i,!0);n>d&&(n=d,a=o.LineUtil._sqClosestPointOnSegment(t,e,i))}return a&&(a.distance=Math.sqrt(n)),a},getBounds:function(){return new o.LatLngBounds(this.getLatLngs())},_convertLatLngs:function(t,e){var i,n,s=e?t:[];for(i=0,n=t.length;n>i;i++){if(o.Util.isArray(t[i])&&"number"!=typeof t[i][0])return;s[i]=o.latLng(t[i])}return s},_initEvents:function(){o.Path.prototype._initEvents.call(this)},_getPathPartStr:function(t){for(var e,i=o.Path.VML,n=0,s=t.length,a="";s>n;n++)e=t[n],i&&e._round(),a+=(n?"L":"M")+e.x+" "+e.y;return a},_clipPoints:function(){var t,e,i,n=this._originalPoints,s=n.length;if(this.options.noClip)return void(this._parts=[n]);this._parts=[];var a=this._parts,r=this._map._pathViewport,h=o.LineUtil;for(t=0,e=0;s-1>t;t++)(i=h.clipSegment(n[t],n[t+1],r,t))&&(a[e]=a[e]||[],a[e].push(i[0]),(i[1]!==n[t+1]||t===s-2)&&(a[e].push(i[1]),e++))},_simplifyPoints:function(){for(var t=this._parts,e=o.LineUtil,i=0,n=t.length;n>i;i++)t[i]=e.simplify(t[i],this.options.smoothFactor)},_updatePath:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),o.Path.prototype._updatePath.call(this))}}),o.polyline=function(t,e){return new o.Polyline(t,e)},o.PolyUtil={},o.PolyUtil.clipPolygon=function(t,e){var i,n,s,a,r,h,l,u,c,d=[1,4,2,8],p=o.LineUtil;for(n=0,l=t.length;l>n;n++)t[n]._code=p._getBitCode(t[n],e);for(a=0;4>a;a++){for(u=d[a],i=[],n=0,l=t.length,s=l-1;l>n;s=n++)r=t[n],h=t[s],r._code&u?h._code&u||(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)):(h._code&u&&(c=p._getEdgeIntersection(h,r,u,e),c._code=p._getBitCode(c,e),i.push(c)),i.push(r));t=i}return t},o.Polygon=o.Polyline.extend({options:{fill:!0},initialize:function(t,e){o.Polyline.prototype.initialize.call(this,t,e),this._initWithHoles(t)},_initWithHoles:function(t){var e,i,n;if(t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0])for(this._latlngs=this._convertLatLngs(t[0]),this._holes=t.slice(1),e=0,i=this._holes.length;i>e;e++)n=this._holes[e]=this._convertLatLngs(this._holes[e]),n[0].equals(n[n.length-1])&&n.pop();t=this._latlngs,t.length>=2&&t[0].equals(t[t.length-1])&&t.pop()},projectLatlngs:function(){if(o.Polyline.prototype.projectLatlngs.call(this),this._holePoints=[],this._holes){var t,e,i,n;for(t=0,i=this._holes.length;i>t;t++)for(this._holePoints[t]=[],e=0,n=this._holes[t].length;n>e;e++)this._holePoints[t][e]=this._map.latLngToLayerPoint(this._holes[t][e])}},setLatLngs:function(t){return t&&o.Util.isArray(t[0])&&"number"!=typeof t[0][0]?(this._initWithHoles(t),this.redraw()):o.Polyline.prototype.setLatLngs.call(this,t)},_clipPoints:function(){var t=this._originalPoints,e=[];if(this._parts=[t].concat(this._holePoints),!this.options.noClip){for(var i=0,n=this._parts.length;n>i;i++){var s=o.PolyUtil.clipPolygon(this._parts[i],this._map._pathViewport);s.length&&e.push(s)}this._parts=e}},_getPathPartStr:function(t){return o.Polyline.prototype._getPathPartStr.call(this,t)+(o.Browser.svg?"z":"x")}}),o.polygon=function(t,e){return new o.Polygon(t,e)},function(){function t(t){return o.FeatureGroup.extend({initialize:function(t,e){this._layers={},this._options=e,this.setLatLngs(t)},setLatLngs:function(e){var i=0,n=e.length;for(this.eachLayer(function(t){n>i?t.setLatLngs(e[i++]):this.removeLayer(t)},this);n>i;)this.addLayer(new t(e[i++],this._options));return this},getLatLngs:function(){var t=[];return this.eachLayer(function(e){t.push(e.getLatLngs())}),t}})}o.MultiPolyline=t(o.Polyline),o.MultiPolygon=t(o.Polygon),o.multiPolyline=function(t,e){return new o.MultiPolyline(t,e)},o.multiPolygon=function(t,e){return new o.MultiPolygon(t,e)}}(),o.Rectangle=o.Polygon.extend({initialize:function(t,e){o.Polygon.prototype.initialize.call(this,this._boundsToLatLngs(t),e)},setBounds:function(t){this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=o.latLngBounds(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}}),o.rectangle=function(t,e){return new o.Rectangle(t,e)},o.Circle=o.Path.extend({initialize:function(t,e,i){o.Path.prototype.initialize.call(this,i),this._latlng=o.latLng(t),this._mRadius=e},options:{fill:!0},setLatLng:function(t){return this._latlng=o.latLng(t),this.redraw()},setRadius:function(t){return this._mRadius=t,this.redraw()},projectLatlngs:function(){var t=this._getLngRadius(),e=this._latlng,i=this._map.latLngToLayerPoint([e.lat,e.lng-t]);this._point=this._map.latLngToLayerPoint(e),this._radius=Math.max(this._point.x-i.x,1)},getBounds:function(){var t=this._getLngRadius(),e=this._mRadius/40075017*360,i=this._latlng;return new o.LatLngBounds([i.lat-e,i.lng-t],[i.lat+e,i.lng+t])},getLatLng:function(){return this._latlng},getPathString:function(){var t=this._point,e=this._radius;return this._checkIfEmpty()?"":o.Browser.svg?"M"+t.x+","+(t.y-e)+"A"+e+","+e+",0,1,1,"+(t.x-.1)+","+(t.y-e)+" z":(t._round(),e=Math.round(e),"AL "+t.x+","+t.y+" "+e+","+e+" 0,23592600")},getRadius:function(){return this._mRadius},_getLatRadius:function(){return this._mRadius/40075017*360},_getLngRadius:function(){return this._getLatRadius()/Math.cos(o.LatLng.DEG_TO_RAD*this._latlng.lat)},_checkIfEmpty:function(){if(!this._map)return!1;var t=this._map._pathViewport,e=this._radius,i=this._point;return i.x-e>t.max.x||i.y-e>t.max.y||i.x+ei;i++)for(l=this._parts[i],n=0,r=l.length,s=r-1;r>n;s=n++)if((e||0!==n)&&(h=o.LineUtil.pointToSegmentDistance(t,l[s],l[n]),u>=h))return!0;return!1}}:{}),o.Polygon.include(o.Path.CANVAS?{_containsPoint:function(t){var e,i,n,s,a,r,h,l,u=!1;if(o.Polyline.prototype._containsPoint.call(this,t,!0))return!0;for(s=0,h=this._parts.length;h>s;s++)for(e=this._parts[s],a=0,l=e.length,r=l-1;l>a;r=a++)i=e[a],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&&(u=!u);return u}}:{}),o.Circle.include(o.Path.CANVAS?{_drawPath:function(){var t=this._point;this._ctx.beginPath(),this._ctx.arc(t.x,t.y,this._radius,0,2*Math.PI,!1)},_containsPoint:function(t){var e=this._point,i=this.options.stroke?this.options.weight/2:0;return t.distanceTo(e)<=this._radius+i}}:{}),o.CircleMarker.include(o.Path.CANVAS?{_updateStyle:function(){o.Path.prototype._updateStyle.call(this)}}:{}),o.GeoJSON=o.FeatureGroup.extend({initialize:function(t,e){o.setOptions(this,e),this._layers={},t&&this.addData(t)},addData:function(t){var e,i,n,s=o.Util.isArray(t)?t:t.features;if(s){for(e=0,i=s.length;i>e;e++)n=s[e],(n.geometries||n.geometry||n.features||n.coordinates)&&this.addData(s[e]);return this}var a=this.options;if(!a.filter||a.filter(t)){var r=o.GeoJSON.geometryToLayer(t,a.pointToLayer,a.coordsToLatLng,a);return r.feature=o.GeoJSON.asFeature(t),r.defaultOptions=r.options,this.resetStyle(r),a.onEachFeature&&a.onEachFeature(t,r),this.addLayer(r)}},resetStyle:function(t){var e=this.options.style;e&&(o.Util.extend(t.options,t.defaultOptions),this._setLayerStyle(t,e))},setStyle:function(t){this.eachLayer(function(e){this._setLayerStyle(e,t)},this)},_setLayerStyle:function(t,e){"function"==typeof e&&(e=e(t.feature)),t.setStyle&&t.setStyle(e)}}),o.extend(o.GeoJSON,{geometryToLayer:function(t,e,i,n){var s,a,r,h,l="Feature"===t.type?t.geometry:t,u=l.coordinates,c=[];switch(i=i||this.coordsToLatLng,l.type){case"Point":return s=i(u),e?e(t,s):new o.Marker(s);case"MultiPoint":for(r=0,h=u.length;h>r;r++)s=i(u[r]),c.push(e?e(t,s):new o.Marker(s));return new o.FeatureGroup(c);case"LineString":return a=this.coordsToLatLngs(u,0,i),new o.Polyline(a,n);case"Polygon":if(2===u.length&&!u[1].length)throw new Error("Invalid GeoJSON object.");return a=this.coordsToLatLngs(u,1,i),new o.Polygon(a,n);case"MultiLineString":return a=this.coordsToLatLngs(u,1,i), new o.MultiPolyline(a,n);case"MultiPolygon":return a=this.coordsToLatLngs(u,2,i),new o.MultiPolygon(a,n);case"GeometryCollection":for(r=0,h=l.geometries.length;h>r;r++)c.push(this.geometryToLayer({geometry:l.geometries[r],type:"Feature",properties:t.properties},e,i,n));return new o.FeatureGroup(c);default:throw new Error("Invalid GeoJSON object.")}},coordsToLatLng:function(t){return new o.LatLng(t[1],t[0],t[2])},coordsToLatLngs:function(t,e,i){var n,o,s,a=[];for(o=0,s=t.length;s>o;o++)n=e?this.coordsToLatLngs(t[o],e-1,i):(i||this.coordsToLatLng)(t[o]),a.push(n);return a},latLngToCoords:function(t){var e=[t.lng,t.lat];return t.alt!==i&&e.push(t.alt),e},latLngsToCoords:function(t){for(var e=[],i=0,n=t.length;n>i;i++)e.push(o.GeoJSON.latLngToCoords(t[i]));return e},getFeature:function(t,e){return t.feature?o.extend({},t.feature,{geometry:e}):o.GeoJSON.asFeature(e)},asFeature:function(t){return"Feature"===t.type?t:{type:"Feature",properties:{},geometry:t}}});var a={toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"Point",coordinates:o.GeoJSON.latLngToCoords(this.getLatLng())})}};o.Marker.include(a),o.Circle.include(a),o.CircleMarker.include(a),o.Polyline.include({toGeoJSON:function(){return o.GeoJSON.getFeature(this,{type:"LineString",coordinates:o.GeoJSON.latLngsToCoords(this.getLatLngs())})}}),o.Polygon.include({toGeoJSON:function(){var t,e,i,n=[o.GeoJSON.latLngsToCoords(this.getLatLngs())];if(n[0].push(n[0][0]),this._holes)for(t=0,e=this._holes.length;e>t;t++)i=o.GeoJSON.latLngsToCoords(this._holes[t]),i.push(i[0]),n.push(i);return o.GeoJSON.getFeature(this,{type:"Polygon",coordinates:n})}}),function(){function t(t){return function(){var e=[];return this.eachLayer(function(t){e.push(t.toGeoJSON().geometry.coordinates)}),o.GeoJSON.getFeature(this,{type:t,coordinates:e})}}o.MultiPolyline.include({toGeoJSON:t("MultiLineString")}),o.MultiPolygon.include({toGeoJSON:t("MultiPolygon")}),o.LayerGroup.include({toGeoJSON:function(){var e,i=this.feature&&this.feature.geometry,n=[];if(i&&"MultiPoint"===i.type)return t("MultiPoint").call(this);var s=i&&"GeometryCollection"===i.type;return this.eachLayer(function(t){t.toGeoJSON&&(e=t.toGeoJSON(),n.push(s?e.geometry:o.GeoJSON.asFeature(e)))}),s?o.GeoJSON.getFeature(this,{geometries:n,type:"GeometryCollection"}):{type:"FeatureCollection",features:n}}})}(),o.geoJson=function(t,e){return new o.GeoJSON(t,e)},o.DomEvent={addListener:function(t,e,i,n){var s,a,r,h=o.stamp(i),l="_leaflet_"+e+h;return t[l]?this:(s=function(e){return i.call(n||t,e||o.DomEvent._getEvent())},o.Browser.pointer&&0===e.indexOf("touch")?this.addPointerListener(t,e,s,h):(o.Browser.touch&&"dblclick"===e&&this.addDoubleTapListener&&this.addDoubleTapListener(t,s,h),"addEventListener"in t?"mousewheel"===e?(t.addEventListener("DOMMouseScroll",s,!1),t.addEventListener(e,s,!1)):"mouseenter"===e||"mouseleave"===e?(a=s,r="mouseenter"===e?"mouseover":"mouseout",s=function(e){return o.DomEvent._checkMouse(t,e)?a(e):void 0},t.addEventListener(r,s,!1)):"click"===e&&o.Browser.android?(a=s,s=function(t){return o.DomEvent._filterClick(t,a)},t.addEventListener(e,s,!1)):t.addEventListener(e,s,!1):"attachEvent"in t&&t.attachEvent("on"+e,s),t[l]=s,this))},removeListener:function(t,e,i){var n=o.stamp(i),s="_leaflet_"+e+n,a=t[s];return a?(o.Browser.pointer&&0===e.indexOf("touch")?this.removePointerListener(t,e,n):o.Browser.touch&&"dblclick"===e&&this.removeDoubleTapListener?this.removeDoubleTapListener(t,n):"removeEventListener"in t?"mousewheel"===e?(t.removeEventListener("DOMMouseScroll",a,!1),t.removeEventListener(e,a,!1)):"mouseenter"===e||"mouseleave"===e?t.removeEventListener("mouseenter"===e?"mouseover":"mouseout",a,!1):t.removeEventListener(e,a,!1):"detachEvent"in t&&t.detachEvent("on"+e,a),t[s]=null,this):this},stopPropagation:function(t){return t.stopPropagation?t.stopPropagation():t.cancelBubble=!0,o.DomEvent._skipped(t),this},disableScrollPropagation:function(t){var e=o.DomEvent.stopPropagation;return o.DomEvent.on(t,"mousewheel",e).on(t,"MozMousePixelScroll",e)},disableClickPropagation:function(t){for(var e=o.DomEvent.stopPropagation,i=o.Draggable.START.length-1;i>=0;i--)o.DomEvent.on(t,o.Draggable.START[i],e);return o.DomEvent.on(t,"click",o.DomEvent._fakeStop).on(t,"dblclick",e)},preventDefault:function(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this},stop:function(t){return o.DomEvent.preventDefault(t).stopPropagation(t)},getMousePosition:function(t,i){var n=e.body,s=e.documentElement,a=o.DomUtil.documentIsLtr()?t.pageX?t.pageX-n.scrollLeft-s.scrollLeft:t.clientX:o.Browser.gecko?t.pageX-n.scrollLeft-s.scrollLeft:t.pageX?t.pageX-n.scrollLeft+s.scrollLeft:t.clientX,r=t.pageY?t.pageY-n.scrollTop-s.scrollTop:t.clientY,h=new o.Point(a,r);if(!i)return h;var l=i.getBoundingClientRect(),u=l.left-i.clientLeft,c=l.top-i.clientTop;return h._subtract(new o.Point(u,c))},getWheelDelta:function(t){var e=0;return t.wheelDelta&&(e=t.wheelDelta/120),t.detail&&(e=-t.detail/3),e},_skipEvents:{},_fakeStop:function(t){o.DomEvent._skipEvents[t.type]=!0},_skipped:function(t){var e=this._skipEvents[t.type];return this._skipEvents[t.type]=!1,e},_checkMouse:function(t,e){var i=e.relatedTarget;if(!i)return!0;try{for(;i&&i!==t;)i=i.parentNode}catch(n){return!1}return i!==t},_getEvent:function(){var e=t.event;if(!e)for(var i=arguments.callee.caller;i&&(!(e=i.arguments[0])||t.Event!==e.constructor);)i=i.caller;return e},_filterClick:function(t,e){var i=t.timeStamp||t.originalEvent.timeStamp,n=o.DomEvent._lastClick&&i-o.DomEvent._lastClick;return n&&n>100&&1e3>n||t.target._simulatedClick&&!t._simulated?void o.DomEvent.stop(t):(o.DomEvent._lastClick=i,e(t))}},o.DomEvent.on=o.DomEvent.addListener,o.DomEvent.off=o.DomEvent.removeListener,o.Draggable=o.Class.extend({includes:o.Mixin.Events,statics:{START:o.Browser.touch?["touchstart","mousedown"]:["mousedown"],END:{mousedown:"mouseup",touchstart:"touchend",pointerdown:"touchend",MSPointerDown:"touchend"},MOVE:{mousedown:"mousemove",touchstart:"touchmove",pointerdown:"touchmove",MSPointerDown:"touchmove"}},initialize:function(t,e){this._element=t,this._dragStartTarget=e||t},enable:function(){if(!this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.on(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!0}},disable:function(){if(this._enabled){for(var t=o.Draggable.START.length-1;t>=0;t--)o.DomEvent.off(this._dragStartTarget,o.Draggable.START[t],this._onDown,this);this._enabled=!1,this._moved=!1}},_onDown:function(t){if(this._moved=!1,!(t.shiftKey||1!==t.which&&1!==t.button&&!t.touches||(o.DomEvent.stopPropagation(t),o.Draggable._disabled||(o.DomUtil.disableImageDrag(),o.DomUtil.disableTextSelection(),this._moving)))){var i=t.touches?t.touches[0]:t;this._startPoint=new o.Point(i.clientX,i.clientY),this._startPos=this._newPos=o.DomUtil.getPosition(this._element),o.DomEvent.on(e,o.Draggable.MOVE[t.type],this._onMove,this).on(e,o.Draggable.END[t.type],this._onUp,this)}},_onMove:function(t){if(t.touches&&t.touches.length>1)return void(this._moved=!0);var i=t.touches&&1===t.touches.length?t.touches[0]:t,n=new o.Point(i.clientX,i.clientY),s=n.subtract(this._startPoint);(s.x||s.y)&&(o.DomEvent.preventDefault(t),this._moved||(this.fire("dragstart"),this._moved=!0,this._startPos=o.DomUtil.getPosition(this._element).subtract(s),o.DomUtil.addClass(e.body,"leaflet-dragging"),o.DomUtil.addClass(t.target||t.srcElement,"leaflet-drag-target")),this._newPos=this._startPos.add(s),this._moving=!0,o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updatePosition,this,!0,this._dragStartTarget))},_updatePosition:function(){this.fire("predrag"),o.DomUtil.setPosition(this._element,this._newPos),this.fire("drag")},_onUp:function(t){o.DomUtil.removeClass(e.body,"leaflet-dragging"),o.DomUtil.removeClass(t.target||t.srcElement,"leaflet-drag-target");for(var i in o.Draggable.MOVE)o.DomEvent.off(e,o.Draggable.MOVE[i],this._onMove).off(e,o.Draggable.END[i],this._onUp);o.DomUtil.enableImageDrag(),o.DomUtil.enableTextSelection(),this._moved&&this._moving&&(o.Util.cancelAnimFrame(this._animRequest),this.fire("dragend",{distance:this._newPos.distanceTo(this._startPos)})),this._moving=!1}}),o.Handler=o.Class.extend({initialize:function(t){this._map=t},enable:function(){this._enabled||(this._enabled=!0,this.addHooks())},disable:function(){this._enabled&&(this._enabled=!1,this.removeHooks())},enabled:function(){return!!this._enabled}}),o.Map.mergeOptions({dragging:!0,inertia:!o.Browser.android23,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,inertiaThreshold:o.Browser.touch?32:18,easeLinearity:.25,worldCopyJump:!1}),o.Map.Drag=o.Handler.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new o.Draggable(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDrag,this),t.on("viewreset",this._onViewReset,this),t.whenReady(this._onViewReset,this))}this._draggable.enable()},removeHooks:function(){this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){var t=this._map;t._panAnim&&t._panAnim.stop(),t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(){if(this._map.options.inertia){var t=this._lastTime=+new Date,e=this._lastPos=this._draggable._newPos;this._positions.push(e),this._times.push(t),t-this._times[0]>200&&(this._positions.shift(),this._times.shift())}this._map.fire("move").fire("drag")},_onViewReset:function(){var t=this._map.getSize()._divideBy(2),e=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=e.subtract(t).x,this._worldWidth=this._map.project([0,180]).x},_onPreDrag: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,s=(n+e+i)%t-e-i,a=Math.abs(o+i)i.inertiaThreshold||!this._positions[0];if(e.fire("dragend",t),s)e.fire("moveend");else{var a=this._lastPos.subtract(this._positions[0]),r=(this._lastTime+n-this._times[0])/1e3,h=i.easeLinearity,l=a.multiplyBy(h/r),u=l.distanceTo([0,0]),c=Math.min(i.inertiaMaxSpeed,u),d=l.multiplyBy(c/u),p=c/(i.inertiaDeceleration*h),_=d.multiplyBy(-p/2).round();_.x&&_.y?(_=e._limitOffset(_,e.options.maxBounds),o.Util.requestAnimFrame(function(){e.panBy(_,{duration:p,easeLinearity:h,noMoveStart:!0})})):e.fire("moveend")}}}),o.Map.addInitHook("addHandler","dragging",o.Map.Drag),o.Map.mergeOptions({doubleClickZoom:!0}),o.Map.DoubleClickZoom=o.Handler.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()+(t.originalEvent.shiftKey?-1:1);"center"===e.options.doubleClickZoom?e.setZoom(i):e.setZoomAround(t.containerPoint,i)}}),o.Map.addInitHook("addHandler","doubleClickZoom",o.Map.DoubleClickZoom),o.Map.mergeOptions({scrollWheelZoom:!0}),o.Map.ScrollWheelZoom=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"mousewheel",this._onWheelScroll,this),o.DomEvent.on(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault),this._delta=0},removeHooks:function(){o.DomEvent.off(this._map._container,"mousewheel",this._onWheelScroll),o.DomEvent.off(this._map._container,"MozMousePixelScroll",o.DomEvent.preventDefault)},_onWheelScroll:function(t){var e=o.DomEvent.getWheelDelta(t);this._delta+=e,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var i=Math.max(40-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(o.bind(this._performZoom,this),i),o.DomEvent.preventDefault(t),o.DomEvent.stopPropagation(t)},_performZoom:function(){var t=this._map,e=this._delta,i=t.getZoom();e=e>0?Math.ceil(e):Math.floor(e),e=Math.max(Math.min(e,4),-4),e=t._limitZoom(i+e)-i,this._delta=0,this._startTime=null,e&&("center"===t.options.scrollWheelZoom?t.setZoom(i+e):t.setZoomAround(this._lastMousePos,i+e))}}),o.Map.addInitHook("addHandler","scrollWheelZoom",o.Map.ScrollWheelZoom),o.extend(o.DomEvent,{_touchstart:o.Browser.msPointer?"MSPointerDown":o.Browser.pointer?"pointerdown":"touchstart",_touchend:o.Browser.msPointer?"MSPointerUp":o.Browser.pointer?"pointerup":"touchend",addDoubleTapListener:function(t,i,n){function s(t){var e;if(o.Browser.pointer?(_.push(t.pointerId),e=_.length):e=t.touches.length,!(e>1)){var i=Date.now(),n=i-(r||i);h=t.touches?t.touches[0]:t,l=n>0&&u>=n,r=i}}function a(t){if(o.Browser.pointer){var e=_.indexOf(t.pointerId);if(-1===e)return;_.splice(e,1)}if(l){if(o.Browser.pointer){var n,s={};for(var a in h)n=h[a],s[a]="function"==typeof n?n.bind(h):n;h=s}h.type="dblclick",i(h),r=null}}var r,h,l=!1,u=250,c="_leaflet_",d=this._touchstart,p=this._touchend,_=[];t[c+d+n]=s,t[c+p+n]=a;var m=o.Browser.pointer?e.documentElement:t;return t.addEventListener(d,s,!1),m.addEventListener(p,a,!1),o.Browser.pointer&&m.addEventListener(o.DomEvent.POINTER_CANCEL,a,!1),this},removeDoubleTapListener:function(t,i){var n="_leaflet_";return t.removeEventListener(this._touchstart,t[n+this._touchstart+i],!1),(o.Browser.pointer?e.documentElement:t).removeEventListener(this._touchend,t[n+this._touchend+i],!1),o.Browser.pointer&&e.documentElement.removeEventListener(o.DomEvent.POINTER_CANCEL,t[n+this._touchend+i],!1),this}}),o.extend(o.DomEvent,{POINTER_DOWN:o.Browser.msPointer?"MSPointerDown":"pointerdown",POINTER_MOVE:o.Browser.msPointer?"MSPointerMove":"pointermove",POINTER_UP:o.Browser.msPointer?"MSPointerUp":"pointerup",POINTER_CANCEL:o.Browser.msPointer?"MSPointerCancel":"pointercancel",_pointers:[],_pointerDocumentListener:!1,addPointerListener:function(t,e,i,n){switch(e){case"touchstart":return this.addPointerListenerStart(t,e,i,n);case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return this.addPointerListenerMove(t,e,i,n);default:throw"Unknown touch event type"}},addPointerListenerStart:function(t,i,n,s){var r=this._pointers,h=function(t){o.DomEvent.preventDefault(t);for(var e=!1,i=0;i1))&&(this._moved||(o.DomUtil.addClass(e._mapPane,"leaflet-touching"),e.fire("movestart").fire("zoomstart"),this._moved=!0),o.Util.cancelAnimFrame(this._animRequest),this._animRequest=o.Util.requestAnimFrame(this._updateOnMove,this,!0,this._map._container),o.DomEvent.preventDefault(t))}},_updateOnMove:function(){var t=this._map,e=this._getScaleOrigin(),i=t.layerPointToLatLng(e),n=t.getScaleZoom(this._scale);t._animateZoom(i,n,this._startCenter,this._scale,this._delta)},_onTouchEnd:function(){if(!this._moved||!this._zooming)return void(this._zooming=!1);var t=this._map;this._zooming=!1,o.DomUtil.removeClass(t._mapPane,"leaflet-touching"),o.Util.cancelAnimFrame(this._animRequest),o.DomEvent.off(e,"touchmove",this._onTouchMove).off(e,"touchend",this._onTouchEnd);var i=this._getScaleOrigin(),n=t.layerPointToLatLng(i),s=t.getZoom(),a=t.getScaleZoom(this._scale)-s,r=a>0?Math.ceil(a):Math.floor(a),h=t._limitZoom(s+r),l=t.getZoomScale(h)/this._scale;t._animateZoom(n,h,i,l)},_getScaleOrigin:function(){var t=this._centerOffset.subtract(this._delta).divideBy(this._scale);return this._startCenter.add(t)}}),o.Map.addInitHook("addHandler","touchZoom",o.Map.TouchZoom),o.Map.mergeOptions({tap:!0,tapTolerance:15}),o.Map.Tap=o.Handler.extend({addHooks:function(){o.DomEvent.on(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){o.DomEvent.off(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(t.touches){if(o.DomEvent.preventDefault(t),this._fireClick=!0,t.touches.length>1)return this._fireClick=!1,void clearTimeout(this._holdTimeout);var i=t.touches[0],n=i.target;this._startPos=this._newPos=new o.Point(i.clientX,i.clientY),n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.addClass(n,"leaflet-active"),this._holdTimeout=setTimeout(o.bind(function(){this._isTapValid()&&(this._fireClick=!1,this._onUp(),this._simulateEvent("contextmenu",i))},this),1e3),o.DomEvent.on(e,"touchmove",this._onMove,this).on(e,"touchend",this._onUp,this)}},_onUp:function(t){if(clearTimeout(this._holdTimeout),o.DomEvent.off(e,"touchmove",this._onMove,this).off(e,"touchend",this._onUp,this),this._fireClick&&t&&t.changedTouches){var i=t.changedTouches[0],n=i.target;n&&n.tagName&&"a"===n.tagName.toLowerCase()&&o.DomUtil.removeClass(n,"leaflet-active"),this._isTapValid()&&this._simulateEvent("click",i)}},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_onMove:function(t){var e=t.touches[0];this._newPos=new o.Point(e.clientX,e.clientY)},_simulateEvent:function(i,n){var o=e.createEvent("MouseEvents");o._simulated=!0,n.target._simulatedClick=!0,o.initMouseEvent(i,!0,!0,t,1,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),n.target.dispatchEvent(o)}}),o.Browser.touch&&!o.Browser.pointer&&o.Map.addInitHook("addHandler","tap",o.Map.Tap),o.Map.mergeOptions({boxZoom:!0}),o.Map.BoxZoom=o.Handler.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._moved=!1},addHooks:function(){o.DomEvent.on(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){o.DomEvent.off(this._container,"mousedown",this._onMouseDown),this._moved=!1},moved:function(){return this._moved},_onMouseDown:function(t){return this._moved=!1,!(!t.shiftKey||1!==t.which&&1!==t.button)&&(o.DomUtil.disableTextSelection(),o.DomUtil.disableImageDrag(),this._startLayerPoint=this._map.mouseEventToLayerPoint(t),void o.DomEvent.on(e,"mousemove",this._onMouseMove,this).on(e,"mouseup",this._onMouseUp,this).on(e,"keydown",this._onKeyDown,this))},_onMouseMove:function(t){this._moved||(this._box=o.DomUtil.create("div","leaflet-zoom-box",this._pane),o.DomUtil.setPosition(this._box,this._startLayerPoint),this._container.style.cursor="crosshair",this._map.fire("boxzoomstart"));var e=this._startLayerPoint,i=this._box,n=this._map.mouseEventToLayerPoint(t),s=n.subtract(e),a=new o.Point(Math.min(n.x,e.x),Math.min(n.y,e.y));o.DomUtil.setPosition(i,a),this._moved=!0,i.style.width=Math.max(0,Math.abs(s.x)-4)+"px",i.style.height=Math.max(0,Math.abs(s.y)-4)+"px"},_finish:function(){this._moved&&(this._pane.removeChild(this._box),this._container.style.cursor=""),o.DomUtil.enableTextSelection(),o.DomUtil.enableImageDrag(),o.DomEvent.off(e,"mousemove",this._onMouseMove).off(e,"mouseup",this._onMouseUp).off(e,"keydown",this._onKeyDown)},_onMouseUp:function(t){this._finish();var e=this._map,i=e.mouseEventToLayerPoint(t);if(!this._startLayerPoint.equals(i)){var n=new o.LatLngBounds(e.layerPointToLatLng(this._startLayerPoint),e.layerPointToLatLng(i));e.fitBounds(n),e.fire("boxzoomend",{boxZoomBounds:n})}},_onKeyDown:function(t){27===t.keyCode&&this._finish()}}),o.Map.addInitHook("addHandler","boxZoom",o.Map.BoxZoom),o.Map.mergeOptions({keyboard:!0,keyboardPanOffset:80,keyboardZoomOffset:1}),o.Map.Keyboard=o.Handler.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,173]},initialize:function(t){this._map=t,this._setPanOffset(t.options.keyboardPanOffset),this._setZoomOffset(t.options.keyboardZoomOffset)},addHooks:function(){var t=this._map._container;-1===t.tabIndex&&(t.tabIndex="0"),o.DomEvent.on(t,"focus",this._onFocus,this).on(t,"blur",this._onBlur,this).on(t,"mousedown",this._onMouseDown,this),this._map.on("focus",this._addHooks,this).on("blur",this._removeHooks,this)},removeHooks:function(){this._removeHooks();var t=this._map._container;o.DomEvent.off(t,"focus",this._onFocus,this).off(t,"blur",this._onBlur,this).off(t,"mousedown",this._onMouseDown,this),this._map.off("focus",this._addHooks,this).off("blur",this._removeHooks,this)},_onMouseDown:function(){if(!this._focused){var i=e.body,n=e.documentElement,o=i.scrollTop||n.scrollTop,s=i.scrollLeft||n.scrollLeft;this._map._container.focus(),t.scrollTo(s,o)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanOffset:function(t){var e,i,n=this._panKeys={},o=this.keyCodes;for(e=0,i=o.left.length;i>e;e++)n[o.left[e]]=[-1*t,0];for(e=0,i=o.right.length;i>e;e++)n[o.right[e]]=[t,0];for(e=0,i=o.down.length;i>e;e++)n[o.down[e]]=[0,t];for(e=0,i=o.up.length;i>e;e++)n[o.up[e]]=[0,-1*t]},_setZoomOffset:function(t){var e,i,n=this._zoomKeys={},o=this.keyCodes;for(e=0,i=o.zoomIn.length;i>e;e++)n[o.zoomIn[e]]=t;for(e=0,i=o.zoomOut.length;i>e;e++)n[o.zoomOut[e]]=-t},_addHooks:function(){o.DomEvent.on(e,"keydown",this._onKeyDown,this)},_removeHooks:function(){o.DomEvent.off(e,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){var e=t.keyCode,i=this._map;if(e in this._panKeys){if(i._panAnim&&i._panAnim._inProgress)return;i.panBy(this._panKeys[e]),i.options.maxBounds&&i.panInsideBounds(i.options.maxBounds)}else{if(!(e in this._zoomKeys))return;i.setZoom(i.getZoom()+this._zoomKeys[e])}o.DomEvent.stop(t)}}),o.Map.addInitHook("addHandler","keyboard",o.Map.Keyboard),o.Handler.MarkerDrag=o.Handler.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new o.Draggable(t,t)),this._draggable.on("dragstart",this._onDragStart,this).on("drag",this._onDrag,this).on("dragend",this._onDragEnd,this),this._draggable.enable(),o.DomUtil.addClass(this._marker._icon,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off("dragstart",this._onDragStart,this).off("drag",this._onDrag,this).off("dragend",this._onDragEnd,this),this._draggable.disable(),o.DomUtil.removeClass(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_onDragStart:function(){this._marker.closePopup().fire("movestart").fire("dragstart")},_onDrag:function(){var t=this._marker,e=t._shadow,i=o.DomUtil.getPosition(t._icon),n=t._map.layerPointToLatLng(i);e&&o.DomUtil.setPosition(e,i),t._latlng=n,t.fire("move",{latlng:n}).fire("drag")},_onDragEnd:function(t){this._marker.fire("moveend").fire("dragend",t)}}),o.Control=o.Class.extend({options:{position:"topright"},initialize:function(t){o.setOptions(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._map=t;var e=this._container=this.onAdd(t),i=this.getPosition(),n=t._controlCorners[i];return o.DomUtil.addClass(e,"leaflet-control"),-1!==i.indexOf("bottom")?n.insertBefore(e,n.firstChild):n.appendChild(e),this},removeFrom:function(t){var e=this.getPosition();return t._controlCorners[e].removeChild(this._container),this._map=null,this.onRemove&&this.onRemove(t),this},_refocusOnMap:function(){this._map&&this._map.getContainer().focus()}}),o.control=function(t){return new o.Control(t)},o.Map.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.removeFrom(this),this},_initControlPos:function(){function t(t,s){var a=i+t+" "+i+s;e[t+s]=o.DomUtil.create("div",a,n)}var e=this._controlCorners={},i="leaflet-",n=this._controlContainer=o.DomUtil.create("div",i+"control-container",this._container);t("top","left"),t("top","right"),t("bottom","left"),t("bottom","right")},_clearControlPos:function(){this._container.removeChild(this._controlContainer)}}),o.Control.Zoom=o.Control.extend({options:{position:"topleft",zoomInText:"+",zoomInTitle:"Zoom in",zoomOutText:"-",zoomOutTitle:"Zoom out"},onAdd:function(t){var e="leaflet-control-zoom",i=o.DomUtil.create("div",e+" leaflet-bar");return this._map=t,this._zoomInButton=this._createButton(this.options.zoomInText,this.options.zoomInTitle,e+"-in",i,this._zoomIn,this),this._zoomOutButton=this._createButton(this.options.zoomOutText,this.options.zoomOutTitle,e+"-out",i,this._zoomOut,this),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),i},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},_zoomIn:function(t){this._map.zoomIn(t.shiftKey?3:1)},_zoomOut:function(t){this._map.zoomOut(t.shiftKey?3:1)},_createButton:function(t,e,i,n,s,a){var r=o.DomUtil.create("a",i,n);r.innerHTML=t,r.href="#",r.title=e;var h=o.DomEvent.stopPropagation;return o.DomEvent.on(r,"click",h).on(r,"mousedown",h).on(r,"dblclick",h).on(r,"click",o.DomEvent.preventDefault).on(r,"click",s,a).on(r,"click",this._refocusOnMap,a),r},_updateDisabled:function(){var t=this._map,e="leaflet-disabled";o.DomUtil.removeClass(this._zoomInButton,e),o.DomUtil.removeClass(this._zoomOutButton,e),t._zoom===t.getMinZoom()&&o.DomUtil.addClass(this._zoomOutButton,e),t._zoom===t.getMaxZoom()&&o.DomUtil.addClass(this._zoomInButton,e)}}),o.Map.mergeOptions({zoomControl:!0}),o.Map.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new o.Control.Zoom,this.addControl(this.zoomControl))}),o.control.zoom=function(t){return new o.Control.Zoom(t)},o.Control.Attribution=o.Control.extend({options:{position:"bottomright",prefix:'Leaflet'},initialize:function(t){o.setOptions(this,t),this._attributions={}},onAdd:function(t){this._container=o.DomUtil.create("div","leaflet-control-attribution"),o.DomEvent.disableClickPropagation(this._container);for(var e in t._layers)t._layers[e].getAttribution&&this.addAttribution(t._layers[e].getAttribution());return t.on("layeradd",this._onLayerAdd,this).on("layerremove",this._onLayerRemove,this),this._update(),this._container},onRemove:function(t){t.off("layeradd",this._onLayerAdd).off("layerremove",this._onLayerRemove)},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):void 0},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):void 0},_update:function(){if(this._map){var t=[];for(var e in this._attributions)this._attributions[e]&&t.push(e);var i=[];this.options.prefix&&i.push(this.options.prefix),t.length&&i.push(t.join(", ")),this._container.innerHTML=i.join(" | ")}},_onLayerAdd:function(t){t.layer.getAttribution&&this.addAttribution(t.layer.getAttribution())},_onLayerRemove:function(t){t.layer.getAttribution&&this.removeAttribution(t.layer.getAttribution())}}),o.Map.mergeOptions({attributionControl:!0}),o.Map.addInitHook(function(){this.options.attributionControl&&(this.attributionControl=(new o.Control.Attribution).addTo(this))}),o.control.attribution=function(t){return new o.Control.Attribution(t)},o.Control.Scale=o.Control.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0,updateWhenIdle:!1},onAdd:function(t){this._map=t;var e="leaflet-control-scale",i=o.DomUtil.create("div",e),n=this.options;return this._addScales(n,e,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=o.DomUtil.create("div",e+"-line",i)),t.imperial&&(this._iScale=o.DomUtil.create("div",e+"-line",i))},_update:function(){var t=this._map.getBounds(),e=t.getCenter().lat,i=6378137*Math.PI*Math.cos(e*Math.PI/180),n=i*(t.getNorthEast().lng-t.getSouthWest().lng)/180,o=this._map.getSize(),s=this.options,a=0;o.x>0&&(a=n*(s.maxWidth/o.x)),this._updateScales(s,a)},_updateScales:function(t,e){t.metric&&e&&this._updateMetric(e),t.imperial&&e&&this._updateImperial(e)},_updateMetric:function(t){var e=this._getRoundNum(t);this._mScale.style.width=this._getScaleWidth(e/t)+"px",this._mScale.innerHTML=1e3>e?e+" m":e/1e3+" km"},_updateImperial:function(t){var e,i,n,o=3.2808399*t,s=this._iScale;o>5280?(e=o/5280,i=this._getRoundNum(e),s.style.width=this._getScaleWidth(i/e)+"px",s.innerHTML=i+" mi"):(n=this._getRoundNum(o),s.style.width=this._getScaleWidth(n/o)+"px",s.innerHTML=n+" ft")},_getScaleWidth:function(t){return Math.round(this.options.maxWidth*t)-10},_getRoundNum:function(t){var e=Math.pow(10,(Math.floor(t)+"").length-1),i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:1,e*i}}),o.control.scale=function(t){return new o.Control.Scale(t)},o.Control.Layers=o.Control.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0},initialize:function(t,e,i){o.setOptions(this,i),this._layers={},this._lastZIndex=0,this._handlingClick=!1;for(var n in t)this._addLayer(t[n],n);for(n in e)this._addLayer(e[n],n,!0)},onAdd:function(t){return this._initLayout(),this._update(),t.on("layeradd",this._onLayerChange,this).on("layerremove",this._onLayerChange,this),this._container},onRemove:function(t){t.off("layeradd",this._onLayerChange).off("layerremove",this._onLayerChange)},addBaseLayer:function(t,e){return this._addLayer(t,e),this._update(),this},addOverlay:function(t,e){return this._addLayer(t,e,!0), this._update(),this},removeLayer:function(t){var e=o.stamp(t);return delete this._layers[e],this._update(),this},_initLayout:function(){var t="leaflet-control-layers",e=this._container=o.DomUtil.create("div",t);e.setAttribute("aria-haspopup",!0),o.Browser.touch?o.DomEvent.on(e,"click",o.DomEvent.stopPropagation):o.DomEvent.disableClickPropagation(e).disableScrollPropagation(e);var i=this._form=o.DomUtil.create("form",t+"-list");if(this.options.collapsed){o.Browser.android||o.DomEvent.on(e,"mouseover",this._expand,this).on(e,"mouseout",this._collapse,this);var n=this._layersLink=o.DomUtil.create("a",t+"-toggle",e);n.href="#",n.title="Layers",o.Browser.touch?o.DomEvent.on(n,"click",o.DomEvent.stop).on(n,"click",this._expand,this):o.DomEvent.on(n,"focus",this._expand,this),o.DomEvent.on(i,"click",function(){setTimeout(o.bind(this._onInputClick,this),0)},this),this._map.on("click",this._collapse,this)}else this._expand();this._baseLayersList=o.DomUtil.create("div",t+"-base",i),this._separator=o.DomUtil.create("div",t+"-separator",i),this._overlaysList=o.DomUtil.create("div",t+"-overlays",i),e.appendChild(i)},_addLayer:function(t,e,i){var n=o.stamp(t);this._layers[n]={layer:t,name:e,overlay:i},this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex))},_update:function(){if(this._container){this._baseLayersList.innerHTML="",this._overlaysList.innerHTML="";var t,e,i=!1,n=!1;for(t in this._layers)e=this._layers[t],this._addItem(e),n=n||e.overlay,i=i||!e.overlay;this._separator.style.display=n&&i?"":"none"}},_onLayerChange:function(t){var e=this._layers[o.stamp(t.layer)];if(e){this._handlingClick||this._update();var i=e.overlay?"layeradd"===t.type?"overlayadd":"overlayremove":"layeradd"===t.type?"baselayerchange":null;i&&this._map.fire(i,e)}},_createRadioElement:function(t,i){var n='t;t++)e=n[t],i=this._layers[e.layerId],e.checked&&!this._map.hasLayer(i.layer)?this._map.addLayer(i.layer):!e.checked&&this._map.hasLayer(i.layer)&&this._map.removeLayer(i.layer);this._handlingClick=!1,this._refocusOnMap()},_expand:function(){o.DomUtil.addClass(this._container,"leaflet-control-layers-expanded")},_collapse:function(){this._container.className=this._container.className.replace(" leaflet-control-layers-expanded","")}}),o.control.layers=function(t,e,i){return new o.Control.Layers(t,e,i)},o.PosAnimation=o.Class.extend({includes:o.Mixin.Events,run:function(t,e,i,n){this.stop(),this._el=t,this._inProgress=!0,this._newPos=e,this.fire("start"),t.style[o.DomUtil.TRANSITION]="all "+(i||.25)+"s cubic-bezier(0,0,"+(n||.5)+",1)",o.DomEvent.on(t,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),o.DomUtil.setPosition(t,e),o.Util.falseFn(t.offsetWidth),this._stepTimer=setInterval(o.bind(this._onStep,this),50)},stop:function(){this._inProgress&&(o.DomUtil.setPosition(this._el,this._getPos()),this._onTransitionEnd(),o.Util.falseFn(this._el.offsetWidth))},_onStep:function(){var t=this._getPos();return t?(this._el._leaflet_pos=t,void this.fire("step")):void this._onTransitionEnd()},_transformRe:/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/,_getPos:function(){var e,i,n,s=this._el,a=t.getComputedStyle(s);if(o.Browser.any3d){if(!(n=a[o.DomUtil.TRANSFORM].match(this._transformRe)))return;e=parseFloat(n[1]),i=parseFloat(n[2])}else e=parseFloat(a.left),i=parseFloat(a.top);return new o.Point(e,i,!0)},_onTransitionEnd:function(){o.DomEvent.off(this._el,o.DomUtil.TRANSITION_END,this._onTransitionEnd,this),this._inProgress&&(this._inProgress=!1,this._el.style[o.DomUtil.TRANSITION]="",this._el._leaflet_pos=this._newPos,clearInterval(this._stepTimer),this.fire("step").fire("end"))}}),o.Map.include({setView:function(t,e,n){if(e=e===i?this._zoom:this._limitZoom(e),t=this._limitCenter(o.latLng(t),e,this.options.maxBounds),n=n||{},this._panAnim&&this._panAnim.stop(),this._loaded&&!n.reset&&!0!==n){n.animate!==i&&(n.zoom=o.extend({animate:n.animate},n.zoom),n.pan=o.extend({animate:n.animate},n.pan));if(this._zoom!==e?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,e,n.zoom):this._tryAnimatedPan(t,n.pan))return clearTimeout(this._sizeTimer),this}return this._resetView(t,e),this},panBy:function(t,e){if(t=o.point(t).round(),e=e||{},!t.x&&!t.y)return this;if(this._panAnim||(this._panAnim=new o.PosAnimation,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),e.noMoveStart||this.fire("movestart"),!1!==e.animate){o.DomUtil.addClass(this._mapPane,"leaflet-pan-anim");var i=this._getMapPanePos().subtract(t);this._panAnim.run(this._mapPane,i,e.duration||.25,e.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){o.DomUtil.removeClass(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,e){var i=this._getCenterOffset(t)._floor();return!(!0!==(e&&e.animate)&&!this.getSize().contains(i))&&(this.panBy(i,e),!0)}}),o.PosAnimation=o.DomUtil.TRANSITION?o.PosAnimation:o.PosAnimation.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=o.DomUtil.getPosition(t),this._offset=e.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(),this._complete())},_animate:function(){this._animId=o.Util.requestAnimFrame(this._animate,this),this._step()},_step:function(){var t=+new Date-this._startTime,e=1e3*this._duration;e>t?this._runFrame(this._easeOut(t/e)):(this._runFrame(1),this._complete())},_runFrame:function(t){var e=this._startPos.add(this._offset.multiplyBy(t));o.DomUtil.setPosition(this._el,e),this.fire("step")},_complete:function(){o.Util.cancelAnimFrame(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),o.Map.mergeOptions({zoomAnimation:!0,zoomAnimationThreshold:4}),o.DomUtil.TRANSITION&&o.Map.addInitHook(function(){this._zoomAnimated=this.options.zoomAnimation&&o.DomUtil.TRANSITION&&o.Browser.any3d&&!o.Browser.android23&&!o.Browser.mobileOpera,this._zoomAnimated&&o.DomEvent.on(this._mapPane,o.DomUtil.TRANSITION_END,this._catchTransitionEnd,this)}),o.Map.include(o.DomUtil.TRANSITION?{_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,e,i){if(this._animatingZoom)return!0;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),o=this._getCenterOffset(t)._divideBy(1-1/n),s=this._getCenterLayerPoint()._add(o);return!(!0!==i.animate&&!this.getSize().contains(o))&&(this.fire("movestart").fire("zoomstart"),this._animateZoom(t,e,s,n,null,!0),!0)},_animateZoom:function(t,e,i,n,s,a){this._animatingZoom=!0,o.DomUtil.addClass(this._mapPane,"leaflet-zoom-anim"),this._animateToCenter=t,this._animateToZoom=e,o.Draggable&&(o.Draggable._disabled=!0),this.fire("zoomanim",{center:t,zoom:e,origin:i,scale:n,delta:s,backwards:a})},_onZoomTransitionEnd:function(){this._animatingZoom=!1,o.DomUtil.removeClass(this._mapPane,"leaflet-zoom-anim"),this._resetView(this._animateToCenter,this._animateToZoom,!0,!0),o.Draggable&&(o.Draggable._disabled=!1)}}:{}),o.TileLayer.include({_animateZoom:function(t){this._animating||(this._animating=!0,this._prepareBgBuffer());var e=this._bgBuffer,i=o.DomUtil.TRANSFORM,n=t.delta?o.DomUtil.getTranslateString(t.delta):e.style[i],s=o.DomUtil.getScaleString(t.scale,t.origin);e.style[i]=t.backwards?s+" "+n:n+" "+s},_endZoomAnim:function(){var t=this._tileContainer,e=this._bgBuffer;t.style.visibility="",t.parentNode.appendChild(t),o.Util.falseFn(e.offsetWidth),this._animating=!1},_clearBgBuffer:function(){var t=this._map;!t||t._animatingZoom||t.touchZoom._zooming||(this._bgBuffer.innerHTML="",this._bgBuffer.style[o.DomUtil.TRANSFORM]="")},_prepareBgBuffer:function(){var t=this._tileContainer,e=this._bgBuffer,i=this._getLoadedTilesPercentage(e),n=this._getLoadedTilesPercentage(t);return e&&i>.5&&.5>n?(t.style.visibility="hidden",void this._stopLoadingImages(t)):(e.style.visibility="hidden",e.style[o.DomUtil.TRANSFORM]="",this._tileContainer=e,e=this._bgBuffer=t,this._stopLoadingImages(e),void clearTimeout(this._clearBgBufferTimer))},_getLoadedTilesPercentage:function(t){var e,i,n=t.getElementsByTagName("img"),o=0;for(e=0,i=n.length;i>e;e++)n[e].complete&&o++;return o/i},_stopLoadingImages:function(t){var e,i,n,s=Array.prototype.slice.call(t.getElementsByTagName("img"));for(e=0,i=s.length;i>e;e++)n=s[e],n.complete||(n.onload=o.Util.falseFn,n.onerror=o.Util.falseFn,n.src=o.Util.emptyImageUrl,n.parentNode.removeChild(n))}}),o.Map.include({_defaultLocateOptions:{watch:!1,setView:!1,maxZoom:1/0,timeout:1e4,maximumAge:0,enableHighAccuracy:!1},locate:function(t){if(t=this._locateOptions=o.extend(this._defaultLocateOptions,t),!navigator.geolocation)return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var e=o.bind(this._handleGeolocationResponse,this),i=o.bind(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(e,i,t):navigator.geolocation.getCurrentPosition(e,i,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){var e=t.code,i=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: "+i+"."})},_handleGeolocationResponse:function(t){var e=t.coords.latitude,i=t.coords.longitude,n=new o.LatLng(e,i),s=180*t.coords.accuracy/40075017,a=s/Math.cos(o.LatLng.DEG_TO_RAD*e),r=o.latLngBounds([e-s,i-a],[e+s,i+a]),h=this._locateOptions;if(h.setView){var l=Math.min(this.getBoundsZoom(r),h.maxZoom);this.setView(n,l)}var u={latlng:n,bounds:r,timestamp:t.timestamp};for(var c in t.coords)"number"==typeof t.coords[c]&&(u[c]=t.coords[c]);this.fire("locationfound",u)}})}(window,document),function(t,e,i){L.MarkerClusterGroup=L.FeatureGroup.extend({options:{maxClusterRadius:80,iconCreateFunction:null,spiderfyOnMaxZoom:!0,showCoverageOnHover:!0,zoomToBoundsOnClick:!0,singleMarkerMode:!1,disableClusteringAtZoom:8,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(t){L.Util.setOptions(this,t),this.options.iconCreateFunction||(this.options.iconCreateFunction=this._defaultIconCreateFunction),this._featureGroup=L.featureGroup(),this._featureGroup.on(L.FeatureGroup.EVENTS,this._propagateEvent,this),this._nonPointGroup=L.featureGroup(),this._nonPointGroup.on(L.FeatureGroup.EVENTS,this._propagateEvent,this),this._inZoomAnimation=0,this._needsClustering=[],this._needsRemoving=[],this._currentShownBounds=null,this._queue=[];var e=L.DomUtil.TRANSITION&&this.options.animate;L.extend(this,e?this._withAnimation:this._noAnimation),this._markerCluster=e?L.MarkerCluster:L.MarkerClusterNonAnimated},addLayer:function(t){if(t instanceof L.LayerGroup){var e=[];for(var i in t._layers)e.push(t._layers[i]);return this.addLayers(e)}if(!t.getLatLng)return this._nonPointGroup.addLayer(t),this;if(!this._map)return this._needsClustering.push(t),this;if(this.hasLayer(t))return this;this._unspiderfy&&this._unspiderfy(),this._addLayer(t,this._maxZoom),this._topClusterLevel._recalculateBounds();var n=t,s=this._map.getZoom();if(t.__parent)for(;n.__parent._zoom>=s;)n=n.__parent;return this._currentShownBounds.contains(n.getLatLng())&&(this.options.animateAddingMarkers?this._animationAddLayer(t,n):this._animationAddLayerNonAnimated(t,n)),this},removeLayer:function(t){if(t instanceof L.LayerGroup){var e=[];for(var i in t._layers)e.push(t._layers[i]);return this.removeLayers(e)}return t.getLatLng?this._map?t.__parent?(this._unspiderfy&&(this._unspiderfy(),this._unspiderfyLayer(t)),this._removeLayer(t,!0),this._topClusterLevel._recalculateBounds(),this._featureGroup.hasLayer(t)&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow()),this):this:(!this._arraySplice(this._needsClustering,t)&&this.hasLayer(t)&&this._needsRemoving.push(t),this):(this._nonPointGroup.removeLayer(t),this)},addLayers:function(t){var e,i,n,s,r=this._featureGroup,o=this._nonPointGroup,a=this.options.chunkedLoading,h=this.options.chunkInterval,u=this.options.chunkProgress;if(this._map){var _=0,l=(new Date).getTime(),d=L.bind(function(){for(var e=(new Date).getTime();_h)break}if(s=t[_],s.getLatLng){if(!this.hasLayer(s)&&(this._addLayer(s,this._maxZoom),s.__parent&&2===s.__parent.getChildCount())){var n=s.__parent.getAllChildMarkers(),c=n[0]===s?n[1]:n[0];r.removeLayer(c)}}else o.addLayer(s)}u&&u(_,t.length,(new Date).getTime()-l),_===t.length?(this._topClusterLevel._recalculateBounds(),this._featureGroup.eachLayer(function(t){t instanceof L.MarkerCluster&&t._iconNeedsUpdate&&t._updateIcon()}),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds)):setTimeout(d,this.options.chunkDelay)},this);d()}else{for(e=[],i=0,n=t.length;n>i;i++)s=t[i],s.getLatLng?this.hasLayer(s)||e.push(s):o.addLayer(s);this._needsClustering=this._needsClustering.concat(e)}return this},removeLayers:function(t){var e,i,n,s=this._featureGroup,r=this._nonPointGroup;if(!this._map){for(e=0,i=t.length;i>e;e++)n=t[e],this._arraySplice(this._needsClustering,n),r.removeLayer(n),this.hasLayer(n)&&this._needsRemoving.push(n);return this}if(this._unspiderfy)for(this._unspiderfy(),e=0,i=t.length;i>e;e++)n=t[e],this._unspiderfyLayer(n);for(e=0,i=t.length;i>e;e++)n=t[e],n.__parent?(this._removeLayer(n,!0,!0),s.hasLayer(n)&&(s.removeLayer(n),n.clusterShow&&n.clusterShow())):r.removeLayer(n);return this._topClusterLevel._recalculateBounds(),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._zoom,this._currentShownBounds),s.eachLayer(function(t){t instanceof L.MarkerCluster&&t._updateIcon()}),this},clearLayers:function(){return this._map||(this._needsClustering=[],delete this._gridClusters,delete this._gridUnclustered),this._noanimationUnspiderfy&&this._noanimationUnspiderfy(),this._featureGroup.clearLayers(),this._nonPointGroup.clearLayers(),this.eachLayer(function(t){delete t.__parent}),this._map&&this._generateInitialClusters(),this},getBounds:function(){var t=new L.LatLngBounds;this._topClusterLevel&&t.extend(this._topClusterLevel._bounds);for(var e=this._needsClustering.length-1;e>=0;e--)t.extend(this._needsClustering[e].getLatLng());return t.extend(this._nonPointGroup.getBounds()),t},eachLayer:function(t,e){var i,n=this._needsClustering.slice();for(this._topClusterLevel&&this._topClusterLevel.getAllChildMarkers(n),i=n.length-1;i>=0;i--)t.call(e,n[i]);this._nonPointGroup.eachLayer(t,e)},getLayers:function(){var t=[];return this.eachLayer(function(e){t.push(e)}),t},getLayer:function(t){var e=null;return t=parseInt(t,10),this.eachLayer(function(i){L.stamp(i)===t&&(e=i)}),e},hasLayer:function(t){if(!t)return!1;var e,i=this._needsClustering;for(e=i.length-1;e>=0;e--)if(i[e]===t)return!0;for(i=this._needsRemoving,e=i.length-1;e>=0;e--)if(i[e]===t)return!1;return!(!t.__parent||t.__parent._group!==this)||this._nonPointGroup.hasLayer(t)},zoomToShowLayer:function(t,e){"function"!=typeof e&&(e=function(){});var i=function(){!t._icon&&!t.__parent._icon||this._inZoomAnimation||(this._map.off("moveend",i,this),this.off("animationend",i,this),t._icon?e():t.__parent._icon&&(this.once("spiderfied",e,this),t.__parent.spiderfy()))};if(t._icon&&this._map.getBounds().contains(t.getLatLng()))e();else if(t.__parent._zoome;e++)n=this._needsRemoving[e],this._removeLayer(n,!0);this._needsRemoving=[],this._zoom=this._map.getZoom(),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)},onRemove:function(t){t.off("zoomend",this._zoomEnd,this),t.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.onRemove(t),this._nonPointGroup.onRemove(t),this._featureGroup.clearLayers(),this._map=null},getVisibleParent:function(t){for(var e=t;e&&!e._icon;)e=e.__parent;return e||null},_arraySplice:function(t,e){for(var i=t.length-1;i>=0;i--)if(t[i]===e)return t.splice(i,1),!0},_removeFromGridUnclustered:function(t,e){for(var i=this._map,n=this._gridUnclustered;e>=0&&n[e].removeObject(t,i.project(t.getLatLng(),e));e--);},_removeLayer:function(t,e,i){var n=this._gridClusters,s=this._gridUnclustered,r=this._featureGroup,o=this._map;e&&this._removeFromGridUnclustered(t,this._maxZoom);var a,h=t.__parent,u=h._markers;for(this._arraySplice(u,t);h&&(h._childCount--,h._boundsNeedUpdate=!0,!(h._zoom<0));)e&&h._childCount<=1?(a=h._markers[0]===t?h._markers[1]:h._markers[0],n[h._zoom].removeObject(h,o.project(h._cLatLng,h._zoom)),s[h._zoom].addObject(a,o.project(a.getLatLng(),h._zoom)),this._arraySplice(h.__parent._childClusters,h),h.__parent._markers.push(a),a.__parent=h.__parent,h._icon&&(r.removeLayer(h),i||r.addLayer(a))):i&&h._icon||h._updateIcon(),h=h.__parent;delete t.__parent},_isOrIsParent:function(t,e){for(;e;){if(t===e)return!0;e=e.parentNode}return!1},_propagateEvent:function(t){if(t.layer instanceof L.MarkerCluster){if(t.originalEvent&&this._isOrIsParent(t.layer._icon,t.originalEvent.relatedTarget))return;t.type="cluster"+t.type}this.fire(t.type,t)},_defaultIconCreateFunction:function(t){var e=t.getChildCount(),i=" marker-cluster-";return i+=10>e?"small":100>e?"medium":"large",new L.DivIcon({html:"
"+e+"
",className:"marker-cluster"+i,iconSize:new L.Point(40,40)})},_bindEvents:function(){var t=this._map,e=this.options.spiderfyOnMaxZoom,i=this.options.showCoverageOnHover,n=this.options.zoomToBoundsOnClick;(e||n)&&this.on("clusterclick",this._zoomOrSpiderfy,this),i&&(this.on("clustermouseover",this._showCoverage,this),this.on("clustermouseout",this._hideCoverage,this),t.on("zoomend",this._hideCoverage,this))},_zoomOrSpiderfy:function(t){for(var e=t.layer,i=e;1===i._childClusters.length;)i=i._childClusters[0];i._zoom===this._maxZoom&&i._childCount===e._childCount?this.options.spiderfyOnMaxZoom&&e.spiderfy():this.options.zoomToBoundsOnClick&&e.zoomToBounds(),t.originalEvent&&13===t.originalEvent.keyCode&&this._map._container.focus()},_showCoverage:function(t){var e=this._map;this._inZoomAnimation||(this._shownPolygon&&e.removeLayer(this._shownPolygon),t.layer.getChildCount()>2&&t.layer!==this._spiderfied&&(this._shownPolygon=new L.Polygon(t.layer.getConvexHull(),this.options.polygonOptions),e.addLayer(this._shownPolygon)))},_hideCoverage:function(){this._shownPolygon&&(this._map.removeLayer(this._shownPolygon),this._shownPolygon=null)},_unbindEvents:function(){var t=this.options.spiderfyOnMaxZoom,e=this.options.showCoverageOnHover,i=this.options.zoomToBoundsOnClick,n=this._map;(t||i)&&this.off("clusterclick",this._zoomOrSpiderfy,this),e&&(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=this._map._zoom,this._currentShownBounds=this._getExpandedVisibleBounds())},_moveEnd:function(){if(!this._inZoomAnimation){var t=this._getExpandedVisibleBounds();this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,this._zoom,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,this._map._zoom,t),this._currentShownBounds=t}},_generateInitialClusters:function(){var t=this._map.getMaxZoom(),e=this.options.maxClusterRadius,i=e;"function"!=typeof e&&(i=function(){return e}),this.options.disableClusteringAtZoom&&(t=this.options.disableClusteringAtZoom-1),this._maxZoom=t,this._gridClusters={},this._gridUnclustered={};for(var n=t;n>=0;n--)this._gridClusters[n]=new L.DistanceGrid(i(n)),this._gridUnclustered[n]=new L.DistanceGrid(i(n));this._topClusterLevel=new this._markerCluster(this,-1)},_addLayer:function(t,e){var i,n,s=this._gridClusters,r=this._gridUnclustered;for(this.options.singleMarkerMode&&this._overrideMarkerIcon(t);e>=0;e--){i=this._map.project(t.getLatLng(),e);var o=s[e].getNearObject(i);if(o)return o._addChild(t),void(t.__parent=o);if(o=r[e].getNearObject(i)){var a=o.__parent;a&&this._removeLayer(o,!1);var h=new this._markerCluster(this,e,o,t);s[e].addObject(h,this._map.project(h._cLatLng,e)),o.__parent=h,t.__parent=h;var u=h;for(n=e-1;n>a._zoom;n--)u=new this._markerCluster(this,n,u),s[n].addObject(u,this._map.project(o.getLatLng(),n));return a._addChild(u),void this._removeFromGridUnclustered(o,e)}r[e].addObject(t,i)}this._topClusterLevel._addChild(t),t.__parent=this._topClusterLevel},_enqueue:function(t){this._queue.push(t),this._queueTimeout||(this._queueTimeout=setTimeout(L.bind(this._processQueue,this),300))},_processQueue:function(){for(var t=0;tthis._map._zoom?(this._animationStart(),this._animationZoomOut(this._zoom,this._map._zoom)):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(t){var e=this._maxLat;return e!==i&&(t.getNorth()>=e&&(t._northEast.lat=1/0),t.getSouth()<=-e&&(t._southWest.lat=-1/0)),t},_animationAddLayerNonAnimated:function(t,e){if(e===t)this._featureGroup.addLayer(t);else if(2===e._childCount){e._addToMap();var i=e.getAllChildMarkers();this._featureGroup.removeLayer(i[0]),this._featureGroup.removeLayer(i[1])}else e._updateIcon()},_overrideMarkerIcon:function(t){return t.options.icon=this.options.iconCreateFunction({getChildCount:function(){return 1},getAllChildMarkers:function(){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(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationZoomOut:function(t,e){this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,t),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this.fire("animationend")},_animationAddLayer:function(t,e){this._animationAddLayerNonAnimated(t,e)}},_withAnimation:{_animationStart:function(){this._map._mapPane.className+=" leaflet-cluster-anim",this._inZoomAnimation++},_animationZoomIn:function(t,e){var i,n=this._getExpandedVisibleBounds(),s=this._featureGroup;this._topClusterLevel._recursively(n,t,0,function(r){var o,a=r._latlng,h=r._markers;for(n.contains(a)||(a=null),r._isSingleParent()&&t+1===e?(s.removeLayer(r),r._recursivelyAddChildrenToMap(null,e,n)):(r.clusterHide(),r._recursivelyAddChildrenToMap(a,e,n)),i=h.length-1;i>=0;i--)o=h[i],n.contains(o._latlng)||s.removeLayer(o)}),this._forceLayout(),this._topClusterLevel._recursivelyBecomeVisible(n,e),s.eachLayer(function(t){t instanceof L.MarkerCluster||!t._icon||t.clusterShow()}),this._topClusterLevel._recursively(n,t,e,function(t){t._recursivelyRestoreChildPositions(e)}),this._enqueue(function(){this._topClusterLevel._recursively(n,t,0,function(t){s.removeLayer(t),t.clusterShow()}),this._animationEnd()})},_animationZoomOut:function(t,e){this._animationZoomOutSingle(this._topClusterLevel,t-1,e),this._topClusterLevel._recursivelyAddChildrenToMap(null,e,this._getExpandedVisibleBounds()),this._topClusterLevel._recursivelyRemoveChildrenFromMap(this._currentShownBounds,t,this._getExpandedVisibleBounds())},_animationAddLayer:function(t,e){var i=this,n=this._featureGroup;n.addLayer(t),e!==t&&(e._childCount>2?(e._updateIcon(),this._forceLayout(),this._animationStart(),t._setPos(this._map.latLngToLayerPoint(e.getLatLng())),t.clusterHide(),this._enqueue(function(){n.removeLayer(t),t.clusterShow(),i._animationEnd()})):(this._forceLayout(),i._animationStart(),i._animationZoomOutSingle(e,this._map.getMaxZoom(),this._map.getZoom())))}},_animationZoomOutSingle:function(t,e,i){var n=this._getExpandedVisibleBounds();t._recursivelyAnimateChildrenInAndAddSelfToMap(n,e+1,i);var s=this;this._forceLayout(),t._recursivelyBecomeVisible(n,i),this._enqueue(function(){if(1===t._childCount){var r=t._markers[0];r.setLatLng(r.getLatLng()),r.clusterShow&&r.clusterShow()}else t._recursively(n,i,0,function(t){t._recursivelyRemoveChildrenFromMap(n,e+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(e.body.offsetWidth)}}),L.markerClusterGroup=function(t){return new L.MarkerClusterGroup(t)},L.MarkerCluster=L.Marker.extend({initialize:function(t,e,i,n){L.Marker.prototype.initialize.call(this,i?i._cLatLng||i.getLatLng():new L.LatLng(0,0),{icon:this}),this._group=t,this._zoom=e,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(t){t=t||[];for(var e=this._childClusters.length-1;e>=0;e--)this._childClusters[e].getAllChildMarkers(t);for(var i=this._markers.length-1;i>=0;i--)t.push(this._markers[i]);return t},getChildCount:function(){return this._childCount},zoomToBounds:function(){for(var t,e=this._childClusters.slice(),i=this._group._map,n=i.getBoundsZoom(this._bounds),s=this._zoom+1,r=i.getZoom();e.length>0&&n>s;){s++;var o=[];for(t=0;ts?this._group._map.setView(this._latlng,s):r>=n?this._group._map.setView(this._latlng,r+1):this._group._map.fitBounds(this._bounds)},getBounds:function(){var t=new L.LatLngBounds;return t.extend(this._bounds),t},_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(t,e){this._iconNeedsUpdate=!0,this._boundsNeedUpdate=!0,this._setClusterCenter(t),t instanceof L.MarkerCluster?(e||(this._childClusters.push(t),t.__parent=this),this._childCount+=t._childCount):(e||this._markers.push(t),this._childCount++),this.__parent&&this.__parent._addChild(t,!0)},_setClusterCenter:function(t){this._cLatLng||(this._cLatLng=t._cLatLng||t._latlng)},_resetBounds:function(){var t=this._bounds;t._southWest&&(t._southWest.lat=1/0,t._southWest.lng=1/0),t._northEast&&(t._northEast.lat=-1/0,t._northEast.lng=-1/0)},_recalculateBounds:function(){var t,e,i,n,s=this._markers,r=this._childClusters,o=0,a=0,h=this._childCount;if(0!==h){for(this._resetBounds(),t=0;t=0;i--)n=s[i],n._icon&&(n._setPos(e),n.clusterHide())},function(t){var i,n,s=t._childClusters;for(i=s.length-1;i>=0;i--)n=s[i],n._icon&&(n._setPos(e),n.clusterHide())})},_recursivelyAnimateChildrenInAndAddSelfToMap:function(t,e,i){this._recursively(t,i,0,function(n){n._recursivelyAnimateChildrenIn(t,n._group._map.latLngToLayerPoint(n.getLatLng()).round(),e),n._isSingleParent()&&e-1===i?(n.clusterShow(),n._recursivelyRemoveChildrenFromMap(t,e)):n.clusterHide(),n._addToMap()})},_recursivelyBecomeVisible:function(t,e){this._recursively(t,0,e,null,function(t){t.clusterShow()})},_recursivelyAddChildrenToMap:function(t,e,i){this._recursively(i,-1,e,function(n){if(e!==n._zoom)for(var s=n._markers.length-1;s>=0;s--){var r=n._markers[s];i.contains(r._latlng)&&(t&&(r._backupLatlng=r.getLatLng(),r.setLatLng(t),r.clusterHide&&r.clusterHide()),n._group._featureGroup.addLayer(r))}},function(e){e._addToMap(t)})},_recursivelyRestoreChildPositions:function(t){for(var e=this._markers.length-1;e>=0;e--){var i=this._markers[e];i._backupLatlng&&(i.setLatLng(i._backupLatlng),delete i._backupLatlng)}if(t-1===this._zoom)for(var n=this._childClusters.length-1;n>=0;n--)this._childClusters[n]._restorePosition();else for(var s=this._childClusters.length-1;s>=0;s--)this._childClusters[s]._recursivelyRestoreChildPositions(t)},_restorePosition:function(){this._backupLatlng&&(this.setLatLng(this._backupLatlng),delete this._backupLatlng)},_recursivelyRemoveChildrenFromMap:function(t,e,i){var n,s;this._recursively(t,-1,e-1,function(t){for(s=t._markers.length-1;s>=0;s--)n=t._markers[s],i&&i.contains(n._latlng)||(t._group._featureGroup.removeLayer(n),n.clusterShow&&n.clusterShow())},function(t){for(s=t._childClusters.length-1;s>=0;s--)n=t._childClusters[s],i&&i.contains(n._latlng)||(t._group._featureGroup.removeLayer(n), n.clusterShow&&n.clusterShow())})},_recursively:function(t,e,i,n,s){var r,o,a=this._childClusters,h=this._zoom;if(e>h)for(r=a.length-1;r>=0;r--)o=a[r],t.intersects(o._bounds)&&o._recursively(t,e,i,n,s);else if(n&&n(this),s&&this._zoom===i&&s(this),i>h)for(r=a.length-1;r>=0;r--)o=a[r],t.intersects(o._bounds)&&o._recursively(t,e,i,n,s)},_isSingleParent:function(){return this._childClusters.length>0&&this._childClusters[0]._childCount===this._childCount}}),L.Marker.include({clusterHide:function(){return this.options.opacityWhenUnclustered=this.options.opacity||1,this.setOpacity(0)},clusterShow:function(){var t=this.setOpacity(this.options.opacity||this.options.opacityWhenUnclustered);return delete this.options.opacityWhenUnclustered,t}}),L.DistanceGrid=function(t){this._cellSize=t,this._sqCellSize=t*t,this._grid={},this._objectPoint={}},L.DistanceGrid.prototype={addObject:function(t,e){var i=this._getCoord(e.x),n=this._getCoord(e.y),s=this._grid,r=s[n]=s[n]||{},o=r[i]=r[i]||[],a=L.Util.stamp(t);this._objectPoint[a]=e,o.push(t)},updateObject:function(t,e){this.removeObject(t),this.addObject(t,e)},removeObject:function(t,e){var i,n,s=this._getCoord(e.x),r=this._getCoord(e.y),o=this._grid,a=o[r]=o[r]||{},h=a[s]=a[s]||[];for(delete this._objectPoint[L.Util.stamp(t)],i=0,n=h.length;n>i;i++)if(h[i]===t)return h.splice(i,1),1===n&&delete a[s],!0},eachObject:function(t,e){var i,n,s,r,o,a,u=this._grid;for(i in u){o=u[i];for(n in o)for(a=o[n],s=0,r=a.length;r>s;s++)t.call(e,a[s])&&(s--,r--)}},getNearObject:function(t){var e,i,n,s,r,o,a,h,u=this._getCoord(t.x),_=this._getCoord(t.y),l=this._objectPoint,d=this._sqCellSize,c=null;for(e=_-1;_+1>=e;e++)if(s=this._grid[e])for(i=u-1;u+1>=i;i++)if(r=s[i])for(n=0,o=r.length;o>n;n++)a=r[n],h=this._sqDist(l[L.Util.stamp(a)],t),d>h&&(d=h,c=a);return c},_getCoord:function(t){return Math.floor(t/this._cellSize)},_sqDist:function(t,e){var i=e.x-t.x,n=e.y-t.y;return i*i+n*n}},function(){L.QuickHull={getDistant:function(t,e){var i=e[1].lat-e[0].lat;return(e[0].lng-e[1].lng)*(t.lat-e[0].lat)+i*(t.lng-e[0].lng)},findMostDistantPointFromBaseLine:function(t,e){var i,n,s,r=0,o=null,a=[];for(i=e.length-1;i>=0;i--)n=e[i],(s=this.getDistant(n,t))>0&&(a.push(n),s>r&&(r=s,o=n));return{maxPoint:o,newPoints:a}},buildConvexHull:function(t,e){var i=[],n=this.findMostDistantPointFromBaseLine(t,e);return n.maxPoint?(i=i.concat(this.buildConvexHull([t[0],n.maxPoint],n.newPoints)),i=i.concat(this.buildConvexHull([n.maxPoint,t[1]],n.newPoints))):[t[0]]},getConvexHull:function(t){var e,i=!1,n=!1,s=!1,r=!1,o=null,a=null,h=null,u=null,_=null,l=null;for(e=t.length-1;e>=0;e--){var d=t[e];(!1===i||d.lat>i)&&(o=d,i=d.lat),(!1===n||d.lats)&&(h=d,s=d.lng),(!1===r||d.lng=0;e--)t=i[e].getLatLng(),n.push(t);return L.QuickHull.getConvexHull(n)}}),L.MarkerCluster.include({_2PI:2*Math.PI,_circleFootSeparation:25,_circleStartAngle:Math.PI/6,_spiralFootSeparation:28,_spiralLengthStart:11,_spiralLengthFactor:5,_circleSpiralSwitchover:9,spiderfy:function(){if(this._group._spiderfied!==this&&!this._group._inZoomAnimation){var t,e=this.getAllChildMarkers(),i=this._group,n=i._map,s=n.latLngToLayerPoint(this._latlng);this._group._unspiderfy(),this._group._spiderfied=this,e.length>=this._circleSpiralSwitchover?t=this._generatePointsSpiral(e.length,s):(s.y+=10,t=this._generatePointsCircle(e.length,s)),this._animationSpiderfy(e,t)}},unspiderfy:function(t){this._group._inZoomAnimation||(this._animationUnspiderfy(t),this._group._spiderfied=null)},_generatePointsCircle:function(t,e){var i,n,s=this._group.options.spiderfyDistanceMultiplier*this._circleFootSeparation*(2+t),r=s/this._2PI,o=this._2PI/t,a=[];for(a.length=t,i=t-1;i>=0;i--)n=this._circleStartAngle+i*o,a[i]=new L.Point(e.x+r*Math.cos(n),e.y+r*Math.sin(n))._round();return a},_generatePointsSpiral:function(t,e){var i,n=this._group.options.spiderfyDistanceMultiplier,s=n*this._spiralLengthStart,r=n*this._spiralFootSeparation,o=n*this._spiralLengthFactor*this._2PI,a=0,h=[];for(h.length=t,i=t-1;i>=0;i--)a+=r/s+5e-4*i,h[i]=new L.Point(e.x+s*Math.cos(a),e.y+s*Math.sin(a))._round(),s+=o/a;return h},_noanimationUnspiderfy:function(){var t,e,i=this._group,n=i._map,s=i._featureGroup,r=this.getAllChildMarkers();for(this.setOpacity(1),e=r.length-1;e>=0;e--)t=r[e],s.removeLayer(t),t._preSpiderfyLatlng&&(t.setLatLng(t._preSpiderfyLatlng),delete t._preSpiderfyLatlng),t.setZIndexOffset&&t.setZIndexOffset(0),t._spiderLeg&&(n.removeLayer(t._spiderLeg),delete t._spiderLeg);i.fire("unspiderfied",{cluster:this,markers:r}),i._spiderfied=null}}),L.MarkerClusterNonAnimated=L.MarkerCluster.extend({_animationSpiderfy:function(t,e){var i,n,s,r,o=this._group,a=o._map,h=o._featureGroup,u=this._group.options.spiderLegPolylineOptions;for(i=0;i=0;n--)h=l.layerPointToLatLng(e[n]),s=t[n],s._preSpiderfyLatlng=s._latlng,s.setLatLng(h),s.clusterShow&&s.clusterShow(),f&&(r=s._spiderLeg,o=r._path,o.style.strokeDashoffset=0,r.setStyle({opacity:g}));this.setOpacity(.3),setTimeout(function(){_._animationEnd(),_.fire("spiderfied",{cluster:u,markers:t})},200)},_animationUnspiderfy:function(t){var e,i,n,s,r,o,a=this,h=this._group,u=h._map,_=h._featureGroup,l=t?u._latLngToNewLayerPoint(this._latlng,t.zoom,t.center):u.latLngToLayerPoint(this._latlng),d=this.getAllChildMarkers(),c=L.Path.SVG;for(h._animationStart(),this.setOpacity(1),i=d.length-1;i>=0;i--)e=d[i],e._preSpiderfyLatlng&&(e.setLatLng(e._preSpiderfyLatlng),delete e._preSpiderfyLatlng,o=!0,e._setPos&&(e._setPos(l),o=!1),e.clusterHide&&(e.clusterHide(),o=!1),o&&_.removeLayer(e),c&&(n=e._spiderLeg,s=n._path,r=s.getTotalLength()+.1,s.style.strokeDashoffset=r,n.setStyle({opacity:0})));setTimeout(function(){var t=0;for(i=d.length-1;i>=0;i--)e=d[i],e._spiderLeg&&t++;for(i=d.length-1;i>=0;i--)e=d[i],e._spiderLeg&&(e.clusterShow&&e.clusterShow(),e.setZIndexOffset&&e.setZIndexOffset(0),t>1&&_.removeLayer(e),u.removeLayer(e._spiderLeg),delete e._spiderLeg);h._animationEnd(),h.fire("unspiderfied",{cluster:a,markers:d})},200)}}),L.MarkerClusterGroup.include({_spiderfied:null,_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)},_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()},_unspiderfyZoomStart:function(){this._map&&this._map.on("zoomanim",this._unspiderfyZoomAnim,this)},_unspiderfyZoomAnim:function(t){L.DomUtil.hasClass(this._map._mapPane,"leaflet-touching")||(this._map.off("zoomanim",this._unspiderfyZoomAnim,this),this._unspiderfy(t))},_unspiderfyWrapper:function(){this._unspiderfy()},_unspiderfy:function(t){this._spiderfied&&this._spiderfied.unspiderfy(t)},_noanimationUnspiderfy:function(){this._spiderfied&&this._spiderfied._noanimationUnspiderfy()},_unspiderfyLayer:function(t){t._spiderLeg&&(this._featureGroup.removeLayer(t),t.clusterShow&&t.clusterShow(),t.setZIndexOffset&&t.setZIndexOffset(0),this._map.removeLayer(t._spiderLeg),delete t._spiderLeg)}}),L.MarkerClusterGroup.include({refreshClusters:function(t){return t?t instanceof L.MarkerClusterGroup?t=t._topClusterLevel.getAllChildMarkers():t instanceof L.LayerGroup?t=t._layers:t instanceof L.MarkerCluster?t=t.getAllChildMarkers():t instanceof L.Marker&&(t=[t]):t=this._topClusterLevel.getAllChildMarkers(),this._flagParentsIconsNeedUpdate(t),this._refreshClustersIcons(),this.options.singleMarkerMode&&this._refreshSingleMarkerModeMarkers(t),this},_flagParentsIconsNeedUpdate:function(t){var e,i;for(e in t)for(i=t[e].__parent;i;)i._iconNeedsUpdate=!0,i=i.__parent},_refreshClustersIcons:function(){this._featureGroup.eachLayer(function(t){t instanceof L.MarkerCluster&&t._iconNeedsUpdate&&t._updateIcon()})},_refreshSingleMarkerModeMarkers:function(t){var e,i;for(e in t)i=t[e],this.hasLayer(i)&&i.setIcon(this._overrideMarkerIcon(i))}}),L.Marker.include({refreshIconOptions:function(t,e){var i=this.options.icon;return L.setOptions(i,t),this.setIcon(i),e&&this.__parent&&this.__parent._group.refreshClusters(this),this}})}(window,document),function(angular){"use strict";!function(angular){angular.module("leaflet-directive",[]).directive("leaflet",["$q","leafletData","leafletMapDefaults","leafletHelpers","leafletMapEvents",function(a,b,c,d,e){return{restrict:"EA",replace:!0,scope:{center:"=",lfCenter:"=",defaults:"=",maxbounds:"=",bounds:"=",markers:"=",legend:"=",geojson:"=",paths:"=",tiles:"=",layers:"=",controls:"=",decorations:"=",eventBroadcast:"=",markersWatchOptions:"=",geojsonWatchOptions:"="},transclude:!0,template:'
',controller:["$scope",function(b){this._leafletMap=a.defer(),this.getMap=function(){return this._leafletMap.promise},this.getLeafletScope=function(){return b}}],link:function(a,f,g,h){function i(){isNaN(g.width)?f.css("width",g.width):f.css("width",g.width+"px")}function j(){isNaN(g.height)?f.css("height",g.height):f.css("height",g.height+"px")}var k=d.isDefined,l=c.setDefaults(a.defaults,g.id),m=e.getAvailableMapEvents(),n=e.addEvents;a.mapId=g.id,b.setDirectiveControls({},g.id),k(g.width)&&(i(),a.$watch(function(){return f[0].getAttribute("width")},function(){i(),o.invalidateSize()})),k(g.height)&&(j(),a.$watch(function(){return f[0].getAttribute("height")},function(){j(),o.invalidateSize()}));var o=new L.Map(f[0],c.getMapCreationDefaults(g.id));if(h._leafletMap.resolve(o),k(g.center)||k(g.lfCenter)||o.setView([l.center.lat,l.center.lng],l.center.zoom),!k(g.tiles)&&!k(g.layers)){var p=L.tileLayer(l.tileLayer,l.tileLayerOptions);p.addTo(o),b.setTiles(p,g.id)}if(k(o.zoomControl)&&k(l.zoomControlPosition)&&o.zoomControl.setPosition(l.zoomControlPosition),k(o.zoomControl)&&!1===l.zoomControl&&o.zoomControl.removeFrom(o),k(o.zoomsliderControl)&&k(l.zoomsliderControl)&&!1===l.zoomsliderControl&&o.zoomsliderControl.removeFrom(o),!k(g.eventBroadcast)){n(o,m,"eventName",a,"broadcast")}o.whenReady(function(){b.setMap(o,g.id)}),a.$on("$destroy",function(){c.reset(),o.remove(),b.unresolveMap(g.id)}),a.$on("invalidateSize",function(){o.invalidateSize()})}}}]),angular.module("leaflet-directive").factory("leafletBoundsHelpers",["$log","leafletHelpers",function(a,b){function c(a){return angular.isDefined(a)&&angular.isDefined(a.southWest)&&angular.isDefined(a.northEast)&&angular.isNumber(a.southWest.lat)&&angular.isNumber(a.southWest.lng)&&angular.isNumber(a.northEast.lat)&&angular.isNumber(a.northEast.lng)}var d=b.isArray,e=b.isNumber,f=b.isFunction,g=b.isDefined;return{createLeafletBounds:function(a){return c(a)?L.latLngBounds([a.southWest.lat,a.southWest.lng],[a.northEast.lat,a.northEast.lng]):void 0},isValidBounds:c,createBoundsFromArray:function(b){return d(b)&&2===b.length&&d(b[0])&&d(b[1])&&2===b[0].length&&2===b[1].length&&e(b[0][0])&&e(b[0][1])&&e(b[1][0])&&e(b[1][1])?{northEast:{lat:b[0][0],lng:b[0][1]},southWest:{lat:b[1][0],lng:b[1][1]}}:void a.error("[AngularJS - Leaflet] The bounds array is not valid.")},createBoundsFromLeaflet:function(b){if(!(g(b)&&f(b.getNorthEast)&&f(b.getSouthWest)))return void a.error("[AngularJS - Leaflet] The leaflet bounds is not valid object.");var c=b.getNorthEast(),d=b.getSouthWest();return{northEast:{lat:c.lat,lng:c.lng},southWest:{lat:d.lat,lng:d.lng}}}}}]),angular.module("leaflet-directive").factory("leafletControlHelpers",["$rootScope","$log","leafletHelpers","leafletLayerHelpers","leafletMapDefaults",function(a,b,c,d,e){var f=c.isDefined,g=c.isObject,h=d.createLayer,i={},j=c.errorHeader+" [Controls] ",k=function(a,b,c){if(!e.getDefaults(c).controls.layers.visible)return!1;var h=!1;return g(a)&&Object.keys(a).forEach(function(b){var c=a[b];f(c.layerOptions)&&!1===c.layerOptions.showOnSelector||(h=!0)}),g(b)&&Object.keys(b).forEach(function(a){var c=b[a];f(c.layerParams)&&!1===c.layerParams.showOnSelector||(h=!0)}),h},l=function(a){var b=e.getDefaults(a),c={collapsed:b.controls.layers.collapsed,position:b.controls.layers.position,autoZIndex:!1};angular.extend(c,b.controls.layers.options);return b.controls.layers&&f(b.controls.layers.control)?b.controls.layers.control.apply(this,[[],[],c]):new L.control.layers([],[],c)},m={draw:{isPluginLoaded:function(){return!!angular.isDefined(L.Control.Draw)||(b.error(j+" Draw plugin is not loaded."),!1)},checkValidParams:function(){return!0},createControl:function(a){return new L.Control.Draw(a)}},scale:{isPluginLoaded:function(){return!0},checkValidParams:function(){return!0},createControl:function(a){return new L.control.scale(a)}},fullscreen:{isPluginLoaded:function(){return!!angular.isDefined(L.Control.Fullscreen)||(b.error(j+" Fullscreen plugin is not loaded."),!1)},checkValidParams:function(){return!0},createControl:function(a){return new L.Control.Fullscreen(a)}},search:{isPluginLoaded:function(){return!!angular.isDefined(L.Control.Search)||(b.error(j+" Search plugin is not loaded."),!1)},checkValidParams:function(){return!0},createControl:function(a){return new L.Control.Search(a)}},custom:{},minimap:{isPluginLoaded:function(){return!!angular.isDefined(L.Control.MiniMap)||(b.error(j+" Minimap plugin is not loaded."),!1)},checkValidParams:function(a){return!!f(a.layer)||(b.warn(j+' minimap "layer" option should be defined.'),!1)},createControl:function(a){var c=h(a.layer);return f(c)?new L.Control.MiniMap(c,a):void b.warn(j+' minimap control "layer" could not be created.')}}};return{layersControlMustBeVisible:k,isValidControlType:function(a){return-1!==Object.keys(m).indexOf(a)},createControl:function(a,b){return m[a].checkValidParams(b)?m[a].createControl(b):void 0},updateLayersControl:function(a,b,c,d,e,g){var h,j=i[b],m=k(d,e,b);if(f(j)&&c){for(h in g.baselayers)j.removeLayer(g.baselayers[h]);for(h in g.overlays)j.removeLayer(g.overlays[h]);a.removeControl(j),delete i[b]}if(m){j=l(b),i[b]=j;for(h in d){!(f(d[h].layerOptions)&&!1===d[h].layerOptions.showOnSelector)&&f(g.baselayers[h])&&j.addBaseLayer(g.baselayers[h],d[h].name)}for(h in e){!(f(e[h].layerParams)&&!1===e[h].layerParams.showOnSelector)&&f(g.overlays[h])&&j.addOverlay(g.overlays[h],e[h].name)}a.addControl(j)}return m}}}]),angular.module("leaflet-directive").service("leafletData",["$log","$q","leafletHelpers",function(a,b,c){var d=c.getDefer,e=c.getUnresolvedDefer,f=c.setResolvedDefer,g={},h=this,i=function(a){return a.charAt(0).toUpperCase()+a.slice(1)},j=["map","tiles","layers","paths","markers","geoJSON","UTFGrid","decorations","directiveControls"];j.forEach(function(a){g[a]={}}),this.unresolveMap=function(a){var b=c.obtainEffectiveMapId(g.map,a);j.forEach(function(a){g[a][b]=void 0})},j.forEach(function(a){var b=i(a);h["set"+b]=function(b,c){e(g[a],c).resolve(b),f(g[a],c)},h["get"+b]=function(b){return d(g[a],b).promise}})}]),angular.module("leaflet-directive").service("leafletDirectiveControlsHelpers",["$log","leafletData","leafletHelpers",function(a,b,c){var d=c.isDefined,e=c.isString,f=c.isObject,g=c.errorHeader,h=g+"[leafletDirectiveControlsHelpers";return{extend:function(c,g,i,j){var k=h+".extend] ",l={};if(!d(g))return void a.error(k+"thingToAddName cannot be undefined");if(e(g)&&d(i)&&d(j))l[g]={create:i,clean:j};else{if(!f(g)||d(i)||d(j))return void a.error(k+"incorrect arguments");l=g}b.getDirectiveControls().then(function(a){angular.extend(a,l),b.setDirectiveControls(a,c)})}}}]),angular.module("leaflet-directive").service("leafletGeoJsonHelpers",["leafletHelpers","leafletIterators",function(a,b){var c=a,d=b,e=function(a,b){return this.lat=a,this.lng=b,this},f=function(a){return Array.isArray(a)&&2===a.length?a[1]:c.isDefined(a.type)&&"Point"===a.type?+a.coordinates[1]:+a.lat},g=function(a){return Array.isArray(a)&&2===a.length?a[0]:c.isDefined(a.type)&&"Point"===a.type?+a.coordinates[0]:+a.lng},h=function(a){if(c.isUndefined(a))return!1;if(c.isArray(a)){if(2===a.length&&c.isNumber(a[0])&&c.isNumber(a[1]))return!0}else if(c.isDefined(a.type)&&"Point"===a.type&&c.isArray(a.coordinates)&&2===a.coordinates.length&&c.isNumber(a.coordinates[0])&&c.isNumber(a.coordinates[1]))return!0;return d.all(["lat","lng"],function(b){return c.isDefined(a[b])&&c.isNumber(a[b])})};return{getLat:f,getLng:g,validateCoords:h,getCoords:function(a){if(a&&h(a)){var b=null;if(Array.isArray(a)&&2===a.length)b=new e(a[1],a[0]);else{if(!c.isDefined(a.type)||"Point"!==a.type)return a;b=new e(a.coordinates[1],a.coordinates[0])}return angular.extend(a,b)}}}}]),angular.module("leaflet-directive").service("leafletHelpers",["$q","$log",function(a,b){function c(a,c){var d,f;if(angular.isDefined(c))d=c;else if(0===Object.keys(a).length)d="main";else if(Object.keys(a).length>=1)for(f in a)a.hasOwnProperty(f)&&(d=f);else b.error(e+"- You have more than 1 map on the DOM, you must provide the map ID to the leafletData.getXXX call");return d}function d(b,d){var e,f=c(b,d);return angular.isDefined(b[f])&&!0!==b[f].resolvedDefer?e=b[f].defer:(e=a.defer(),b[f]={defer:e,resolvedDefer:!1}),e}var e="[AngularJS - Leaflet] ",f=angular.copy,g=f,h=function(a,b){var c;if(a&&angular.isObject(a))return null!==b&&angular.isString(b)?(c=a,b.split(".").forEach(function(a){c&&(c=c[a])}),c):b},i=function(a){return a.split(".").reduce(function(a,b){return a+'["'+b+'"]'})},j=function(a){return a.reduce(function(a,b){return a+"."+b})},k=function(a){return angular.isDefined(a)&&null!==a},l=function(a){return!k(a)},m=/([\:\-\_]+(.))/g,n=/^moz([A-Z])/,o=/^((?:x|data)[\:\-_])/i,p=function(a){return a.replace(m,function(a,b,c,d){return d?c.toUpperCase():c}).replace(n,"Moz$1")};return{camelCase:p,directiveNormalize:function(a){return p(a.replace(o,""))},copy:f,clone:g,errorHeader:e,getObjectValue:h,getObjectArrayPath:i,getObjectDotPath:j,defaultTo:function(a,b){return k(a)?a:b},isTruthy:function(a){return"true"===a||!0===a},isEmpty:function(a){return 0===Object.keys(a).length},isUndefinedOrEmpty:function(a){return angular.isUndefined(a)||null===a||0===Object.keys(a).length},isDefined:k,isUndefined:l,isNumber:angular.isNumber,isString:angular.isString,isArray:angular.isArray,isObject:angular.isObject,isFunction:angular.isFunction,equals:angular.equals,isValidCenter:function(a){return angular.isDefined(a)&&angular.isNumber(a.lat)&&angular.isNumber(a.lng)&&angular.isNumber(a.zoom)},isValidPoint:function(a){return!!angular.isDefined(a)&&(angular.isArray(a)?2===a.length&&angular.isNumber(a[0])&&angular.isNumber(a[1]):angular.isNumber(a.lat)&&angular.isNumber(a.lng))},isSameCenterOnMap:function(a,b){var c=b.getCenter(),d=b.getZoom();return!(!a.lat||!a.lng||c.lat.toFixed(4)!==a.lat.toFixed(4)||c.lng.toFixed(4)!==a.lng.toFixed(4)||d!==a.zoom)},safeApply:function(a,b){var c=a.$root.$$phase;"$apply"===c||"$digest"===c?a.$eval(b):a.$evalAsync(b)},obtainEffectiveMapId:c,getDefer:function(a,b){var f=c(a,b);return angular.isDefined(a[f])&&!1!==a[f].resolvedDefer?a[f].defer:d(a,b)},getUnresolvedDefer:d,setResolvedDefer:function(a,b){a[c(a,b)].resolvedDefer=!0},rangeIsSupported:function(){var a=document.createElement("input");return a.setAttribute("type","range"),"range"===a.type},FullScreenControlPlugin:{isLoaded:function(){return angular.isDefined(L.Control.Fullscreen)}},MiniMapControlPlugin:{isLoaded:function(){return angular.isDefined(L.Control.MiniMap)}},AwesomeMarkersPlugin:{isLoaded:function(){return angular.isDefined(L.AwesomeMarkers)&&angular.isDefined(L.AwesomeMarkers.Icon)},is:function(a){return!!this.isLoaded()&&a instanceof L.AwesomeMarkers.Icon},equal:function(a,b){return!(!this.isLoaded()||!this.is(a))&&angular.equals(a,b)}},VectorMarkersPlugin:{isLoaded:function(){return angular.isDefined(L.VectorMarkers)&&angular.isDefined(L.VectorMarkers.Icon)},is:function(a){return!!this.isLoaded()&&a instanceof L.VectorMarkers.Icon},equal:function(a,b){return!(!this.isLoaded()||!this.is(a))&&angular.equals(a,b)}},DomMarkersPlugin:{isLoaded:function(){return!(!angular.isDefined(L.DomMarkers)||!angular.isDefined(L.DomMarkers.Icon))},is:function(a){return!!this.isLoaded()&&a instanceof L.DomMarkers.Icon},equal:function(a,b){return!(!this.isLoaded()||!this.is(a))&&angular.equals(a,b)}},PolylineDecoratorPlugin:{isLoaded:function(){return!!angular.isDefined(L.PolylineDecorator)},is:function(a){return!!this.isLoaded()&&a instanceof L.PolylineDecorator},equal:function(a,b){return!(!this.isLoaded()||!this.is(a))&&angular.equals(a,b)}},MakiMarkersPlugin:{isLoaded:function(){return!(!angular.isDefined(L.MakiMarkers)||!angular.isDefined(L.MakiMarkers.Icon))},is:function(a){return!!this.isLoaded()&&a instanceof L.MakiMarkers.Icon},equal:function(a,b){return!(!this.isLoaded()||!this.is(a))&&angular.equals(a,b)}},ExtraMarkersPlugin:{isLoaded:function(){return!(!angular.isDefined(L.ExtraMarkers)||!angular.isDefined(L.ExtraMarkers.Icon))},is:function(a){return!!this.isLoaded()&&a instanceof L.ExtraMarkers.Icon},equal:function(a,b){return!(!this.isLoaded()||!this.is(a))&&angular.equals(a,b)}},LabelPlugin:{isLoaded:function(){return angular.isDefined(L.Label)},is:function(a){return!!this.isLoaded()&&a instanceof L.MarkerClusterGroup}},MarkerClusterPlugin:{isLoaded:function(){return angular.isDefined(L.MarkerClusterGroup)},is:function(a){return!!this.isLoaded()&&a instanceof L.MarkerClusterGroup}},GoogleLayerPlugin:{isLoaded:function(){return angular.isDefined(L.Google)},is:function(a){return!!this.isLoaded()&&a instanceof L.Google}},LeafletProviderPlugin:{isLoaded:function(){return angular.isDefined(L.TileLayer.Provider)},is:function(a){return!!this.isLoaded()&&a instanceof L.TileLayer.Provider}},ChinaLayerPlugin:{isLoaded:function(){return angular.isDefined(L.tileLayer.chinaProvider)}},HeatLayerPlugin:{isLoaded:function(){return angular.isDefined(L.heatLayer)}},WebGLHeatMapLayerPlugin:{isLoaded:function(){return angular.isDefined(L.TileLayer.WebGLHeatMap)}},BingLayerPlugin:{isLoaded:function(){return angular.isDefined(L.BingLayer)},is:function(a){return!!this.isLoaded()&&a instanceof L.BingLayer}},WFSLayerPlugin:{isLoaded:function(){return void 0!==L.GeoJSON.WFS},is:function(a){return!!this.isLoaded()&&a instanceof L.GeoJSON.WFS}},AGSBaseLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.basemapLayer},is:function(a){return!!this.isLoaded()&&a instanceof L.esri.basemapLayer}},AGSLayerPlugin:{isLoaded:function(){return void 0!==lvector&&void 0!==lvector.AGS},is:function(a){return!!this.isLoaded()&&a instanceof lvector.AGS}},AGSFeatureLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.featureLayer},is:function(a){return!!this.isLoaded()&&a instanceof L.esri.featureLayer}},AGSTiledMapLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.tiledMapLayer},is:function(a){return!!this.isLoaded()&&a instanceof L.esri.tiledMapLayer}},AGSDynamicMapLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.dynamicMapLayer},is:function(a){return!!this.isLoaded()&&a instanceof L.esri.dynamicMapLayer}},AGSImageMapLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.imageMapLayer},is:function(a){return!!this.isLoaded()&&a instanceof L.esri.imageMapLayer}},AGSClusteredLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.clusteredFeatureLayer},is:function(a){return!!this.isLoaded()&&a instanceof L.esri.clusteredFeatureLayer}},AGSHeatmapLayerPlugin:{isLoaded:function(){return void 0!==L.esri&&void 0!==L.esri.heatmapFeatureLayer},is:function(a){return!!this.isLoaded()&&a instanceof L.esri.heatmapFeatureLayer}},YandexLayerPlugin:{isLoaded:function(){return angular.isDefined(L.Yandex)},is:function(a){return!!this.isLoaded()&&a instanceof L.Yandex}},GeoJSONPlugin:{isLoaded:function(){return angular.isDefined(L.TileLayer.GeoJSON)},is:function(a){return!!this.isLoaded()&&a instanceof L.TileLayer.GeoJSON}},UTFGridPlugin:{isLoaded:function(){return angular.isDefined(L.UtfGrid)},is:function(a){return this.isLoaded()?a instanceof L.UtfGrid:(b.error("[AngularJS - Leaflet] No UtfGrid plugin found."),!1)}},CartoDB:{isLoaded:function(){return cartodb},is:function(){return!0}},Leaflet:{DivIcon:{is:function(a){return a instanceof L.DivIcon},equal:function(a,b){return!!this.is(a)&&angular.equals(a,b)}},Icon:{is:function(a){return a instanceof L.Icon},equal:function(a,b){return!!this.is(a)&&angular.equals(a,b)}}},watchOptions:{doWatch:!0,isDeep:!0,individual:{doWatch:!0,isDeep:!0}}}}]),angular.module("leaflet-directive").service("leafletIterators",["$log","leafletHelpers",function(a,b){var c,d=b,e=b.errorHeader+"leafletIterators: ",f=Object.keys,g=d.isFunction,h=d.isObject,i=Math.pow(2,53)-1,j=function(a){var b=null!==a&&a.length;return d.isNumber(b)&&b>=0&&i>=b},k=function(a){return a},l=function(a){return function(b){return null===b?void 0:b[a]}},m=function(a,b,c){if(void 0===b)return a;switch(null===c?3:c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)}}return function(){return a.apply(b,arguments)}};c=function(a,b){return function(c){var d=arguments.length;if(2>d||null===c)return c;for(var e=1;d>e;e++)for(var f=arguments[e],g=a(f),h=g.length,i=0;h>i;i++){var j=g[i];b&&void 0!==c[j]||(c[j]=f[j])}return c}}(f);var p,q=function(a,b){var c=f(b),d=c.length;if(null===a)return!d;for(var e=Object(a),g=0;d>g;g++){var h=c[g];if(b[h]!==e[h]||!(h in e))return!1}return!0};p=function(a){return a=c({},a),function(b){return q(b,a)}};var s,t=function(a,b,c){return null===a?k:g(a)?m(a,b,c):h(a)?p(a):l(a)},u=null;s=u=function(a,b,c){b=t(b,c);for(var d=!j(a)&&f(a),e=(d||a).length,g=0;e>g;g++){var h=d?d[g]:g;if(!b(a[h],h,a))return!1}return!0};var v=function(b,c,f,g){return!(f||d.isDefined(b)&&d.isDefined(c))||!d.isFunction(c)&&(g=d.defaultTo(c,"cb"),a.error(e+g+" is not a function"),!0)},w=function(a,b,c){if(!v(void 0,c,!0,"internalCb")&&!v(a,b))for(var d in a)a.hasOwnProperty(d)&&c(a[d],d)},x=function(a,b){w(a,b,function(a,c){b(a,c)})};return{each:x,forEach:x,every:s,all:u}}]),angular.module("leaflet-directive").factory("leafletLayerHelpers",["$rootScope","$log","$q","leafletHelpers","leafletIterators",function($rootScope,$log,$q,leafletHelpers,leafletIterators){function isValidLayerType(a){return isString(a.type)?-1===Object.keys(layerTypes).indexOf(a.type)?($log.error("[AngularJS - Leaflet] A layer must have a valid type: "+Object.keys(layerTypes)),!1):layerTypes[a.type].mustHaveUrl&&!isString(a.url)?($log.error("[AngularJS - Leaflet] A base layer must have an url"),!1):layerTypes[a.type].mustHaveData&&!isDefined(a.data)?($log.error('[AngularJS - Leaflet] The base layer must have a "data" array attribute'),!1):layerTypes[a.type].mustHaveLayer&&!isDefined(a.layer)?($log.error("[AngularJS - Leaflet] The type of layer "+a.type+" must have an layer defined"),!1):layerTypes[a.type].mustHaveBounds&&!isDefined(a.bounds)?($log.error("[AngularJS - Leaflet] The type of layer "+a.type+" must have bounds defined"),!1):!(layerTypes[a.type].mustHaveKey&&!isDefined(a.key))||($log.error("[AngularJS - Leaflet] The type of layer "+a.type+" must have key defined"),!1):($log.error("[AngularJS - Leaflet] A layer must have a valid type defined."),!1)}function createLayer(a){if(isValidLayerType(a)){if(!isString(a.name))return void $log.error("[AngularJS - Leaflet] A base layer must have a name");isObject(a.layerParams)||(a.layerParams={}),isObject(a.layerOptions)||(a.layerOptions={});for(var b in a.layerParams)a.layerOptions[b]=a.layerParams[b];var c={url:a.url,data:a.data,options:a.layerOptions,layer:a.layer,icon:a.icon,type:a.layerType,bounds:a.bounds,key:a.key,apiKey:a.apiKey,pluginOptions:a.pluginOptions,user:a.user};return layerTypes[a.type].createLayer(c)}}function safeAddLayer(a,b){b&&"function"==typeof b.addTo?b.addTo(a):a.addLayer(b)}function safeRemoveLayer(a,b,c){if(isDefined(c)&&isDefined(c.loadedDefer))if(angular.isFunction(c.loadedDefer)){var d=c.loadedDefer();$log.debug("Loaded Deferred",d);var e=d.length;if(e>0)for(var f=function(){0===--e&&a.removeLayer(b)},g=0;g'+b.error.message+"
";else if("arcgis"===c)for(var e=0;e'+f.layerName+"";for(var g=0;g
'+h.label+"
"}}else"image"===c&&(a.innerHTML='')};return{getOnAddLegend:function(b,c,d,e){return function(){var f=L.DomUtil.create("div",c);return L.Browser.touch?L.DomEvent.on(f,"click",L.DomEvent.stopPropagation):(L.DomEvent.disableClickPropagation(f),L.DomEvent.on(f,"mousewheel",L.DomEvent.stopPropagation)),a(f,b,d,e),f}},getOnAddArrayLegend:function(a,b){return function(){for(var c=L.DomUtil.create("div",b),d=0;d
'+a.labels[d]+"
";return L.Browser.touch?L.DomEvent.on(c,"click",L.DomEvent.stopPropagation):(L.DomEvent.disableClickPropagation(c),L.DomEvent.on(c,"mousewheel",L.DomEvent.stopPropagation)),c}},updateLegend:a}}),angular.module("leaflet-directive").factory("leafletMapDefaults",["$q","leafletHelpers",function(a,b){function c(){return{keyboard:!0,dragging:!0,worldCopyJump:!1,doubleClickZoom:!0,scrollWheelZoom:!0,tap:!0,touchZoom:!0,zoomControl:!0,zoomsliderControl:!1,zoomControlPosition:"topleft",attributionControl:!0,controls:{layers:{visible:!0,position:"topright",collapsed:!0}},nominatim:{server:" http://nominatim.openstreetmap.org/search"},crs:L.CRS.EPSG3857,tileLayer:"//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",tileLayerOptions:{attribution:'© OpenStreetMap contributors'},path:{weight:10,opacity:1,color:"#0000ff"},center:{lat:0,lng:0,zoom:1}}}var d=b.isDefined,e=b.isObject,f=b.obtainEffectiveMapId,g={};return{reset:function(){g={}},getDefaults:function(a){var b=f(g,a);return g[b]},getMapCreationDefaults:function(a){var b=f(g,a),c=g[b],e={maxZoom:c.maxZoom,keyboard:c.keyboard,dragging:c.dragging,zoomControl:c.zoomControl,doubleClickZoom:c.doubleClickZoom,scrollWheelZoom:c.scrollWheelZoom,tap:c.tap,touchZoom:c.touchZoom,attributionControl:c.attributionControl,worldCopyJump:c.worldCopyJump,crs:c.crs};if(d(c.minZoom)&&(e.minZoom=c.minZoom),d(c.zoomAnimation)&&(e.zoomAnimation=c.zoomAnimation),d(c.fadeAnimation)&&(e.fadeAnimation=c.fadeAnimation),d(c.markerZoomAnimation)&&(e.markerZoomAnimation=c.markerZoomAnimation),c.map)for(var h in c.map)e[h]=c.map[h];return e},setDefaults:function(a,b){var h=c();d(a)&&(h.doubleClickZoom=d(a.doubleClickZoom)?a.doubleClickZoom:h.doubleClickZoom,h.scrollWheelZoom=d(a.scrollWheelZoom)?a.scrollWheelZoom:h.doubleClickZoom,h.tap=d(a.tap)?a.tap:h.tap,h.touchZoom=d(a.touchZoom)?a.touchZoom:h.doubleClickZoom,h.zoomControl=d(a.zoomControl)?a.zoomControl:h.zoomControl,h.zoomsliderControl=d(a.zoomsliderControl)?a.zoomsliderControl:h.zoomsliderControl,h.attributionControl=d(a.attributionControl)?a.attributionControl:h.attributionControl,h.tileLayer=d(a.tileLayer)?a.tileLayer:h.tileLayer,h.zoomControlPosition=d(a.zoomControlPosition)?a.zoomControlPosition:h.zoomControlPosition,h.keyboard=d(a.keyboard)?a.keyboard:h.keyboard,h.dragging=d(a.dragging)?a.dragging:h.dragging,d(a.controls)&&angular.extend(h.controls,a.controls),e(a.crs)?h.crs=a.crs:d(L.CRS[a.crs])&&(h.crs=L.CRS[a.crs]),d(a.center)&&angular.copy(a.center,h.center),d(a.tileLayerOptions)&&angular.copy(a.tileLayerOptions,h.tileLayerOptions),d(a.maxZoom)&&(h.maxZoom=a.maxZoom),d(a.minZoom)&&(h.minZoom=a.minZoom),d(a.zoomAnimation)&&(h.zoomAnimation=a.zoomAnimation),d(a.fadeAnimation)&&(h.fadeAnimation=a.fadeAnimation),d(a.markerZoomAnimation)&&(h.markerZoomAnimation=a.markerZoomAnimation),d(a.worldCopyJump)&&(h.worldCopyJump=a.worldCopyJump),d(a.map)&&(h.map=a.map),d(a.path)&&(h.path=a.path));var i=f(g,b);return g[i]=h,h}}}]),angular.module("leaflet-directive").service("leafletMarkersHelpers",["$rootScope","$timeout","leafletHelpers","$log","$compile","leafletGeoJsonHelpers",function(a,b,c,d,e,f){var g=c.isDefined,h=c.defaultTo,i=c.MarkerClusterPlugin,j=c.AwesomeMarkersPlugin,k=c.VectorMarkersPlugin,l=c.MakiMarkersPlugin,m=c.ExtraMarkersPlugin,n=c.DomMarkersPlugin,o=c.safeApply,p=c,q=c.isString,r=c.isNumber,s=c.isObject,t={},u=f,v=c.errorHeader,w=function(a){var b="";return["_icon","_latlng","_leaflet_id","_map","_shadow"].forEach(function(c){b+=c+": "+h(a[c],"undefined")+" \n"}),"[leafletMarker] : \n"+b},x=function(a,b){(b?console:d).debug(w(a))},y=function(b){if(g(b)&&g(b.type)&&"awesomeMarker"===b.type)return j.isLoaded()||d.error(v+" The AwesomeMarkers Plugin is not loaded."),new L.AwesomeMarkers.icon(b);if(g(b)&&g(b.type)&&"vectorMarker"===b.type)return k.isLoaded()||d.error(v+" The VectorMarkers Plugin is not loaded."),new L.VectorMarkers.icon(b);if(g(b)&&g(b.type)&&"makiMarker"===b.type)return l.isLoaded()||d.error(v+"The MakiMarkers Plugin is not loaded."),new L.MakiMarkers.icon(b);if(g(b)&&g(b.type)&&"extraMarker"===b.type)return m.isLoaded()||d.error(v+"The ExtraMarkers Plugin is not loaded."),new L.ExtraMarkers.icon(b);if(g(b)&&g(b.type)&&"div"===b.type)return new L.divIcon(b);if(g(b)&&g(b.type)&&"dom"===b.type){n.isLoaded()||d.error(v+"The DomMarkers Plugin is not loaded.");var c=angular.isFunction(b.getMarkerScope)?b.getMarkerScope():a,f=e(b.template)(c),h=angular.copy(b);return h.element=f[0],new L.DomMarkers.icon(h)}if(g(b)&&g(b.type)&&"icon"===b.type)return b.icon;return g(b)&&g(b.iconUrl)?new L.Icon(b):new L.Icon.Default({iconUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAGmklEQVRYw7VXeUyTZxjvNnfELFuyIzOabermMZEeQC/OclkO49CpOHXOLJl/CAURuYbQi3KLgEhbrhZ1aDwmaoGqKII6odATmH/scDFbdC7LvFqOCc+e95s2VG50X/LLm/f4/Z7neY/ne18aANCmAr5E/xZf1uDOkTcGcWR6hl9247tT5U7Y6SNvWsKT63P58qbfeLJG8M5qcgTknrvvrdDbsT7Ml+tv82X6vVxJE33aRmgSyYtcWVMqX97Yv2JvW39UhRE2HuyBL+t+gK1116ly06EeWFNlAmHxlQE0OMiV6mQCScusKRlhS3QLeVJdl1+23h5dY4FNB3thrbYboqptEFlphTC1hSpJnbRvxP4NWgsE5Jyz86QNNi/5qSUTGuFk1gu54tN9wuK2wc3o+Wc13RCmsoBwEqzGcZsxsvCSy/9wJKf7UWf1mEY8JWfewc67UUoDbDjQC+FqK4QqLVMGGR9d2wurKzqBk3nqIT/9zLxRRjgZ9bqQgub+DdoeCC03Q8j+0QhFhBHR/eP3U/zCln7Uu+hihJ1+bBNffLIvmkyP0gpBZWYXhKussK6mBz5HT6M1Nqpcp+mBCPXosYQfrekGvrjewd59/GvKCE7TbK/04/ZV5QZYVWmDwH1mF3xa2Q3ra3DBC5vBT1oP7PTj4C0+CcL8c7C2CtejqhuCnuIQHaKHzvcRfZpnylFfXsYJx3pNLwhKzRAwAhEqG0SpusBHfAKkxw3w4627MPhoCH798z7s0ZnBJ/MEJbZSbXPhER2ih7p2ok/zSj2cEJDd4CAe+5WYnBCgR2uruyEw6zRoW6/DWJ/OeAP8pd/BGtzOZKpG8oke0SX6GMmRk6GFlyAc59K32OTEinILRJRchah8HQwND8N435Z9Z0FY1EqtxUg+0SO6RJ/mmXz4VuS+DpxXC3gXmZwIL7dBSH4zKE50wESf8qwVgrP1EIlTO5JP9Igu0aexdh28F1lmAEGJGfh7jE6ElyM5Rw/FDcYJjWhbeiBYoYNIpc2FT/SILivp0F1ipDWk4BIEo2VuodEJUifhbiltnNBIXPUFCMpthtAyqws/BPlEF/VbaIxErdxPphsU7rcCp8DohC+GvBIPJS/tW2jtvTmmAeuNO8BNOYQeG8G/2OzCJ3q+soYB5i6NhMaKr17FSal7GIHheuV3uSCY8qYVuEm1cOzqdWr7ku/R0BDoTT+DT+ohCM6/CCvKLKO4RI+dXPeAuaMqksaKrZ7L3FE5FIFbkIceeOZ2OcHO6wIhTkNo0ffgjRGxEqogXHYUPHfWAC/lADpwGcLRY3aeK4/oRGCKYcZXPVoeX/kelVYY8dUGf8V5EBRbgJXT5QIPhP9ePJi428JKOiEYhYXFBqou2Guh+p/mEB1/RfMw6rY7cxcjTrneI1FrDyuzUSRm9miwEJx8E/gUmqlyvHGkneiwErR21F3tNOK5Tf0yXaT+O7DgCvALTUBXdM4YhC/IawPU+2PduqMvuaR6eoxSwUk75ggqsYJ7VicsnwGIkZBSXKOUww73WGXyqP+J2/b9c+gi1YAg/xpwck3gJuucNrh5JvDPvQr0WFXf0piyt8f8/WI0hV4pRxxkQZdJDfDJNOAmM0Ag8jyT6hz0WGXWuP94Yh2jcfjmXAGvHCMslRimDHYuHuDsy2QtHuIavznhbYURq5R57KpzBBRZKPJi8eQg48h4j8SDdowifdIrEVdU+gbO6QNvRRt4ZBthUaZhUnjlYObNagV3keoeru3rU7rcuceqU1mJBxy+BWZYlNEBH+0eH4vRiB+OYybU2hnblYlTvkHinM4m54YnxSyaZYSF6R3jwgP7udKLGIX6r/lbNa9N6y5MFynjWDtrHd75ZvTYAPO/6RgF0k76mQla3FGq7dO+cH8sKn0Vo7nDllwAhqwLPkxrHwWmHJOo+AKJ4rab5OgrM7rVu8eWb2Pu0Dh4eDgXoOfvp7Y7QeqknRmvcTBEyq9m/HQQSCSz6LHq3z0yzsNySRfMS253wl2KyRDbcZPcfJKjZmSEOjcxyi+Y8dUOtsIEH6R2wNykdqrkYJ0RV92H0W58pkfQk7cKevsLK10Py8SdMGfXNXATY+pPbyJR/ET6n9nIfztNtZYRV9XniQu9IA2vOVgy4ir7GCLVmmd+zjkH0eAF9Po6K61pmCXHxU5rHMYd1ftc3owjwRSVRzLjKvqZEty6cRUD7jGqiOdu5HG6MdHjNcNYGqfDm5YRzLBBCCDl/2bk8a8gdbqcfwECu62Fg/HrggAAAABJRU5ErkJggg==",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAYAAACoYAD2AAAC5ElEQVRYw+2YW4/TMBCF45S0S1luXZCABy5CgLQgwf//S4BYBLTdJLax0fFqmB07nnQfEGqkIydpVH85M+NLjPe++dcPc4Q8Qh4hj5D/AaQJx6H/4TMwB0PeBNwU7EGQAmAtsNfAzoZkgIa0ZgLMa4Aj6CxIAsjhjOCoL5z7Glg1JAOkaicgvQBXuncwJAWjksLtBTWZe04CnYRktUGdilALppZBOgHGZcBzL6OClABvMSVIzyBjazOgrvACf1ydC5mguqAVg6RhdkSWQFj2uxfaq/BrIZOLEWgZdALIDvcMcZLD8ZbLC9de4yR1sYMi4G20S4Q/PWeJYxTOZn5zJXANZHIxAd4JWhPIloTJZhzMQduM89WQ3MUVAE/RnhAXpTycqys3NZALOBbB7kFrgLesQl2h45Fcj8L1tTSohUwuxhy8H/Qg6K7gIs+3kkaigQCOcyEXCHN07wyQazhrmIulvKMQAwMcmLNqyCVyMAI+BuxSMeTk3OPikLY2J1uE+VHQk6ANrhds+tNARqBeaGc72cK550FP4WhXmFmcMGhTwAR1ifOe3EvPqIegFmF+C8gVy0OfAaWQPMR7gF1OQKqGoBjq90HPMP01BUjPOqGFksC4emE48tWQAH0YmvOgF3DST6xieJgHAWxPAHMuNhrImIdvoNOKNWIOcE+UXE0pYAnkX6uhWsgVXDxHdTfCmrEEmMB2zMFimLVOtiiajxiGWrbU52EeCdyOwPEQD8LqyPH9Ti2kgYMf4OhSKB7qYILbBv3CuVTJ11Y80oaseiMWOONc/Y7kJYe0xL2f0BaiFTxknHO5HaMGMublKwxFGzYdWsBF174H/QDknhTHmHHN39iWFnkZx8lPyM8WHfYELmlLKtgWNmFNzQcC1b47gJ4hL19i7o65dhH0Negbca8vONZoP7doIeOC9zXm8RjuL0Gf4d4OYaU5ljo3GYiqzrWQHfJxA6ALhDpVKv9qYeZA8eM3EhfPSCmpuD0AAAAASUVORK5CYII=",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],shadowSize:[41,41]})},z=function(a){g(t[a])&&t.splice(a,1)},A=function(){t={}},B=function(a,b,c){if(a.closePopup(),g(c)&&g(c.overlays))for(var d in c.overlays)if((c.overlays[d]instanceof L.LayerGroup||c.overlays[d]instanceof L.FeatureGroup)&&c.overlays[d].hasLayer(a))return void c.overlays[d].removeLayer(a);if(g(t))for(var e in t)t[e].hasLayer(a)&&t[e].removeLayer(a);b.hasLayer(a)&&b.removeLayer(a)},C=function(a,b){var c=a._popup._container.offsetHeight,d=new L.Point(a._popup._containerLeft,-c-a._popup._containerBottom);null!==b.layerPointToContainerPoint(d)&&a._popup._adjustPan()},D=function(a,b){e(a._popup._contentNode)(b)},E=function(a,c,d){(a._popup._contentNode.innerText||a._popup._contentNode.textContent).length<1&&b(function(){E(a,c,d)});var f=a._popup._contentNode.offsetWidth;return a._popup._updateLayout(),a._popup._updatePosition(),a._popup.options.autoPan&&C(a,d),f},F=function(b,c,e){var f=angular.isFunction(c.getMessageScope)?c.getMessageScope():a;if(!g(c.compileMessage)||c.compileMessage){if(!g(b._popup)||!g(b._popup._contentNode))return d.error(v+"Popup is invalid or does not have any content."),!1;D(b,f),E(b,c,e)}},G=function(b,c){var d=angular.isFunction(c.getMessageScope)?c.getMessageScope():a,f=angular.isFunction(c.getLabelScope)?c.getLabelScope():d,h=!g(c.compileMessage)||c.compileMessage;p.LabelPlugin.isLoaded()&&g(c.label)&&(g(c.label.options)&&!0===c.label.options.noHide&&b.showLabel(),h&&g(b.label)&&e(b.label._container)(f))},H=function(a,b,c,e,f,h,i){if(g(b)){if(!u.validateCoords(a))return d.warn("There are problems with lat-lng data, please verify your marker model"),void B(c,i,h);var j=a===b;if(g(a.iconAngle)&&b.iconAngle!==a.iconAngle&&c.setIconAngle(a.iconAngle),q(a.layer)||q(b.layer)&&(g(h.overlays[b.layer])&&h.overlays[b.layer].hasLayer(c)&&(h.overlays[b.layer].removeLayer(c),c.closePopup()),i.hasLayer(c)||i.addLayer(c)),(r(a.opacity)||r(parseFloat(a.opacity)))&&a.opacity!==b.opacity&&c.setOpacity(a.opacity),q(a.layer)&&b.layer!==a.layer){if(q(b.layer)&&g(h.overlays[b.layer])&&h.overlays[b.layer].hasLayer(c)&&h.overlays[b.layer].removeLayer(c),c.closePopup(),i.hasLayer(c)&&i.removeLayer(c),!g(h.overlays[a.layer]))return void d.error(v+"You must use a name of an existing layer");var k=h.overlays[a.layer];if(!(k instanceof L.LayerGroup||k instanceof L.FeatureGroup))return void d.error(v+'A marker can only be added to a layer of type "group" or "featureGroup"');k.addLayer(c),i.hasLayer(c)&&!0===a.focus&&c.openPopup()}if(!0!==a.draggable&&!0===b.draggable&&g(c.dragging)&&c.dragging.disable(),!0===a.draggable&&!0!==b.draggable&&(c.dragging?c.dragging.enable():L.Handler.MarkerDrag&&(c.dragging=new L.Handler.MarkerDrag(c),c.options.draggable=!0,c.dragging.enable())),s(a.icon)||s(b.icon)&&(c.setIcon(y()),c.closePopup(),c.unbindPopup(),q(a.message)&&c.bindPopup(a.message,a.popupOptions)),s(a.icon)&&s(b.icon)&&!angular.equals(a.icon,b.icon)){var l=!1;c.dragging&&(l=c.dragging.enabled()),c.setIcon(y(a.icon)),l&&c.dragging.enable(),c.closePopup(),c.unbindPopup(),q(a.message)&&(c.bindPopup(a.message,a.popupOptions),i.hasLayer(c)&&!0===a.focus&&c.openPopup())}!q(a.message)&&q(b.message)&&(c.closePopup(),c.unbindPopup()),p.LabelPlugin.isLoaded()&&(g(a.label)&&g(a.label.message)?"label"in b&&"message"in b.label&&!angular.equals(a.label.message,b.label.message)?c.updateLabelContent(a.label.message):!angular.isFunction(c.getLabel)||angular.isFunction(c.getLabel)&&!g(c.getLabel())?(c.bindLabel(a.label.message,a.label.options),G(c,a)):G(c,a):(!("label"in a)||"message"in a.label)&&angular.isFunction(c.unbindLabel)&&c.unbindLabel()),q(a.message)&&!q(b.message)&&c.bindPopup(a.message,a.popupOptions),q(a.message)&&q(b.message)&&a.message!==b.message&&c.setPopupContent(a.message);var m=!1;!0!==a.focus&&!0===b.focus&&(c.closePopup(),m=!0),(!0===a.focus&&(!g(b.focus)||!1===b.focus)||j&&!0===a.focus)&&(c.openPopup(),m=!0),b.zIndexOffset!==a.zIndexOffset&&c.setZIndexOffset(a.zIndexOffset);var n=c.getLatLng();q(a.layer)&&p.MarkerClusterPlugin.is(h.overlays[a.layer])?m?(a.lat!==b.lat||a.lng!==b.lng)&&(h.overlays[a.layer].removeLayer(c),c.setLatLng([a.lat,a.lng]),h.overlays[a.layer].addLayer(c)):n.lat!==a.lat||n.lng!==a.lng?(h.overlays[a.layer].removeLayer(c),c.setLatLng([a.lat,a.lng]),h.overlays[a.layer].addLayer(c)):a.lat!==b.lat||a.lng!==b.lng?(h.overlays[a.layer].removeLayer(c),c.setLatLng([a.lat,a.lng]),h.overlays[a.layer].addLayer(c)):s(a.icon)&&s(b.icon)&&!angular.equals(a.icon,b.icon)&&(h.overlays[a.layer].removeLayer(c),h.overlays[a.layer].addLayer(c)):(n.lat!==a.lat||n.lng!==a.lng)&&c.setLatLng([a.lat,a.lng])}};return{resetMarkerGroup:z,resetMarkerGroups:A,deleteMarker:B,manageOpenPopup:F,manageOpenLabel:G,createMarker:function(a){if(!g(a)||!u.validateCoords(a))return void d.error(v+"The marker definition is not valid.");var b=u.getCoords(a);if(!g(b))return void d.error(v+"Unable to get coordinates from markerData.");var c={icon:y(a.icon),title:g(a.title)?a.title:"",draggable:!!g(a.draggable)&&a.draggable,clickable:!g(a.clickable)||a.clickable,riseOnHover:!!g(a.riseOnHover)&&a.riseOnHover,zIndexOffset:g(a.zIndexOffset)?a.zIndexOffset:0,iconAngle:g(a.iconAngle)?a.iconAngle:0};for(var e in a)a.hasOwnProperty(e)&&!c.hasOwnProperty(e)&&(c[e]=a[e]);var f=new L.marker(b,c);return q(a.message)||f.unbindPopup(),f},addMarkerToGroup:function(a,b,c,e){return q(b)?i.isLoaded()?(g(t[b])||(t[b]=new L.MarkerClusterGroup(c),e.addLayer(t[b])),void t[b].addLayer(a)):void d.error(v+"The MarkerCluster plugin is not loaded."):void d.error(v+"The marker group you have specified is invalid.")},listenMarkerEvents:function(a,b,c,d,e){a.on("popupopen",function(){o(c,function(){(g(a._popup)||g(a._popup._contentNode))&&(b.focus=!0,F(a,b,e))})}),a.on("popupclose",function(){o(c,function(){b.focus=!1})}),a.on("add",function(){o(c,function(){"label"in b&&G(a,b)})})},updateMarker:H,addMarkerWatcher:function(a,b,c,d,e,f){var i=p.getObjectArrayPath("markers."+b);f=h(f,!0);var j=c.$watch(i,function(f,h){return g(f)?void H(f,h,a,0,0,d,e):(B(a,e,d),void j())},f)},string:w,log:x}}]),angular.module("leaflet-directive").factory("leafletPathsHelpers",["$rootScope","$log","leafletHelpers",function(a,b,c){function d(a){return a.filter(function(a){return k(a)}).map(function(a){return e(a)})}function e(a){return i(a)?new L.LatLng(a[0],a[1]):new L.LatLng(a.lat,a.lng)}function f(a){return a.map(function(a){return d(a)})}function g(a,b){for(var c={},d=0;d0&&e(a[0].boundingbox)?i.resolve(a[0]):i.reject("[Nominatim] Invalid address")}),i.promise}}}]),angular.module("leaflet-directive").directive("bounds",["$log","$timeout","$http","leafletHelpers","nominatimService","leafletBoundsHelpers",function(a,b,c,d,e,f){return{restrict:"A",scope:!1,replace:!1,require:["leaflet"],link:function(c,g,h,i){var j=d.isDefined,k=f.createLeafletBounds,l=i[0].getLeafletScope(),m=i[0],n=d.errorHeader+" [Bounds] ",o=function(a){return 0===a._southWest.lat&&0===a._southWest.lng&&0===a._northEast.lat&&0===a._northEast.lng};m.getMap().then(function(d){l.$on("boundsChanged",function(a){var c=a.currentScope,e=d.getBounds();if(!o(e)&&!c.settingBoundsFromScope){c.settingBoundsFromLeaflet=!0;var f={northEast:{lat:e._northEast.lat,lng:e._northEast.lng},southWest:{lat:e._southWest.lat,lng:e._southWest.lng},options:e.options};angular.equals(c.bounds,f)||(c.bounds=f),b(function(){c.settingBoundsFromLeaflet=!1})}});var f;l.$watch("bounds",function(g){if(!c.settingBoundsFromLeaflet){if(j(g.address)&&g.address!==f)return c.settingBoundsFromScope=!0,e.query(g.address,h.id).then(function(a){var b=a.boundingbox,c=[[b[0],b[2]],[b[1],b[3]]];d.fitBounds(c)},function(b){a.error(n+" "+b+".")}),f=g.address,void b(function(){c.settingBoundsFromScope=!1});var i=k(g);i&&!d.getBounds().equals(i)&&(c.settingBoundsFromScope=!0,d.fitBounds(i,g.options),b(function(){c.settingBoundsFromScope=!1}))}},!0)})}}}]);var centerDirectiveTypes=["center","lfCenter"],centerDirectives={};centerDirectiveTypes.forEach(function(a){centerDirectives[a]=["$log","$q","$location","$timeout","leafletMapDefaults","leafletHelpers","leafletBoundsHelpers","leafletMapEvents",function(b,c,d,e,f,g,h,i){var j,k=g.isDefined,l=g.isNumber,m=g.isSameCenterOnMap,n=g.safeApply,o=g.isValidCenter,p=h.isValidBounds,q=g.isUndefinedOrEmpty,r=g.errorHeader,s=function(a,b){return k(a)&&p(a)&&q(b)};return{restrict:"A",scope:!1,replace:!1,require:"leaflet",controller:function(){j=c.defer(),this.getCenter=function(){return j.promise}},link:function(c,g,p,q){var t=q.getLeafletScope(),u=t[a];q.getMap().then(function(c){var g=f.getDefaults(p.id);if(-1!==p[a].search("-"))return b.error(r+' The "center" variable can\'t use a "-" on its key name: "'+p[a]+'".'),void c.setView([g.center.lat,g.center.lng],g.center.zoom);if(s(t.bounds,u))c.fitBounds(h.createLeafletBounds(t.bounds),t.bounds.options),u=c.getCenter(),n(t,function(b){angular.extend(b[a],{lat:c.getCenter().lat,lng:c.getCenter().lng,zoom:c.getZoom(),autoDiscover:!1})}),n(t,function(a){var b=c.getBounds();a.bounds={northEast:{lat:b._northEast.lat,lng:b._northEast.lng},southWest:{lat:b._southWest.lat,lng:b._southWest.lng}}});else{if(!k(u))return b.error(r+' The "center" property is not defined in the main scope'),void c.setView([g.center.lat,g.center.lng],g.center.zoom);k(u.lat)&&k(u.lng)||k(u.autoDiscover)||angular.copy(g.center,u)}var q,v;if("yes"===p.urlHashCenter){var w=function(){var a,b=d.search();if(k(b.c)){var c=b.c.split(":");3===c.length&&(a={lat:parseFloat(c[0]),lng:parseFloat(c[1]),zoom:parseInt(c[2],10)})}return a};q=w(),t.$on("$locationChangeSuccess",function(b){var d=b.currentScope,e=w();k(e)&&!m(e,c)&&angular.extend(d[a],{lat:e.lat,lng:e.lng,zoom:e.zoom})})}t.$watch(a,function(a){return t.settingCenterFromLeaflet?void 0:(k(q)&&(angular.copy(q,a),q=void 0),o(a)||!0===a.autoDiscover?!0===a.autoDiscover?(l(a.zoom)||c.setView([g.center.lat,g.center.lng],g.center.zoom),void(l(a.zoom)&&a.zoom>g.center.zoom?c.locate({setView:!0,maxZoom:a.zoom}):k(g.maxZoom)?c.locate({setView:!0,maxZoom:g.maxZoom}):c.locate({setView:!0}))):void(v&&m(a,c)||(t.settingCenterFromScope=!0,c.setView([a.lat,a.lng],a.zoom),i.notifyCenterChangedToBounds(t,c),e(function(){t.settingCenterFromScope=!1}))):void b.warn(r+" invalid 'center'"))},!0),c.whenReady(function(){v=!0}),c.on("moveend",function(){j.resolve(),i.notifyCenterUrlHashChanged(t,c,p,d.search()),m(u,c)||t.settingCenterFromScope||(t.settingCenterFromLeaflet=!0,n(t,function(b){t.settingCenterFromScope||angular.extend(b[a],{lat:c.getCenter().lat,lng:c.getCenter().lng,zoom:c.getZoom(),autoDiscover:!1}),i.notifyCenterChangedToBounds(t,c),e(function(){t.settingCenterFromLeaflet=!1})}))}),!0===u.autoDiscover&&c.on("locationerror",function(){b.warn(r+" The Geolocation API is unauthorized on this page."),o(u)?(c.setView([u.lat,u.lng],u.zoom),i.notifyCenterChangedToBounds(t,c)):(c.setView([g.center.lat,g.center.lng],g.center.zoom),i.notifyCenterChangedToBounds(t,c))})})}}}]}),centerDirectiveTypes.forEach(function(a){angular.module("leaflet-directive").directive(a,centerDirectives[a])}),angular.module("leaflet-directive").directive("controls",["$log","leafletHelpers","leafletControlHelpers",function(a,b,c){return{restrict:"A",scope:!1,replace:!1,require:"?^leaflet",link:function(d,e,f,g){if(g){var h=c.createControl,i=c.isValidControlType,j=g.getLeafletScope(),k=b.isDefined,l=b.isArray,m={},n=b.errorHeader+" [Controls] ";g.getMap().then(function(b){j.$watchCollection("controls",function(c){for(var d in m)k(c[d])||(b.hasControl(m[d])&&b.removeControl(m[d]),delete m[d]);for(var e in c){var f,g=k(c[e].type)?c[e].type:e;if(!i(g))return void a.error(n+" Invalid control type: "+g+".");if("custom"!==g)f=h(g,c[e]),b.addControl(f),m[e]=f;else{var j=c[e];if(l(j))for(var o in j){var p=j[o];b.addControl(p),m[e]=k(m[e])?m[e].concat([p]):[p]}else b.addControl(j),m[e]=j}}})})}}}}]),angular.module("leaflet-directive").directive("decorations",["$log","leafletHelpers",function(a,b){return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(c,d,e,f){function g(b){return k(b)&&k(b.coordinates)&&(j.isLoaded()||a.error("[AngularJS - Leaflet] The PolylineDecorator Plugin is not loaded.")),L.polylineDecorator(b.coordinates)}function h(a,b){return k(a)&&k(b)&&k(b.coordinates)&&k(b.patterns)?(a.setPaths(b.coordinates),a.setPatterns(b.patterns),a):void 0}var i=f.getLeafletScope(),j=b.PolylineDecoratorPlugin,k=b.isDefined,l={};f.getMap().then(function(a){i.$watch("decorations",function(b){for(var c in l)k(b[c])&&angular.equals(b[c],l)||(a.removeLayer(l[c]),delete l[c]);for(var d in b){var e=b[d],f=g(e);k(f)&&(l[d]=f,a.addLayer(f),h(f,e))}},!0)})}}}]),angular.module("leaflet-directive").directive("eventBroadcast",["$log","$rootScope","leafletHelpers","leafletMapEvents","leafletIterators",function(a,b,c,d,e){return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(b,f,g,h){var i=c.isObject,j=c.isDefined,k=h.getLeafletScope(),l=k.eventBroadcast,m=d.getAvailableMapEvents(),n=d.addEvents;h.getMap().then(function(b){var c=[],d="broadcast";j(l.map)?i(l.map)?("emit"!==l.map.logic&&"broadcast"!==l.map.logic?a.warn("[AngularJS - Leaflet] Available event propagation logic are: 'emit' or 'broadcast'."):d=l.map.logic,i(l.map.enable)&&l.map.enable.length>=0?e.each(l.map.enable,function(a){-1===c.indexOf(a)&&-1!==m.indexOf(a)&&c.push(a)}):a.warn("[AngularJS - Leaflet] event-broadcast.map.enable must be an object check your model.")):a.warn("[AngularJS - Leaflet] event-broadcast.map must be an object check your model."):c=m,n(b,c,"eventName",k,d)})}}}]),angular.module("leaflet-directive").directive("geojson",["$log","$rootScope","leafletData","leafletHelpers","leafletWatchHelpers","leafletDirectiveControlsHelpers","leafletIterators","leafletGeoJsonEvents",function(a,b,c,d,e,f,g,h){var i=e.maybeWatch,j=d.watchOptions,k=f.extend,l=d,m=g;return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(a,b,e,f){var g=d.isDefined,n=f.getLeafletScope(),o={},p=!1;f.getMap().then(function(a){var b=n.geojsonWatchOptions||j,f=function(a,b){return angular.isFunction(a.onEachFeature)?a.onEachFeature:function(c,f){d.LabelPlugin.isLoaded()&&g(c.properties.description)&&f.bindLabel(c.properties.description),h.bindEvents(e.id,f,null,c,n,b,{resetStyleOnMouseout:a.resetStyleOnMouseout,mapId:e.id})} },q=l.isDefined(e.geojsonNested)&&l.isTruthy(e.geojsonNested),r=function(){if(o){var b=function(b){g(b)&&a.hasLayer(b)&&a.removeLayer(b)};return q?void m.each(o,function(a){b(a)}):void b(o)}},s=function(b,d){var h=angular.copy(b);if(g(h)&&g(h.data)){var i=f(h,d);g(h.options)||(h.options={style:h.style,filter:h.filter,onEachFeature:i,pointToLayer:h.pointToLayer});var j=L.geoJson(h.data,h.options);d&&l.isString(d)?o[d]=j:o=j,j.addTo(a),p||(p=!0,c.setGeoJSON(o,e.id))}},t=function(a){if(r(),q){if(!a||!Object.keys(a).length)return;return void m.each(a,function(a,b){s(a,b)})}s(a)};k(e.id,"geojson",t,r),i(n,"geojson",b,function(a){t(a)})})}}}]),angular.module("leaflet-directive").directive("layercontrol",["$filter","$log","leafletData","leafletHelpers",function(a,b,c,d){return{restrict:"E",scope:{icons:"=?",autoHideOpacity:"=?",showGroups:"=?",title:"@",baseTitle:"@",overlaysTitle:"@"},replace:!0,transclude:!1,require:"^leaflet",controller:["$scope","$element","$sce",function(a,e,f){b.debug("[Angular Directive - Layers] layers",a,e);var g=d.safeApply,h=d.isDefined;angular.extend(a,{baselayer:"",oldGroup:"",layerProperties:{},groupProperties:{},rangeIsSupported:d.rangeIsSupported(),changeBaseLayer:function(b,e){d.safeApply(a,function(d){d.baselayer=b,c.getMap().then(function(e){c.getLayers().then(function(c){if(!e.hasLayer(c.baselayers[b])){for(var f in d.layers.baselayers)d.layers.baselayers[f].icon=d.icons.unradio,e.hasLayer(c.baselayers[f])&&e.removeLayer(c.baselayers[f]);e.addLayer(c.baselayers[b]),d.layers.baselayers[b].icon=a.icons.radio}})})}),e.preventDefault()},moveLayer:function(b,c,d){var e=Object.keys(a.layers.baselayers).length;if(c>=1+e&&c<=a.overlaysArray.length+e){var f;for(var h in a.layers.overlays)if(a.layers.overlays[h].index===c){f=a.layers.overlays[h];break}f&&g(a,function(){f.index=b.index,b.index=c})}d.stopPropagation(),d.preventDefault()},initIndex:function(b,c){var d=Object.keys(a.layers.baselayers).length;b.index=h(b.index)?b.index:c+d+1},initGroup:function(b){a.groupProperties[b]=a.groupProperties[b]?a.groupProperties[b]:{}},toggleOpacity:function(b,c){if(c.visible){if(a.autoHideOpacity&&!a.layerProperties[c.name].opacityControl)for(var d in a.layerProperties)a.layerProperties[d].opacityControl=!1;a.layerProperties[c.name].opacityControl=!a.layerProperties[c.name].opacityControl}b.stopPropagation(),b.preventDefault()},toggleLegend:function(b){a.layerProperties[b.name].showLegend=!a.layerProperties[b.name].showLegend},showLegend:function(b){return b.legend&&a.layerProperties[b.name].showLegend},unsafeHTML:function(a){return f.trustAsHtml(a)},getOpacityIcon:function(b){return b.visible&&a.layerProperties[b.name].opacityControl?a.icons.close:a.icons.open},getGroupIcon:function(b){return b.visible?a.icons.check:a.icons.uncheck},changeOpacity:function(b){var d=a.layerProperties[b.name].opacity;c.getMap().then(function(e){c.getLayers().then(function(c){var f;for(var g in a.layers.overlays)if(a.layers.overlays[g]===b){f=c.overlays[g];break}e.hasLayer(f)&&(f.setOpacity&&f.setOpacity(d/100),f.getLayers&&f.eachLayer&&f.eachLayer(function(a){a.setOpacity&&a.setOpacity(d/100)}))})})},changeGroupVisibility:function(b){if(h(a.groupProperties[b])){var c=a.groupProperties[b].visible;for(var d in a.layers.overlays){var e=a.layers.overlays[d];e.group===b&&(e.visible=c)}}}});var i=e.get(0);L.Browser.touch?L.DomEvent.on(i,"click",L.DomEvent.stopPropagation):(L.DomEvent.disableClickPropagation(i),L.DomEvent.on(i,"mousewheel",L.DomEvent.stopPropagation))}],template:'

{{ title }}

{{ baseTitle }}
{{ overlaysTitle }}
Range is not supported in this browser
',link:function(a,b,e,f){var g=d.isDefined,h=f.getLeafletScope(),i=h.layers;a.$watch("icons",function(){var b={uncheck:"fa fa-square-o",check:"fa fa-check-square-o",radio:"fa fa-dot-circle-o",unradio:"fa fa-circle-o",up:"fa fa-angle-up",down:"fa fa-angle-down",open:"fa fa-angle-double-down",close:"fa fa-angle-double-up",toggleLegend:"fa fa-pencil-square-o"};g(a.icons)?(angular.extend(b,a.icons),angular.extend(a.icons,b)):a.icons=b}),e.order=!g(e.order)||"normal"!==e.order&&"reverse"!==e.order?"normal":e.order,a.order="normal"===e.order,a.orderNumber="normal"===e.order?-1:1,a.layers=i,f.getMap().then(function(b){h.$watch("layers.baselayers",function(d){var e={};c.getLayers().then(function(c){var f;for(f in d){var g=d[f];g.icon=a.icons[b.hasLayer(c.baselayers[f])?"radio":"unradio"],e[f]=g}a.baselayersArray=e})}),h.$watch("layers.overlays",function(b){var d=[],e={};c.getLayers().then(function(c){var f;for(f in b){var h=b[f];h.icon=a.icons[h.visible?"check":"uncheck"],d.push(h),g(a.layerProperties[h.name])||(a.layerProperties[h.name]={opacity:g(h.layerOptions.opacity)?100*h.layerOptions.opacity:100,opacityControl:!1,showLegend:!0}),g(h.group)&&(g(a.groupProperties[h.group])||(a.groupProperties[h.group]={visible:!1}),e[h.group]=g(e[h.group])?e[h.group]:{count:0,visibles:0},e[h.group].count++,h.visible&&e[h.group].visibles++),g(h.index)&&c.overlays[f].setZIndex&&c.overlays[f].setZIndex(b[f].index)}for(f in e)a.groupProperties[f].visible=e[f].visibles===e[f].count;a.overlaysArray=d})},!0)})}}}]),angular.module("leaflet-directive").directive("layers",["$log","$q","leafletData","leafletHelpers","leafletLayerHelpers","leafletControlHelpers",function(a,b,c,d,e,f){return{restrict:"A",scope:!1,replace:!1,require:"leaflet",controller:["$scope",function(a){a._leafletLayers=b.defer(),this.getLayers=function(){return a._leafletLayers.promise}}],link:function(a,b,g,h){var i=d.isDefined,j={},k=h.getLeafletScope(),l=k.layers,m=e.createLayer,n=e.safeAddLayer,o=e.safeRemoveLayer,p=f.updateLayersControl,q=!1;h.getMap().then(function(b){a._leafletLayers.resolve(j),c.setLayers(j,g.id),j.baselayers={},j.overlays={};var d=g.id,e=!1;for(var f in l.baselayers){var h=m(l.baselayers[f]);i(h)?(j.baselayers[f]=h,!0===l.baselayers[f].top&&(n(b,j.baselayers[f]),e=!0)):delete l.baselayers[f]}!e&&Object.keys(j.baselayers).length>0&&n(b,j.baselayers[Object.keys(l.baselayers)[0]]);for(f in l.overlays){var r=m(l.overlays[f]);i(r)?(j.overlays[f]=r,!0===l.overlays[f].visible&&n(b,j.overlays[f])):delete l.overlays[f]}k.$watch("layers.baselayers",function(a,c){if(angular.equals(a,c))return q=p(b,d,q,a,l.overlays,j),!0;for(var e in j.baselayers)(!i(a[e])||a[e].doRefresh)&&(b.hasLayer(j.baselayers[e])&&b.removeLayer(j.baselayers[e]),delete j.baselayers[e],a[e]&&a[e].doRefresh&&(a[e].doRefresh=!1));for(var f in a)if(i(j.baselayers[f]))!0!==a[f].top||b.hasLayer(j.baselayers[f])?!1===a[f].top&&b.hasLayer(j.baselayers[f])&&b.removeLayer(j.baselayers[f]):n(b,j.baselayers[f]);else{var g=m(a[f]);i(g)&&(j.baselayers[f]=g,!0===a[f].top&&n(b,j.baselayers[f]))}var h=!1;for(var k in j.baselayers)if(b.hasLayer(j.baselayers[k])){h=!0;break}!h&&Object.keys(j.baselayers).length>0&&n(b,j.baselayers[Object.keys(j.baselayers)[0]]),q=p(b,d,q,a,l.overlays,j)},!0),k.$watch("layers.overlays",function(a,c){if(angular.equals(a,c))return q=p(b,d,q,l.baselayers,a,j),!0;for(var e in j.overlays)if(!i(a[e])||a[e].doRefresh){if(b.hasLayer(j.overlays[e])){var f=i(a[e])?a[e].layerOptions:null;o(b,j.overlays[e],f)}delete j.overlays[e],a[e]&&a[e].doRefresh&&(a[e].doRefresh=!1)}for(var g in a){if(i(j.overlays[g]))a[g].visible&&!b.hasLayer(j.overlays[g])?n(b,j.overlays[g]):!1===a[g].visible&&b.hasLayer(j.overlays[g])&&o(b,j.overlays[g],a[g].layerOptions);else{var h=m(a[g]);if(!i(h))continue;j.overlays[g]=h,!0===a[g].visible&&n(b,j.overlays[g])}a[g].visible&&b._loaded&&a[g].data&&"heatmap"===a[g].type&&(j.overlays[g].setData(a[g].data),j.overlays[g].update())}q=p(b,d,q,l.baselayers,a,j)},!0)})}}}]),angular.module("leaflet-directive").directive("legend",["$log","$http","leafletHelpers","leafletLegendHelpers",function(a,b,c,d){return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(e,f,g,h){var i,j,k,l,m=c.isArray,n=c.isDefined,o=c.isFunction,p=h.getLeafletScope(),q=p.legend;p.$watch("legend",function(a){n(a)&&(i=a.legendClass?a.legendClass:"legend",j=a.position||"bottomright",l=a.type||"arcgis")},!0),h.getMap().then(function(c){p.$watch("legend",function(b){return n(b)?n(b.url)||"arcgis"!==l||m(b.colors)&&m(b.labels)&&b.colors.length===b.labels.length?n(b.url)?void a.info("[AngularJS - Leaflet] loading legend service."):(n(k)&&(k.removeFrom(c),k=null),k=L.control({position:j}),"arcgis"===l&&(k.onAdd=d.getOnAddArrayLegend(b,i)),void k.addTo(c)):void a.warn("[AngularJS - Leaflet] legend.colors and legend.labels must be set."):void(n(k)&&(k.removeFrom(c),k=null))}),p.$watch("legend.url",function(e){n(e)&&b.get(e).success(function(a){n(k)?d.updateLegend(k.getContainer(),a,l,e):(k=L.control({position:j}),k.onAdd=d.getOnAddLegend(a,i,l,e),k.addTo(c)),n(q.loadedData)&&o(q.loadedData)&&q.loadedData()}).error(function(){a.warn("[AngularJS - Leaflet] legend.url not loaded.")})})})}}}]),angular.module("leaflet-directive").directive("markers",["$log","$rootScope","$q","leafletData","leafletHelpers","leafletMapDefaults","leafletMarkersHelpers","leafletMarkerEvents","leafletIterators","leafletWatchHelpers","leafletDirectiveControlsHelpers",function(a,b,c,d,e,f,g,h,i,j,k){var l=e.isDefined,m=e.errorHeader,n=e,o=e.isString,p=g.addMarkerWatcher,q=g.updateMarker,r=g.listenMarkerEvents,s=g.addMarkerToGroup,t=g.createMarker,u=g.deleteMarker,v=i,w=e.watchOptions,x=j.maybeWatch,y=k.extend,z=function(a,b,c){if(Object.keys(a).length){if(c&&o(c)){if(!a[c]||!Object.keys(a[c]).length)return;return a[c][b]}return a[b]}},A=function(a,b,c,d){return d&&o(d)?(l(b[d])||(b[d]={}),b[d][c]=a):b[c]=a,a},B=function(b,c,d,e,f,g){if(!o(b))return a.error(m+" A layername must be a string"),!1;if(!l(c))return a.error(m+" You must add layers to the directive if the markers are going to use this functionality."),!1;if(!l(c.overlays)||!l(c.overlays[b]))return a.error(m+' A marker can only be added to a layer of type "group"'),!1;var h=c.overlays[b];return h instanceof L.LayerGroup||h instanceof L.FeatureGroup?(h.addLayer(e),!f&&g.hasLayer(e)&&!0===d.focus&&e.openPopup(),!0):(a.error(m+' Adding a marker to an overlay needs a overlay of the type "group" or "featureGroup"'),!1)},C=function(b,c,d,e,f,g,i,j,k,o){for(var u in c)if(!o[u])if(-1===u.search("-")){var v=n.copy(c[u]),w=n.getObjectDotPath(k?[k,u]:[u]),x=z(g,u,k);if(l(x)){var y=l(y)?d[u]:void 0;q(v,y,x,w,i,f,e)}else{var C=t(v),D=(v?v.layer:void 0)||k;if(!l(C)){a.error(m+" Received invalid data on the marker "+u+".");continue}if(A(C,g,u,k),l(v.message)&&C.bindPopup(v.message,v.popupOptions),l(v.group)){var E=l(v.groupOption)?v.groupOption:null;s(C,v.group,E,e)}if(n.LabelPlugin.isLoaded()&&l(v.label)&&l(v.label.message)&&C.bindLabel(v.label.message,v.label.options),l(v)&&(l(v.layer)||l(k))){var F=B(D,f,v,C,j.individual.doWatch,e);if(!F)continue}else l(v.group)||(e.addLayer(C),j.individual.doWatch||!0!==v.focus||C.openPopup());j.individual.doWatch&&p(C,w,i,f,e,j.individual.isDeep),r(C,v,i,j.individual.doWatch,e),h.bindEvents(b,C,w,v,i,D)}}else a.error('The marker can\'t use a "-" on his key name: "'+u+'".')},D=function(b,c,d,e,f){var g,h,i=!1,j=!1,k=l(c);for(var o in d)i||(a.debug(m+"[markers] destroy: "),i=!0),k&&(h=b[o],g=c[o],j=angular.equals(h,g)&&e),l(b)&&Object.keys(b).length&&l(b[o])&&Object.keys(b[o]).length&&!j||f&&n.isFunction(f)&&f(h,g,o)},E=function(b,c,d,e,f){D(b,c,d,!1,function(b,c,g){a.debug(m+"[marker] is deleting marker: "+g),u(d[g],e,f),delete d[g]})},F=function(b,c,d){var e={};return D(b,c,d,!0,function(b,c,d){a.debug(m+"[marker] is already rendered, marker: "+d),e[d]=b}),e};return{restrict:"A",scope:!1,replace:!1,require:["leaflet","?layers"],link:function(a,b,e,f){var g=f[0],h=g.getLeafletScope();g.getMap().then(function(a){var b,g={};b=l(f[1])?f[1].getLayers:function(){var a=c.defer();return a.resolve(),a.promise};var i=h.markersWatchOptions||w;l(e.watchMarkers)&&(i.doWatch=i.individual.doWatch=!l(e.watchMarkers)||n.isTruthy(e.watchMarkers));var j=l(e.markersNested)&&n.isTruthy(e.markersNested);b().then(function(b){var c=function(c,d){return j?void v.each(c,function(c,e){var f=l(f)?d[e]:void 0;E(c,f,g[e],a,b)}):void E(c,d,g,a,b)},f=function(d,f){c(d,f);var k=null;return j?void v.each(d,function(c,j){var m=l(m)?f[j]:void 0;k=F(d[j],m,g[j]),C(e.id,c,f,a,b,g,h,i,j,k)}):(k=F(d,f,g),void C(e.id,d,f,a,b,g,h,i,void 0,k))};y(e.id,"markers",f,c),d.setMarkers(g,e.id),x(h,"markers",i,function(a,b){f(a,b)})})})}}}]),angular.module("leaflet-directive").directive("maxbounds",["$log","leafletMapDefaults","leafletBoundsHelpers","leafletHelpers",function(a,b,c,d){return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(a,b,e,f){var g=f.getLeafletScope(),h=c.isValidBounds,i=d.isNumber;f.getMap().then(function(a){g.$watch("maxbounds",function(b){if(!h(b))return void a.setMaxBounds();var d=c.createLeafletBounds(b);i(b.pad)&&(d=d.pad(b.pad)),a.setMaxBounds(d),e.center||e.lfCenter||a.fitBounds(d)})})}}}]),angular.module("leaflet-directive").directive("paths",["$log","$q","leafletData","leafletMapDefaults","leafletHelpers","leafletPathsHelpers","leafletPathEvents",function(a,b,c,d,e,f,g){return{restrict:"A",scope:!1,replace:!1,require:["leaflet","?layers"],link:function(h,i,j,k){var l=k[0],m=e.isDefined,n=e.isString,o=l.getLeafletScope(),p=o.paths,q=f.createPath,r=g.bindPathEvents,s=f.setPathOptions;l.getMap().then(function(f){var g,h=d.getDefaults(j.id);g=m(k[1])?k[1].getLayers:function(){var a=b.defer();return a.resolve(),a.promise},m(p)&&g().then(function(b){var d={};c.setPaths(d,j.id);var g=!m(j.watchPaths)||"true"===j.watchPaths,i=function(a,c){var d=o.$watch('paths["'+c+'"]',function(c,e){if(!m(c)){if(m(e.layer))for(var g in b.overlays){var h=b.overlays[g];h.removeLayer(a)}return f.removeLayer(a),void d()}s(a,c.type,c)},!0)};o.$watchCollection("paths",function(c){for(var k in d)m(c[k])||(f.removeLayer(d[k]),delete d[k]);for(var l in c)if(0!==l.search("\\$"))if(-1===l.search("-")){if(!m(d[l])){var p=c[l],t=q(l,c[l],h);if(m(t)&&m(p.message)&&t.bindPopup(p.message,p.popupOptions),e.LabelPlugin.isLoaded()&&m(p.label)&&m(p.label.message)&&t.bindLabel(p.label.message,p.label.options),m(p)&&m(p.layer)){if(!n(p.layer)){a.error("[AngularJS - Leaflet] A layername must be a string");continue}if(!m(b)){a.error("[AngularJS - Leaflet] You must add layers to the directive if the markers are going to use this functionality.");continue}if(!m(b.overlays)||!m(b.overlays[p.layer])){a.error('[AngularJS - Leaflet] A path can only be added to a layer of type "group"');continue}var u=b.overlays[p.layer];if(!(u instanceof L.LayerGroup||u instanceof L.FeatureGroup)){a.error('[AngularJS - Leaflet] Adding a path to an overlay needs a overlay of the type "group" or "featureGroup"');continue}d[l]=t,u.addLayer(t),g?i(t,l):s(t,p.type,p)}else m(t)&&(d[l]=t,f.addLayer(t),g?i(t,l):s(t,p.type,p));r(j.id,t,l,p,o)}}else a.error('[AngularJS - Leaflet] The path name "'+l+'" is not valid. It must not include "-" and a number.')})})})}}}]),angular.module("leaflet-directive").directive("tiles",["$log","leafletData","leafletMapDefaults","leafletHelpers",function(a,b,c,d){return{restrict:"A",scope:!1,replace:!1,require:"leaflet",link:function(e,f,g,h){var i=d.isDefined,j=h.getLeafletScope(),k=j.tiles;return i(k)&&i(k.url)?void h.getMap().then(function(a){var d,e=c.getDefaults(g.id);j.$watch("tiles",function(c,f){var h=e.tileLayerOptions,j=e.tileLayer;return!i(c.url)&&i(d)?void a.removeLayer(d):i(d)?!i(c.url)||!i(c.options)||c.type===f.type&&angular.equals(c.options,h)?void(i(c.url)&&d.setUrl(c.url)):(a.removeLayer(d),h=e.tileLayerOptions,angular.copy(c.options,h),j=c.url,d="wms"===c.type?L.tileLayer.wms(j,h):L.tileLayer(j,h),d.addTo(a),void b.setTiles(d,g.id)):(i(c.options)&&angular.copy(c.options,h),i(c.url)&&(j=c.url),d="wms"===c.type?L.tileLayer.wms(j,h):L.tileLayer(j,h),d.addTo(a),void b.setTiles(d,g.id))},!0)}):void a.warn("[AngularJS - Leaflet] The 'tiles' definition doesn't have the 'url' property.")}}}]),["markers","geojson"].forEach(function(a){angular.module("leaflet-directive").directive(a+"WatchOptions",["$log","$rootScope","$q","leafletData","leafletHelpers",function(b,c,d,e,f){var g=f.isDefined,h=f.errorHeader,i=f.isObject,j=f.watchOptions;return{restrict:"A",scope:!1,replace:!1,require:["leaflet"],link:function(c,d,e,f){var k=f[0],l=k.getLeafletScope();k.getMap().then(function(){g(c[a+"WatchOptions"])&&(i(c[a+"WatchOptions"])?angular.extend(j,c[a+"WatchOptions"]):b.error(h+"["+a+"WatchOptions] is not an object"),l[a+"WatchOptions"]=j)})}}}])}),angular.module("leaflet-directive").factory("LeafletEventsHelpersFactory",["$rootScope","$q","$log","leafletHelpers",function(a,b,c,d){var e=d.safeApply,f=d.isDefined,g=d.isObject,h=d.isArray,i=d.errorHeader,j=function(a,b){this.rootBroadcastName=a,c.debug("LeafletEventsHelpersFactory: lObjectType: "+b+"rootBroadcastName: "+a),this.lObjectType=b};return j.prototype.getAvailableEvents=function(){return[]},j.prototype.genDispatchEvent=function(a,b,d,e,f,g,h,i,j){var k=this;return a=a||"",a&&(a="."+a),function(l){var m=k.rootBroadcastName+a+"."+b;c.debug(m),k.fire(e,m,d,l,l.target||f,h,g,i,j)}},j.prototype.fire=function(b,c,d,g,h,i,j,k){e(b,function(){var e={leafletEvent:g,leafletObject:h,modelName:j,model:i};f(k)&&angular.extend(e,{layerName:k}),"emit"===d?b.$emit(c,e):a.$broadcast(c,e)})},j.prototype.bindEvents=function(a,b,d,e,j,k,l){var m=[],n="emit",o=this;if(f(j.eventBroadcast))if(g(j.eventBroadcast))if(f(j.eventBroadcast[o.lObjectType]))if(g(j.eventBroadcast[o.lObjectType])){f(j.eventBroadcast[this.lObjectType].logic)&&"emit"!==j.eventBroadcast[o.lObjectType].logic&&"broadcast"!==j.eventBroadcast[o.lObjectType].logic&&c.warn(i+"Available event propagation logic are: 'emit' or 'broadcast'.");var p=!1,q=!1;f(j.eventBroadcast[o.lObjectType].enable)&&h(j.eventBroadcast[o.lObjectType].enable)&&(p=!0),f(j.eventBroadcast[o.lObjectType].disable)&&h(j.eventBroadcast[o.lObjectType].disable)&&(q=!0),p&&q?c.warn(i+"can not enable and disable events at the same time"):p||q?p?j.eventBroadcast[this.lObjectType].enable.forEach(function(a){-1!==m.indexOf(a)?c.warn(i+"This event "+a+" is already enabled"):-1===o.getAvailableEvents().indexOf(a)?c.warn(i+"This event "+a+" does not exist"):m.push(a)}):(m=this.getAvailableEvents(),j.eventBroadcast[o.lObjectType].disable.forEach(function(a){var b=m.indexOf(a);-1===b?c.warn(i+"This event "+a+" does not exist or has been already disabled"):m.splice(b,1)})):c.warn(i+"must enable or disable events")}else c.warn(i+"event-broadcast."+[o.lObjectType]+" must be an object check your model.");else m=this.getAvailableEvents();else c.error(i+"event-broadcast must be an object check your model.");else m=this.getAvailableEvents();return m.forEach(function(c){b.on(c,o.genDispatchEvent(a,c,n,j,b,d,e,k,l))}),n},j}]).service("leafletEventsHelpers",["LeafletEventsHelpersFactory",function(a){return new a}]),angular.module("leaflet-directive").factory("leafletGeoJsonEvents",["$rootScope","$q","$log","leafletHelpers","LeafletEventsHelpersFactory","leafletData",function(a,b,c,d,e,f){var g=d.safeApply,h=e,i=function(){h.call(this,"leafletDirectiveGeoJson","geojson")};return i.prototype=new h,i.prototype.genDispatchEvent=function(b,c,d,e,i,j,k,l,m){var n=h.prototype.genDispatchEvent.call(this,b,c,d,e,i,j,k,l),o=this;return function(b){"mouseout"===c&&(m.resetStyleOnMouseout&&f.getGeoJSON(m.mapId).then(function(a){(l?a[l]:a).resetStyle(b.target)}),g(e,function(){a.$broadcast(o.rootBroadcastName+".mouseout",b)})),n(b)}},i.prototype.getAvailableEvents=function(){return["click","dblclick","mouseover","mouseout"]},new i}]),angular.module("leaflet-directive").factory("leafletLabelEvents",["$rootScope","$q","$log","leafletHelpers","LeafletEventsHelpersFactory",function(a,b,c,d,e){var f=d,g=e,h=function(){g.call(this,"leafletDirectiveLabel","markers")};return h.prototype=new g,h.prototype.genDispatchEvent=function(a,b,c,d,e,f,h,i){var j=f.replace("markers.","");return g.prototype.genDispatchEvent.call(this,a,b,c,d,e,j,h,i)},h.prototype.getAvailableEvents=function(){return["click","dblclick","mousedown","mouseover","mouseout","contextmenu"]},h.prototype.genEvents=function(a,b,c,d,e,g,h,i){var j=this,k=this.getAvailableEvents(),l=f.getObjectArrayPath("markers."+g);k.forEach(function(b){e.label.on(b,j.genDispatchEvent(a,b,c,d,e.label,l,h,i))})},h.prototype.bindEvents=function(){},new h}]),angular.module("leaflet-directive").factory("leafletMapEvents",["$rootScope","$q","$log","leafletHelpers","leafletEventsHelpers","leafletIterators",function(a,b,c,d,e,f){var g=d.isDefined,h=e.fire,i=function(){return["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","contextmenu","focus","blur","preclick","load","unload","viewreset","movestart","move","moveend","dragstart","drag","dragend","zoomstart","zoomanim","zoomend","zoomlevelschange","resize","autopanstart","layeradd","layerremove","baselayerchange","overlayadd","overlayremove","locationfound","locationerror","popupopen","popupclose","draw:created","draw:edited","draw:deleted","draw:drawstart","draw:drawstop","draw:editstart","draw:editstop","draw:deletestart","draw:deletestop"]},j=function(a,b,d,e){return e&&(e+="."),function(f){var g="leafletDirectiveMap."+e+b;c.debug(g),h(a,g,d,f,f.target,a)}};return{getAvailableMapEvents:i,genDispatchMapEvent:j,notifyCenterChangedToBounds:function(a){a.$broadcast("boundsChanged")},notifyCenterUrlHashChanged:function(a,b,c,d){if(g(c.urlHashCenter)){var e=b.getCenter(),f=e.lat.toFixed(4)+":"+e.lng.toFixed(4)+":"+b.getZoom();g(d.c)&&d.c===f||a.$emit("centerUrlHash",f)}},addEvents:function(a,b,c,d,e){f.each(b,function(b){var f={};f[c]=b,a.on(b,j(d,b,e,a._container.id||""),f)})}}}]),angular.module("leaflet-directive").factory("leafletMarkerEvents",["$rootScope","$q","$log","leafletHelpers","LeafletEventsHelpersFactory","leafletLabelEvents",function(a,b,c,d,e,f){var g=d.safeApply,h=d.isDefined,i=d,j=f,k=e,l=function(){k.call(this,"leafletDirectiveMarker","markers")};return l.prototype=new k,l.prototype.genDispatchEvent=function(b,c,d,e,f,h,i,j){var l=k.prototype.genDispatchEvent.call(this,b,c,d,e,f,h,i,j);return function(b){"click"===c?g(e,function(){a.$broadcast("leafletDirectiveMarkersClick",h)}):"dragend"===c&&(g(e,function(){i.lat=f.getLatLng().lat,i.lng=f.getLatLng().lng}),i.message&&!0===i.focus&&f.openPopup()),l(b)}},l.prototype.getAvailableEvents=function(){return["click","dblclick","mousedown","mouseover","mouseout","contextmenu","dragstart","drag","dragend","move","remove","popupopen","popupclose","touchend","touchstart","touchmove","touchcancel","touchleave"]},l.prototype.bindEvents=function(a,b,c,d,e,f){var g=k.prototype.bindEvents.call(this,a,b,c,d,e,f);i.LabelPlugin.isLoaded()&&h(b.label)&&j.genEvents(a,c,g,e,b,d,f)},new l}]),angular.module("leaflet-directive").factory("leafletPathEvents",["$rootScope","$q","$log","leafletHelpers","leafletLabelEvents","leafletEventsHelpers",function(a,b,c,d,e,f){var g=d.isDefined,h=d.isObject,i=d,j=d.errorHeader,k=e,l=f.fire,m=function(a,b,d,e,f,g,h,i){return a=a||"",a&&(a="."+a),function(j){var k="leafletDirectivePath"+a+"."+b;c.debug(k),l(e,k,d,j,j.target||f,h,g,i)}},n=function(a,b,d,e,f){var l,n,p=[],q="broadcast";if(g(f.eventBroadcast))if(h(f.eventBroadcast))if(g(f.eventBroadcast.path))if(h(f.eventBroadcast.paths))c.warn(j+"event-broadcast.path must be an object check your model.");else{void 0!==f.eventBroadcast.path.logic&&null!==f.eventBroadcast.path.logic&&("emit"!==f.eventBroadcast.path.logic&&"broadcast"!==f.eventBroadcast.path.logic?c.warn(j+"Available event propagation logic are: 'emit' or 'broadcast'."):"emit"===f.eventBroadcast.path.logic&&(q="emit"));var r=!1,s=!1;if(void 0!==f.eventBroadcast.path.enable&&null!==f.eventBroadcast.path.enable&&"object"==typeof f.eventBroadcast.path.enable&&(r=!0),void 0!==f.eventBroadcast.path.disable&&null!==f.eventBroadcast.path.disable&&"object"==typeof f.eventBroadcast.path.disable&&(s=!0),r&&s)c.warn(j+"can not enable and disable events at the same time");else if(r||s)if(r)for(l=0;l0)for(c in Wc)d=Wc[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),!1===Xc&&(Xc=!0,a.updateOffset(this),Xc=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(){}function u(a){return a?a.toLowerCase().replace("_","-"):a}function v(a){for(var b,c,d,e,f=0;f0;){if(d=w(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function w(a){var b=null;if(!Yc[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Vc._abbr,require("./locale/"+a),x(b)}catch(c){}return Yc[a]}function x(a,b){var c;return a&&(c=m(b)?z(a):y(a,b))&&(Vc=c),Vc._abbr}function y(a,b){return null!==b?(b.abbr=a,Yc[a]=Yc[a]||new t,Yc[a].set(b),x(a),Yc[a]):(delete Yc[a],null)}function z(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Vc;if(!c(a)){if(b=w(a))return b;a=[a]}return v(a)}function A(a,b){var c=a.toLowerCase();Zc[c]=Zc[c+"s"]=Zc[b]=a}function B(a){return"string"==typeof a?Zc[a]||Zc[a.toLowerCase()]:void 0}function C(a){var b,c,d={};for(c in a)f(a,c)&&(b=B(c))&&(d[b]=a[c]);return d}function D(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function E(b,c){return function(d){return null!=d?(G(this,b,d),a.updateOffset(this,c),this):F(this,b)}}function F(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function G(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function H(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=B(a),D(this[a]))return this[a](b);return this}function I(a,b,c){var d=""+Math.abs(a),e=b-d.length;return(a>=0?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function J(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(bd[a]=e),b&&(bd[b[0]]=function(){return I(e.apply(this,arguments),b[1],b[2])}),c&&(bd[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function K(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function L(a){var b,c,d=a.match($c);for(b=0,c=d.length;c>b;b++)bd[d[b]]?d[b]=bd[d[b]]:d[b]=K(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function M(a,b){return a.isValid()?(b=N(b,a.localeData()),ad[b]=ad[b]||L(b),ad[b](a)):a.localeData().invalidDate()}function N(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(_c.lastIndex=0;d>=0&&_c.test(a);)a=a.replace(_c,c),_c.lastIndex=0,d-=1;return a} function O(a,b,c){td[a]=D(b)?b:function(a,d){return a&&c?c:b}}function P(a,b){return f(td,a)?td[a](b._strict,b._locale):new RegExp(Q(a))}function Q(a){return R(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function R(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function S(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;cd;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function Z(a,b){var c;return a.isValid()?"string"==typeof b&&"number"!=typeof(b=a.localeData().monthsParse(b))?a:(c=Math.min(a.date(),V(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a):a}function $(b){return null!=b?(Z(this,b),a.updateOffset(this,!0),this):F(this,"Month")}function _(){return V(this.year(),this.month())}function aa(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ba(a){return this._monthsParseExact?(f(this,"_monthsRegex")||ca.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function ca(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=R(d[b]),e[b]=R(e[b]),f[b]=R(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")$","i")}function da(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[wd]<0||c[wd]>11?wd:c[xd]<1||c[xd]>V(c[vd],c[wd])?xd:c[yd]<0||c[yd]>24||24===c[yd]&&(0!==c[zd]||0!==c[Ad]||0!==c[Bd])?yd:c[zd]<0||c[zd]>59?zd:c[Ad]<0||c[Ad]>59?Ad:c[Bd]<0||c[Bd]>999?Bd:-1,j(a)._overflowDayOfYear&&(vd>b||b>xd)&&(b=xd),j(a)._overflowWeeks&&-1===b&&(b=Cd),j(a)._overflowWeekday&&-1===b&&(b=Dd),j(a).overflow=b),a}function ea(b){!1===a.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function fa(a,b){var c=!0;return g(function(){return c&&(ea(a+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),c=!1),b.apply(this,arguments)},b)}function ga(a,b){Jd[a]||(ea(b),Jd[a]=!0)}function ha(a){var b,c,d,e,f,g,h=a._i,i=Kd.exec(h)||Ld.exec(h);if(i){for(j(a).iso=!0,b=0,c=Nd.length;c>b;b++)if(Nd[b][1].exec(i[1])){e=Nd[b][0],d=!1!==Nd[b][2];break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=Od.length;c>b;b++)if(Od[b][1].exec(i[3])){f=(i[2]||" ")+Od[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Md.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),wa(a)}else a._isValid=!1}function ia(b){var c=Pd.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(ha(b),void(!1===b._isValid&&(delete b._isValid,a.createFromInputFallback(b))))}function ja(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function ka(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function la(a){return ma(a)?366:365}function ma(a){return a%4==0&&a%100!=0||a%400==0}function na(){return ma(this.year())}function oa(a,b,c){var d=7+b-c;return-(7+ka(a,0,d).getUTCDay()-b)%7+d-1}function pa(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=oa(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=la(f)+j):j>la(a)?(f=a+1,g=j-la(a)):(f=a,g=j),{year:f,dayOfYear:g}}function qa(a,b,c){var d,e,f=oa(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+ra(e,b,c)):g>ra(a.year(),b,c)?(d=g-ra(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function ra(a,b,c){var d=oa(a,b,c),e=oa(a+1,b,c);return(la(a)-d+e)/7}function sa(a,b,c){return null!=a?a:null!=b?b:c}function ta(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function ua(a){var b,c,d,e,f=[];if(!a._d){for(d=ta(a),a._w&&null==a._a[xd]&&null==a._a[wd]&&va(a),a._dayOfYear&&(e=sa(a._a[vd],d[vd]),a._dayOfYear>la(e)&&(j(a)._overflowDayOfYear=!0),c=ka(e,0,a._dayOfYear),a._a[wd]=c.getUTCMonth(),a._a[xd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[yd]&&0===a._a[zd]&&0===a._a[Ad]&&0===a._a[Bd]&&(a._nextDay=!0,a._a[yd]=0),a._d=(a._useUTC?ka:ja).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[yd]=24)}}function va(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=sa(b.GG,a._a[vd],qa(Ea(),1,4).year),d=sa(b.W,1),(1>(e=sa(b.E,1))||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=sa(b.gg,a._a[vd],qa(Ea(),f,g).year),d=sa(b.w,1),null!=b.d?(0>(e=b.d)||e>6)&&(i=!0):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>ra(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=pa(c,d,e,f,g),a._a[vd]=h.year,a._dayOfYear=h.dayOfYear)}function wa(b){if(b._f===a.ISO_8601)return void ha(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=N(b._f,b._locale).match($c)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),bd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),U(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),!0===j(b).bigHour&&b._a[yd]<=12&&b._a[yd]>0&&(j(b).bigHour=void 0),b._a[yd]=xa(b._locale,b._a[yd],b._meridiem),ua(b),da(b)}function xa(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function ya(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function za(a){if(!a._d){var b=C(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),ua(a)}}function Aa(a){var b=new o(da(Ba(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ba(a){var b=a._i,e=a._f;return a._locale=a._locale||z(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(da(b)):(c(e)?ya(a):e?wa(a):d(b)?a._d=b:Ca(a),k(a)||(a._d=null),a))}function Ca(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(+f):"string"==typeof f?ia(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ua(b)):"object"==typeof f?za(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Da(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Aa(f)}function Ea(a,b,c,d){return Da(a,b,c,d,!1)}function Fa(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ea();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+I(~~(a/60),2)+b+I(~~a%60,2)})}function La(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(Ud)||["-",0,0],f=60*e[1]+r(e[2]);return"+"===e[0]?f:-f}function Ma(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?+b:+Ea(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Ea(b).local()}function Na(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Oa(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=La(qd,b):Math.abs(b)<16&&(b*=60),!this._isUTC&&c&&(d=Na(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?cb(this,Za(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Na(this):null!=b?this:NaN}function Pa(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Qa(a){return this.utcOffset(0,a)}function Ra(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Na(this),"m")),this}function Sa(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(La(pd,this._i)),this}function Ta(a){return!!this.isValid()&&(a=a?Ea(a).utcOffset():0,(this.utcOffset()-a)%60==0)}function Ua(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Va(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ba(a),a._a){var b=a._isUTC?h(a._a):Ea(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function Wa(){return!!this.isValid()&&!this._isUTC}function Xa(){return!!this.isValid()&&this._isUTC}function Ya(){return!!this.isValid()&&(this._isUTC&&0===this._offset)}function Za(a,b){var c,d,e,g=a,h=null;return Ja(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=Vd.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[xd])*c,h:r(h[yd])*c,m:r(h[zd])*c,s:r(h[Ad])*c,ms:r(h[Bd])*c}):(h=Wd.exec(a))?(c="-"===h[1]?-1:1,g={y:$a(h[2],c),M:$a(h[3],c),d:$a(h[4],c),h:$a(h[5],c),m:$a(h[6],c),s:$a(h[7],c),w:$a(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=ab(Ea(g.from),Ea(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ia(g),Ja(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function $a(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function _a(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function ab(a,b){var c;return a.isValid()&&b.isValid()?(b=Ma(b,a),a.isBefore(b)?c=_a(a,b):(c=_a(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function bb(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(ga(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Za(c,d),cb(this,e,a),this}}function cb(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;b.isValid()&&(e=null==e||e,f&&b._d.setTime(+b._d+f*d),g&&G(b,"Date",F(b,"Date")+g*d),h&&Z(b,F(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function db(a,b){var c=a||Ea(),d=Ma(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(D(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ea(c)))}function eb(){return new o(this)}function fb(a,b){var c=p(a)?a:Ea(a);return!(!this.isValid()||!c.isValid())&&(b=B(m(b)?"millisecond":b),"millisecond"===b?+this>+c:+c<+this.clone().startOf(b))}function gb(a,b){var c=p(a)?a:Ea(a);return!(!this.isValid()||!c.isValid())&&(b=B(m(b)?"millisecond":b),"millisecond"===b?+c>+this:+this.clone().endOf(b)<+c)}function hb(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function ib(a,b){var c,d=p(a)?a:Ea(a);return!(!this.isValid()||!d.isValid())&&(b=B(b||"millisecond"),"millisecond"===b?+this==+d:(c=+d,+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b)))}function jb(a,b){return this.isSame(a,b)||this.isAfter(a,b)}function kb(a,b){return this.isSame(a,b)||this.isBefore(a,b)}function lb(a,b,c){var d,e,f,g;return this.isValid()?(d=Ma(a,this),d.isValid()?(e=6e4*(d.utcOffset()-this.utcOffset()),b=B(b),"year"===b||"month"===b||"quarter"===b?(g=mb(this,d),"quarter"===b?g/=3:"year"===b&&(g/=12)):(f=this-d,g="second"===b?f/1e3:"minute"===b?f/6e4:"hour"===b?f/36e5:"day"===b?(f-e)/864e5:"week"===b?(f-e)/6048e5:f),c?g:q(g)):NaN):NaN}function mb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function nb(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function ob(){var a=this.clone().utc();return 0f&&(b=f),Ob.call(this,a,b,c,d,e))}function Ob(a,b,c,d,e){var f=pa(a,b,c,d,e),g=ka(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Pb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Qb(a){return qa(a,this._week.dow,this._week.doy).week}function Rb(){return this._week.dow}function Sb(){return this._week.doy}function Tb(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function Ub(a){var b=qa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function Vb(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function Wb(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function Xb(a){return this._weekdaysShort[a.day()]}function Yb(a){return this._weekdaysMin[a.day()]}function Zb(a,b,c){var d,e,f;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=Ea([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function $b(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Vb(a,this.localeData()),this.add(a-b,"d")):b}function _b(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function ac(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function bc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function cc(){return this.hours()%12||12}function dc(a,b){J(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function ec(a,b){return b._meridiemParse}function fc(a){return"p"===(a+"").toLowerCase().charAt(0)}function gc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function hc(a,b){b[Bd]=r(1e3*("0."+a))}function ic(){return this._isUTC?"UTC":""}function jc(){return this._isUTC?"Coordinated Universal Time":""}function kc(a){return Ea(1e3*a)}function lc(){return Ea.apply(null,arguments).parseZone()}function mc(a,b,c){var d=this._calendar[a];return D(d)?d.call(b,c):d}function nc(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function oc(){return this._invalidDate}function pc(a){return this._ordinal.replace("%d",a)}function qc(a){return a}function rc(a,b,c,d){var e=this._relativeTime[c];return D(e)?e(a,b,c,d):e.replace(/%d/i,a)}function sc(a,b){var c=this._relativeTime[a>0?"future":"past"];return D(c)?c(b):c.replace(/%s/i,b)}function tc(a){var b,c;for(c in a)b=a[c],D(b)?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function uc(a,b,c,d){var e=z(),f=h().set(d,b);return e[c](f,a)}function vc(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return uc(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=uc(a,f,c,e);return g}function wc(a,b){return vc(a,b,"months",12,"month")}function xc(a,b){return vc(a,b,"monthsShort",12,"month")}function yc(a,b){return vc(a,b,"weekdays",7,"day")}function zc(a,b){return vc(a,b,"weekdaysShort",7,"day")}function Ac(a,b){return vc(a,b,"weekdaysMin",7,"day")}function Bc(){var a=this._data;return this._milliseconds=se(this._milliseconds),this._days=se(this._days),this._months=se(this._months),a.milliseconds=se(a.milliseconds),a.seconds=se(a.seconds),a.minutes=se(a.minutes),a.hours=se(a.hours),a.months=se(a.months),a.years=se(a.years),this}function Cc(a,b,c,d){var e=Za(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Dc(a,b){return Cc(this,a,b,1)}function Ec(a,b){return Cc(this,a,b,-1)}function Fc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Gc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Fc(Ic(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Hc(g)),h+=e,g-=Fc(Ic(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Hc(a){return 4800*a/146097}function Ic(a){return 146097*a/4800}function Jc(a){var b,c,d=this._milliseconds;if("month"===(a=B(a))||"year"===a)return b=this._days+d/864e5,c=this._months+Hc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Ic(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Kc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Lc(a){return function(){return this.as(a)}}function Mc(a){return a=B(a),this[a+"s"]()}function Nc(a){return function(){return this._data[a]}}function Oc(){return q(this.days()/7)}function Pc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function Qc(a,b,c){var d=Za(a).abs(),e=Ie(d.as("s")),f=Ie(d.as("m")),g=Ie(d.as("h")),h=Ie(d.as("d")),i=Ie(d.as("M")),j=Ie(d.as("y")),k=e=f&&["m"]||f=g&&["h"]||g=h&&["d"]||h=i&&["M"]||i=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,Pc.apply(null,k)}function Rc(a,b){return void 0!==Je[a]&&(void 0===b?Je[a]:(Je[a]=b,!0))}function Sc(a){var b=this.localeData(),c=Qc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Tc(){var a,b,c,d=Ke(this._milliseconds)/1e3,e=Ke(this._days),f=Ke(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var Uc,Vc,Wc=a.momentProperties=[],Xc=!1,Yc={},Zc={},$c=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,_c=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ad={},bd={},cd=/\d/,dd=/\d\d/,ed=/\d{3}/,fd=/\d{4}/,gd=/[+-]?\d{6}/,hd=/\d\d?/,id=/\d\d\d\d?/,jd=/\d\d\d\d\d\d?/,kd=/\d{1,3}/,ld=/\d{1,4}/,md=/[+-]?\d{1,6}/,nd=/\d+/,od=/[+-]?\d+/,pd=/Z|[+-]\d\d:?\d\d/gi,qd=/Z|[+-]\d\d(?::?\d\d)?/gi,rd=/[+-]?\d+(\.\d{1,3})?/,sd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,td={},ud={},vd=0,wd=1,xd=2,yd=3,zd=4,Ad=5,Bd=6,Cd=7,Dd=8;J("M",["MM",2],"Mo",function(){return this.month()+1}),J("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),J("MMMM",0,0,function(a){return this.localeData().months(this,a)}),A("month","M"),O("M",hd),O("MM",hd,dd),O("MMM",function(a,b){return b.monthsShortRegex(a)}),O("MMMM",function(a,b){return b.monthsRegex(a)}),S(["M","MM"],function(a,b){b[wd]=r(a)-1}),S(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[wd]=e:j(c).invalidMonth=a});var Ed=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Fd="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Gd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Hd=sd,Id=sd,Jd={};a.suppressDeprecationWarnings=!1;var Kd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Ld=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Md=/Z|[+-]\d\d(?::?\d\d)?/,Nd=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],Od=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Pd=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=fa("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),J("Y",0,0,function(){var a=this.year();return 9999>=a?""+a:"+"+a}),J(0,["YY",2],0,function(){return this.year()%100}),J(0,["YYYY",4],0,"year"),J(0,["YYYYY",5],0,"year"),J(0,["YYYYYY",6,!0],0,"year"),A("year","y"),O("Y",od),O("YY",hd,dd),O("YYYY",ld,fd),O("YYYYY",md,gd),O("YYYYYY",md,gd),S(["YYYYY","YYYYYY"],vd),S("YYYY",function(b,c){c[vd]=2===b.length?a.parseTwoDigitYear(b):r(b)}),S("YY",function(b,c){c[vd]=a.parseTwoDigitYear(b)}),S("Y",function(a,b){b[vd]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var Qd=E("FullYear",!1);a.ISO_8601=function(){};var Rd=fa("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),Sd=fa("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ea.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),Td=function(){return Date.now?Date.now():+new Date};Ka("Z",":"),Ka("ZZ",""),O("Z",qd),O("ZZ",qd),S(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=La(qd,a)});var Ud=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var Vd=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,Wd=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Za.fn=Ia.prototype;var Xd=bb(1,"add"),Yd=bb(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var Zd=fa("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});J(0,["gg",2],0,function(){return this.weekYear()%100}),J(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ib("gggg","weekYear"),Ib("ggggg","weekYear"),Ib("GGGG","isoWeekYear"),Ib("GGGGG","isoWeekYear"),A("weekYear","gg"),A("isoWeekYear","GG"),O("G",od),O("g",od),O("GG",hd,dd),O("gg",hd,dd),O("GGGG",ld,fd),O("gggg",ld,fd),O("GGGGG",md,gd),O("ggggg",md,gd),T(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),T(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),J("Q",0,"Qo","quarter"),A("quarter","Q"),O("Q",cd),S("Q",function(a,b){b[wd]=3*(r(a)-1)}),J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),A("week","w"),A("isoWeek","W"),O("w",hd),O("ww",hd,dd),O("W",hd),O("WW",hd,dd),T(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var $d={dow:0,doy:6};J("D",["DD",2],"Do","date"),A("date","D"),O("D",hd),O("DD",hd,dd),O("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),S(["D","DD"],xd),S("Do",function(a,b){b[xd]=r(a.match(hd)[0],10)});var _d=E("Date",!0);J("d",0,"do","day"),J("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),J("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),J("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),A("day","d"),A("weekday","e"),A("isoWeekday","E"),O("d",hd),O("e",hd),O("E",hd),O("dd",sd),O("ddd",sd),O("dddd",sd),T(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),T(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var ae="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),be="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ce="Su_Mo_Tu_We_Th_Fr_Sa".split("_");J("DDD",["DDDD",3],"DDDo","dayOfYear"),A("dayOfYear","DDD"),O("DDD",kd),O("DDDD",ed),S(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),J("H",["HH",2],0,"hour"),J("h",["hh",2],0,cc),J("hmm",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)}),J("hmmss",0,0,function(){return""+cc.apply(this)+I(this.minutes(),2)+I(this.seconds(),2)}),J("Hmm",0,0,function(){return""+this.hours()+I(this.minutes(),2)}),J("Hmmss",0,0,function(){return""+this.hours()+I(this.minutes(),2)+I(this.seconds(),2)}),dc("a",!0),dc("A",!1),A("hour","h"),O("a",ec),O("A",ec),O("H",hd),O("h",hd),O("HH",hd,dd),O("hh",hd,dd),O("hmm",id),O("hmmss",jd),O("Hmm",id),O("Hmmss",jd),S(["H","HH"],yd),S(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),S(["h","hh"],function(a,b,c){b[yd]=r(a),j(c).bigHour=!0}),S("hmm",function(a,b,c){var d=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d)),j(c).bigHour=!0}),S("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d,2)),b[Ad]=r(a.substr(e)),j(c).bigHour=!0}),S("Hmm",function(a,b,c){var d=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d))}),S("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[yd]=r(a.substr(0,d)),b[zd]=r(a.substr(d,2)),b[Ad]=r(a.substr(e))});var de=/[ap]\.?m?\.?/i,ee=E("Hours",!0);J("m",["mm",2],0,"minute"),A("minute","m"),O("m",hd),O("mm",hd,dd),S(["m","mm"],zd);var fe=E("Minutes",!1);J("s",["ss",2],0,"second"),A("second","s"),O("s",hd),O("ss",hd,dd),S(["s","ss"],Ad);var ge=E("Seconds",!1);J("S",0,0,function(){return~~(this.millisecond()/100)}),J(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,function(){return 10*this.millisecond()}),J(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),J(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),J(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),J(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),J(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),A("millisecond","ms"),O("S",kd,cd),O("SS",kd,dd),O("SSS",kd,ed);var he;for(he="SSSS";he.length<=9;he+="S")O(he,nd);for(he="S";he.length<=9;he+="S")S(he,hc);var ie=E("Milliseconds",!1);J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");var je=o.prototype;je.add=Xd,je.calendar=db,je.clone=eb,je.diff=lb,je.endOf=xb,je.format=pb,je.from=qb,je.fromNow=rb,je.to=sb,je.toNow=tb,je.get=H,je.invalidAt=Gb,je.isAfter=fb,je.isBefore=gb,je.isBetween=hb,je.isSame=ib,je.isSameOrAfter=jb,je.isSameOrBefore=kb,je.isValid=Eb,je.lang=Zd,je.locale=ub, je.localeData=vb,je.max=Sd,je.min=Rd,je.parsingFlags=Fb,je.set=H,je.startOf=wb,je.subtract=Yd,je.toArray=Bb,je.toObject=Cb,je.toDate=Ab,je.toISOString=ob,je.toJSON=Db,je.toString=nb,je.unix=zb,je.valueOf=yb,je.creationData=Hb,je.year=Qd,je.isLeapYear=na,je.weekYear=Jb,je.isoWeekYear=Kb,je.quarter=je.quarters=Pb,je.month=$,je.daysInMonth=_,je.week=je.weeks=Tb,je.isoWeek=je.isoWeeks=Ub,je.weeksInYear=Mb,je.isoWeeksInYear=Lb,je.date=_d,je.day=je.days=$b,je.weekday=_b,je.isoWeekday=ac,je.dayOfYear=bc,je.hour=je.hours=ee,je.minute=je.minutes=fe,je.second=je.seconds=ge,je.millisecond=je.milliseconds=ie,je.utcOffset=Oa,je.utc=Qa,je.local=Ra,je.parseZone=Sa,je.hasAlignedHourOffset=Ta,je.isDST=Ua,je.isDSTShifted=Va,je.isLocal=Wa,je.isUtcOffset=Xa,je.isUtc=Ya,je.isUTC=Ya,je.zoneAbbr=ic,je.zoneName=jc,je.dates=fa("dates accessor is deprecated. Use date instead.",_d),je.months=fa("months accessor is deprecated. Use month instead",$),je.years=fa("years accessor is deprecated. Use year instead",Qd),je.zone=fa("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Pa);var ke=je,le={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},me={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},pe=/\d{1,2}/,qe={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},re=t.prototype;re._calendar=le,re.calendar=mc,re._longDateFormat=me,re.longDateFormat=nc,re._invalidDate="Invalid date",re.invalidDate=oc,re._ordinal="%d",re.ordinal=pc,re._ordinalParse=pe,re.preparse=qc,re.postformat=qc,re._relativeTime=qe,re.relativeTime=rc,re.pastFuture=sc,re.set=tc,re.months=W,re._months=Fd,re.monthsShort=X,re._monthsShort=Gd,re.monthsParse=Y,re._monthsRegex=Id,re.monthsRegex=ba,re._monthsShortRegex=Hd,re.monthsShortRegex=aa,re.week=Qb,re._week=$d,re.firstDayOfYear=Sb,re.firstDayOfWeek=Rb,re.weekdays=Wb,re._weekdays=ae,re.weekdaysMin=Yb,re._weekdaysMin=ce,re.weekdaysShort=Xb,re._weekdaysShort=be,re.weekdaysParse=Zb,re.isPM=fc,re._meridiemParse=de,re.meridiem=gc,x("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10;return a+(1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th")}}),a.lang=fa("moment.lang is deprecated. Use moment.locale instead.",x),a.langData=fa("moment.langData is deprecated. Use moment.localeData instead.",z);var se=Math.abs,te=Lc("ms"),ue=Lc("s"),ve=Lc("m"),we=Lc("h"),xe=Lc("d"),ye=Lc("w"),ze=Lc("M"),Ae=Lc("y"),Be=Nc("milliseconds"),Ce=Nc("seconds"),De=Nc("minutes"),Ee=Nc("hours"),Fe=Nc("days"),Ge=Nc("months"),He=Nc("years"),Ie=Math.round,Je={s:45,m:45,h:22,d:26,M:11},Ke=Math.abs,Le=Ia.prototype;return Le.abs=Bc,Le.add=Dc,Le.subtract=Ec,Le.as=Jc,Le.asMilliseconds=te,Le.asSeconds=ue,Le.asMinutes=ve,Le.asHours=we,Le.asDays=xe,Le.asWeeks=ye,Le.asMonths=ze,Le.asYears=Ae,Le.valueOf=Kc,Le._bubble=Gc,Le.get=Mc,Le.milliseconds=Be,Le.seconds=Ce,Le.minutes=De,Le.hours=Ee,Le.days=Fe,Le.weeks=Oc,Le.months=Ge,Le.years=He,Le.humanize=Sc,Le.toISOString=Tc,Le.toString=Tc,Le.toJSON=Tc,Le.locale=ub,Le.localeData=vb,Le.toIsoString=fa("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Tc),Le.lang=Zd,J("X",0,0,"unix"),J("x",0,0,"valueOf"),O("x",od),O("X",rd),S("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),S("x",function(a,b,c){c._d=new Date(r(a))}),a.version="2.11.2",function(a){Uc=a}(Ea),a.fn=ke,a.min=Ga,a.max=Ha,a.now=Td,a.utc=h,a.unix=kc,a.months=wc,a.isDate=d,a.locale=x,a.invalid=l,a.duration=Za,a.isMoment=p,a.weekdays=yc,a.parseZone=lc,a.localeData=z,a.isDuration=Ja,a.monthsShort=xc,a.weekdaysMin=Ac,a.defineLocale=y,a.weekdaysShort=zc,a.normalizeUnits=B,a.relativeTimeThreshold=Rc,a.prototype=ke,a}),function(){"use strict";function DatePickerCtrl($scope,$mdDialog,$mdMedia,$timeout,currentDate,options){var self=this;this.date=moment(currentDate),this.minDate=options.minDate&&moment(options.minDate).isValid()?moment(options.minDate):null,this.maxDate=options.maxDate&&moment(options.maxDate).isValid()?moment(options.maxDate):null,this.displayFormat=options.displayFormat||"ddd, MMM DD",this.dateFilter=angular.isFunction(options.dateFilter)?options.dateFilter:null,this.selectingYear=!1,this.minDate&&this.maxDate&&this.maxDate.isBefore(this.minDate)&&(this.maxDate=moment(this.minDate).add(1,"days")),this.date&&(this.minDate&&this.date.isBefore(this.minDate)&&(this.date=moment(this.minDate)),this.maxDate&&this.date.isAfter(this.maxDate)&&(this.date=moment(this.maxDate))),this.yearItems={currentIndex_:0,PAGE_SIZE:5,START:self.minDate?self.minDate.year():1900,END:self.maxDate?self.maxDate.year():0,getItemAtIndex:function(index){return this.currentIndex_firstDay&&(day={value:i-firstDay,enabled:self.isDayEnabled(moment(self.date).date(i-firstDay).toDate())}),arr.push(day)}return arr},this.isDayEnabled=function(day){return!(this.minDate&&!(this.minDate<=day)||this.maxDate&&!(this.maxDate>=day)||self.dateFilter&&self.dateFilter(day))},this.selectDate=function(dom){self.date.date(dom)},this.nextMonth=function(){self.date.add(1,"months")},this.prevMonth=function(){self.date.subtract(1,"months")},this.updateDaysInMonth=function(){self.daysInMonth=self.getDaysInMonth()},$scope.$watch(function(){return self.date.unix()},function(newValue,oldValue){newValue&&newValue!==oldValue&&self.updateDaysInMonth()}),self.updateDaysInMonth()}function formatValidator(value,format){return!value||angular.isDate(value)||moment(value,format,!0).isValid()}function minDateValidator(value,format,minDate){var minDate=moment(minDate,"YYYY-MM-DD",!0),date=angular.isDate(value)?moment(value):moment(value,format,!0);return!value||angular.isDate(value)||!minDate.isValid()||date.isSameOrAfter(minDate)}function maxDateValidator(value,format,maxDate){var maxDate=moment(maxDate,"YYYY-MM-DD",!0),date=angular.isDate(value)?moment(value):moment(value,format,!0);return!value||angular.isDate(value)||!maxDate.isValid()||date.isSameOrBefore(maxDate)}function filterValidator(value,format,filter){var date=angular.isDate(value)?moment(value):moment(value,format,!0);return!value||angular.isDate(value)||!angular.isFunction(filter)||!filter(date)}function TimePickerCtrl($scope,$mdDialog,time,autoSwitch,$mdMedia){var self=this;this.VIEW_HOURS=1,this.VIEW_MINUTES=2,this.currentView=this.VIEW_HOURS,this.time=moment(time),this.autoSwitch=!!autoSwitch,this.clockHours=parseInt(this.time.format("h")),this.clockMinutes=parseInt(this.time.minutes()),$scope.$mdMedia=$mdMedia,this.switchView=function(){self.currentView=self.currentView==self.VIEW_HOURS?self.VIEW_MINUTES:self.VIEW_HOURS},this.setAM=function(){self.time.hours()>=12&&self.time.hour(self.time.hour()-12)},this.setPM=function(){self.time.hours()<12&&self.time.hour(self.time.hour()+12)},this.cancel=function(){$mdDialog.cancel()},this.confirm=function(){$mdDialog.hide(this.time.toDate())}}function ClockCtrl($scope){var self=this;this.STEP_DEG=30,this.steps=[],this.CLOCK_TYPES={hours:{range:12},minutes:{range:60}},this.getPointerStyle=function(){var divider=1;switch(self.type){case"hours":divider=12;break;case"minutes":divider=60}var degrees=Math.round(self.selected*(360/divider))-180;return{"-webkit-transform":"rotate("+degrees+"deg)","-ms-transform":"rotate("+degrees+"deg)",transform:"rotate("+degrees+"deg)"}},this.setTimeByDeg=function(deg){deg=deg>=360?0:deg;var divider=0;switch(self.type){case"hours":divider=12;break;case"minutes":divider=60}self.setTime(Math.round(divider/360*deg))},this.setTime=function(time,type){switch(this.selected=time,self.type){case"hours":"PM"==self.time.format("A")&&(time+=12),this.time.hours(time);break;case"minutes":time>59&&(time-=60),this.time.minutes(time)}},this.init=function(){switch(self.type=self.type||"hours",self.type){case"hours":for(var i=1;i<=12;i++)self.steps.push(i);self.selected=self.time.hours()||0,self.selected>12&&(self.selected-=12);break;case"minutes":for(var i=5;i<=55;i+=5)self.steps.push(i);self.steps.push(0),self.selected=self.time.minutes()||0}},this.init()}var module=angular.module("mdPickers",["ngMaterial","ngAnimate","ngAria"]);module.config(["$mdIconProvider","mdpIconsRegistry",function($mdIconProvider,mdpIconsRegistry){angular.forEach(mdpIconsRegistry,function(icon,index){$mdIconProvider.icon(icon.id,icon.url)})}]),module.run(["$templateCache","mdpIconsRegistry",function($templateCache,mdpIconsRegistry){angular.forEach(mdpIconsRegistry,function(icon,index){$templateCache.put(icon.url,icon.svg)})}]),module.constant("mdpIconsRegistry",[{id:"mdp-chevron-left",url:"mdp-chevron-left.svg",svg:''},{id:"mdp-chevron-right",url:"mdp-chevron-right.svg",svg:''},{id:"mdp-access-time",url:"mdp-access-time.svg",svg:''},{id:"mdp-event",url:"mdp-event.svg",svg:''}]),module.directive("ngMessage",["$mdUtil",function($mdUtil){return{restrict:"EA",priority:101,compile:function(element){if($mdUtil.getClosest(element,"mdp-time-picker",!0)||$mdUtil.getClosest(element,"mdp-date-picker",!0))return element.toggleClass("md-input-message-animation",!0),{}}}}]),module.provider("$mdpDatePicker",function(){var LABEL_OK="OK",LABEL_CANCEL="Cancel",DISPLAY_FORMAT="ddd, MMM DD";this.setDisplayFormat=function(format){DISPLAY_FORMAT=format},this.setOKButtonLabel=function(label){LABEL_OK=label},this.setCancelButtonLabel=function(label){LABEL_CANCEL=label},this.$get=["$mdDialog",function($mdDialog){return function(currentDate,options){return angular.isDate(currentDate)||(currentDate=Date.now()),angular.isObject(options)||(options={}),options.displayFormat=DISPLAY_FORMAT,$mdDialog.show({controller:["$scope","$mdDialog","$mdMedia","$timeout","currentDate","options",DatePickerCtrl],controllerAs:"datepicker",clickOutsideToClose:!0,template:'
'+(options.dateLabel?''+options.dateLabel+"":"")+'{{ datepicker.date.format(datepicker.displayFormat) }}
{{ item }}
'+LABEL_CANCEL+''+LABEL_OK+"
",targetEvent:options.targetEvent,locals:{currentDate:currentDate,options:options},skipHide:!0})}}]}),module.directive("mdpCalendar",["$animate",function($animate){return{restrict:"E",bindToController:{date:"=",minDate:"=",maxDate:"=",dateFilter:"="},template:'
{{ calendar.date.format("MMMM YYYY") }}
{{ d }}
{{ day.value }}
',controller:["$scope",CalendarCtrl],controllerAs:"calendar",link:function(scope,element,attrs,ctrl){var animElements=[element[0].querySelector(".mdp-calendar-week-days"),element[0].querySelector(".mdp-calendar-days"),element[0].querySelector(".mdp-calendar-monthyear")].map(function(a){return angular.element(a)});scope.$watch(function(){return ctrl.date.format("YYYYMM")},function(newValue,oldValue){var direction=null;if(newValue>oldValue?direction="mdp-animate-next":newValue"},scope:{minDate:"=mdpMinDate",maxDate:"=mdpMaxDate",dateFilter:"=mdpDateFilter",dateFormat:"@mdpFormat",placeholder:"@mdpPlaceholder",noFloat:"=mdpNoFloat",openOnClick:"=mdpOpenOnClick",disabled:"=?mdpDisabled"},link:{pre:function(scope,element,attrs,ngModel,$transclude){},post:function(scope,element,attrs,ngModel,$transclude){function updateInputElement(value){inputElement[0].value=value,inputContainerCtrl.setHasValue(!ngModel.$isEmpty(value))}function updateDate(date){var value=moment(date,angular.isDate(date)?null:scope.dateFormat,!0),strValue=value.format(scope.dateFormat);value.isValid()?(updateInputElement(strValue),ngModel.$setViewValue(strValue)):(updateInputElement(date),ngModel.$setViewValue(date)),!ngModel.$pristine&&messages.hasClass("md-auto-hide")&&inputContainer.hasClass("md-input-invalid")&&messages.removeClass("md-auto-hide"),ngModel.$render()}function onInputElementEvents(event){event.target.value!==ngModel.$viewVaue&&updateDate(event.target.value)}var inputElement=angular.element(element[0].querySelector("input")),inputContainer=angular.element(element[0].querySelector("md-input-container")),inputContainerCtrl=inputContainer.controller("mdInputContainer");$transclude(function(clone){inputContainer.append(clone)});var messages=angular.element(inputContainer[0].querySelector("[ng-messages]"));scope.type=scope.dateFormat?"text":"date",scope.dateFormat=scope.dateFormat||"YYYY-MM-DD",scope.model=ngModel,scope.isError=function(){return!ngModel.$pristine&&!!ngModel.$invalid},ngModel.$formatters.unshift(function(value){var date=angular.isDate(value)&&moment(value);updateInputElement(date&&date.isValid()?date.format(scope.dateFormat):null)}),ngModel.$validators.format=function(modelValue,viewValue){return formatValidator(viewValue,scope.dateFormat)},ngModel.$validators.minDate=function(modelValue,viewValue){return minDateValidator(viewValue,scope.dateFormat,scope.minDate)},ngModel.$validators.maxDate=function(modelValue,viewValue){return maxDateValidator(viewValue,scope.dateFormat,scope.maxDate)},ngModel.$validators.filter=function(modelValue,viewValue){return filterValidator(viewValue,scope.dateFormat,scope.dateFilter)},ngModel.$validators.required=function(modelValue,viewValue){return angular.isUndefined(attrs.required)||!ngModel.$isEmpty(modelValue)||!ngModel.$isEmpty(viewValue)},ngModel.$parsers.unshift(function(value){var parsed=moment(value,scope.dateFormat,!0);if(parsed.isValid()){if(angular.isDate(ngModel.$modelValue)){var originalModel=moment(ngModel.$modelValue);originalModel.year(parsed.year()),originalModel.month(parsed.month()),originalModel.date(parsed.date()),parsed=originalModel}return parsed.toDate()}return null}),scope.showPicker=function(ev){$mdpDatePicker(ngModel.$modelValue,{minDate:scope.minDate,maxDate:scope.maxDate,dateFilter:scope.dateFilter,targetEvent:ev}).then(updateDate)},inputElement.on("reset input blur",onInputElementEvents),scope.$on("$destroy",function(){inputElement.off("reset input blur",onInputElementEvents)})}}}}]),module.directive("mdpDatePicker",["$mdpDatePicker","$timeout",function($mdpDatePicker,$timeout){return{restrict:"A",require:"ngModel",scope:{minDate:"@min",maxDate:"@max",dateFilter:"=mdpDateFilter",dateFormat:"@mdpFormat"},link:function(scope,element,attrs,ngModel,$transclude){function showPicker(ev){$mdpDatePicker(ngModel.$modelValue,{minDate:scope.minDate,maxDate:scope.maxDate,dateFilter:scope.dateFilter,targetEvent:ev}).then(function(time){ngModel.$setViewValue(moment(time).format(scope.format)),ngModel.$render()})}scope.dateFormat=scope.dateFormat||"YYYY-MM-DD",ngModel.$validators.format=function(modelValue,viewValue){return formatValidator(viewValue,scope.format)},ngModel.$validators.minDate=function(modelValue,viewValue){return minDateValidator(viewValue,scope.format,scope.minDate)},ngModel.$validators.maxDate=function(modelValue,viewValue){return maxDateValidator(viewValue,scope.format,scope.maxDate)},ngModel.$validators.filter=function(modelValue,viewValue){return filterValidator(viewValue,scope.format,scope.dateFilter)},element.on("click",showPicker),scope.$on("$destroy",function(){element.off("click",showPicker)})}}}]),module.directive("mdpClock",["$animate","$timeout",function($animate,$timeout){return{restrict:"E",bindToController:{type:"@?",time:"=",autoSwitch:"=?"},replace:!0,template:'
{{ step }}
',controller:["$scope",ClockCtrl],controllerAs:"clock",link:function(scope,element,attrs,ctrl){var timepickerCtrl=(angular.element(element[0].querySelector(".mdp-pointer")),scope.$parent.timepicker),onEvent=function(event){var containerCoords=event.currentTarget.getClientRects()[0],x=event.currentTarget.offsetWidth/2-(event.pageX-containerCoords.left),y=event.pageY-containerCoords.top-event.currentTarget.offsetHeight/2,deg=Math.round(Math.atan2(x,y)*(180/Math.PI));$timeout(function(){ctrl.setTimeByDeg(deg+180),ctrl.autoSwitch&&-1!==["mouseup","click"].indexOf(event.type)&&timepickerCtrl&&timepickerCtrl.switchView()})};element.on("mousedown",function(){element.on("mousemove",onEvent)}),element.on("mouseup",function(e){element.off("mousemove")}),element.on("click",onEvent),scope.$on("$destroy",function(){element.off("click",onEvent),element.off("mousemove",onEvent)})}}}]),module.provider("$mdpTimePicker",function(){var LABEL_OK="OK",LABEL_CANCEL="Cancel";this.setOKButtonLabel=function(label){LABEL_OK=label},this.setCancelButtonLabel=function(label){LABEL_CANCEL=label},this.$get=["$mdDialog",function($mdDialog){return function(time,options){return angular.isDate(time)||(time=Date.now()),angular.isObject(options)||(options={}),$mdDialog.show({controller:["$scope","$mdDialog","time","autoSwitch","$mdMedia",TimePickerCtrl],controllerAs:"timepicker",clickOutsideToClose:!0,template:'
{{ timepicker.time.format("h") }}:{{ timepicker.time.format("mm") }}
AMPM
'+LABEL_CANCEL+''+LABEL_OK+"
",targetEvent:options.targetEvent,locals:{time:time,autoSwitch:options.autoSwitch},skipHide:!0})}}]}),module.directive("mdpTimePicker",["$mdpTimePicker","$timeout",function($mdpTimePicker,$timeout){return{restrict:"E",require:"ngModel",transclude:!0,template:function(element,attrs){var noFloat=angular.isDefined(attrs.mdpNoFloat),placeholder=angular.isDefined(attrs.mdpPlaceholder)?attrs.mdpPlaceholder:"",openOnClick=!!angular.isDefined(attrs.mdpOpenOnClick);return'
"},scope:{timeFormat:"@mdpFormat",placeholder:"@mdpPlaceholder",autoSwitch:"=?mdpAutoSwitch",disabled:"=?mdpDisabled"},link:function(scope,element,attrs,ngModel,$transclude){function updateInputElement(value){inputElement[0].value=value,inputContainerCtrl.setHasValue(!ngModel.$isEmpty(value))}function updateTime(time){var value=moment(time,angular.isDate(time)?null:scope.timeFormat,!0),strValue=value.format(scope.timeFormat);value.isValid()?(updateInputElement(strValue),ngModel.$setViewValue(strValue)):(updateInputElement(time),ngModel.$setViewValue(time)),!ngModel.$pristine&&messages.hasClass("md-auto-hide")&&inputContainer.hasClass("md-input-invalid")&&messages.removeClass("md-auto-hide"),ngModel.$render()}function onInputElementEvents(event){event.target.value!==ngModel.$viewVaue&&updateTime(event.target.value)}var inputElement=angular.element(element[0].querySelector("input")),inputContainer=angular.element(element[0].querySelector("md-input-container")),inputContainerCtrl=inputContainer.controller("mdInputContainer");$transclude(function(clone){inputContainer.append(clone)});var messages=angular.element(inputContainer[0].querySelector("[ng-messages]"));scope.type=scope.timeFormat?"text":"time",scope.timeFormat=scope.timeFormat||"HH:mm",scope.autoSwitch=scope.autoSwitch||!1,scope.$watch(function(){return ngModel.$error},function(newValue,oldValue){inputContainerCtrl.setInvalid(!ngModel.$pristine&&!!Object.keys(ngModel.$error).length)},!0),ngModel.$formatters.unshift(function(value){var time=angular.isDate(value)&&moment(value);updateInputElement(time&&time.isValid()?time.format(scope.timeFormat):null)}),ngModel.$validators.format=function(modelValue,viewValue){return!viewValue||angular.isDate(viewValue)||moment(viewValue,scope.timeFormat,!0).isValid()},ngModel.$validators.required=function(modelValue,viewValue){return angular.isUndefined(attrs.required)||!ngModel.$isEmpty(modelValue)||!ngModel.$isEmpty(viewValue)},ngModel.$parsers.unshift(function(value){var parsed=moment(value,scope.timeFormat,!0);if(parsed.isValid()){if(angular.isDate(ngModel.$modelValue)){var originalModel=moment(ngModel.$modelValue);originalModel.minutes(parsed.minutes()),originalModel.hours(parsed.hours()),originalModel.seconds(parsed.seconds()),parsed=originalModel}return parsed.toDate()}return null}),scope.showPicker=function(ev){$mdpTimePicker(ngModel.$modelValue,{targetEvent:ev,autoSwitch:scope.autoSwitch}).then(function(time){updateTime(time,!0)})},inputElement.on("reset input blur",onInputElementEvents),scope.$on("$destroy",function(){inputElement.off("reset input blur",onInputElementEvents)})}}}]),module.directive("mdpTimePicker",["$mdpTimePicker","$timeout",function($mdpTimePicker,$timeout){return{restrict:"A",require:"ngModel",scope:{timeFormat:"@mdpFormat",autoSwitch:"=?mdpAutoSwitch"},link:function(scope,element,attrs,ngModel,$transclude){function showPicker(ev){$mdpTimePicker(ngModel.$modelValue,{targetEvent:ev,autoSwitch:scope.autoSwitch}).then(function(time){ngModel.$setViewValue(moment(time).format(scope.format)),ngModel.$render()})}scope.format=scope.format||"HH:mm",element.on("click",showPicker),scope.$on("$destroy",function(){element.off("click",showPicker)})}}}])}(),function(window,angular){function mdDateRangePickerDirective($mdDateRangePicker){return{scope:{selectedTemplate:"=",selectedTemplateName:"=",dateStart:"=?",dateEnd:"=?",firstDayOfWeek:"=?",showTemplate:"=?",mdOnSelect:"&",localizationMap:"=?",customTemplates:"=?",disableTemplates:"@",maxRange:"=?",minRange:"=?",onePanel:"=?",isDisabledDate:"&?",format:"=?"}, template:'
{{::day.name}}
{{::day.name}}
',controller:"mdDateRangePickerCtrl",link:function(scope,element,attributes,ctrl){scope.actionByKey=function(eventKey,eventParam,e){switch(eventKey){case"prev":scope.handleClickPrevMonth(e),scope.runIfNotInDigest();break;case"next":scope.handleClickNextMonth(e),scope.runIfNotInDigest();break;case"date1":scope.handleClickDate(e,scope.dates[eventParam])?scope.runIfNotInDigest(scope.triggerChange):scope.runIfNotInDigest();break;case"date2":scope.handleClickDate(e,scope.dates2[eventParam])?scope.runIfNotInDigest(scope.triggerChange):scope.runIfNotInDigest();break;case"TD":scope.handleClickSelectToday(),scope.runIfNotInDigest(scope.triggerChange);break;case"YD":scope.handleClickSelectYesterday(),scope.runIfNotInDigest(scope.triggerChange);break;case"TW":scope.handleClickSelectThisWeek(),scope.runIfNotInDigest(scope.triggerChange);break;case"LW":scope.handleClickSelectLastWeek(),scope.runIfNotInDigest(scope.triggerChange);break;case"TM":scope.handleClickSelectThisMonth(),scope.runIfNotInDigest(scope.triggerChange);break;case"LM":scope.handleClickSelectLastMonth(),scope.runIfNotInDigest(scope.triggerChange);break;case"TY":scope.handleClickSelectThisYear(),scope.runIfNotInDigest(scope.triggerChange);break;case"LY":scope.handleClickSelectLastYear(),scope.runIfNotInDigest(scope.triggerChange)}},scope.runIfNotInDigest=function(operation){null==scope.$root||scope.$root.$$phase||(scope.$apply(),operation&&"function"==typeof operation&&operation())},element.on("click",function(e){var eventKey=e.target.getAttribute("event-key"),eventParam=e.target.getAttribute("event-param");scope.actionByKey(eventKey,eventParam,e)}),scope.triggerChange=function(e){var $dates=$mdDateRangePicker.getSelectedDate(scope.dateStart,scope.dateEnd,scope.isDisabledDate,scope.maxRange,scope.minRange);scope.mdOnSelect&&scope.mdOnSelect({$dates:$dates})}}}}function mdDateRangePickerCtrl($scope,$filter){function selectCustomRange(tmpltKey,tmpltObj){$scope.dateStart=tmpltObj.dateStart,$scope.dateEnd=tmpltObj.dateEnd,$scope.selectedTemplate=tmpltKey,$scope.selectedTemplateName=$scope.selectedDateText()}function getLocalizationVal(val){return null!=$scope.localizationMap&&null!=$scope.localizationMap[val]?$scope.localizationMap[val]:val}function getFirstDayOfWeek(){return-1!==[void 0,null,"",NaN].indexOf($scope.firstDayOfWeek)?START_OF_WEEK:$scope.firstDayOfWeek}function fillDateGrid(currentDate){var ctr,day,dates=[],monthEndDate=(new Date(currentDate.getFullYear(),currentDate.getMonth(),1),new Date(currentDate.getFullYear(),currentDate.getMonth()+1,0)),firstDay=getFirstDayOfWeek();for(ctr=1;ctr<=monthEndDate.getDate();ctr++)dates.push(new Date(currentDate.getFullYear(),currentDate.getMonth(),ctr));for(day=dates[0].getDay(),ctr=0;day!==firstDay;)dates.unshift(new Date(currentDate.getFullYear(),currentDate.getMonth(),ctr)),day=day<=0?6:day-1,ctr--;for(day=(dates[dates.length-1].getDay()+1)%7,ctr=1;day!==firstDay;)dates.push(new Date(currentDate.getFullYear(),currentDate.getMonth()+1,ctr)),day=(day+1)%7,ctr++;return dates}function getDateDiff(date1,date2){if(date1&&date2){var _d1=new Date(date1.getFullYear(),date1.getMonth(),date1.getDate());return new Date(date2.getFullYear(),date2.getMonth(),date2.getDate())-_d1}}function inCurrentMonth(date,isSecondMonth){return isSecondMonth?date.getMonth()===$scope.activeMonth2&&date.getFullYear()===$scope.activeYear2:date.getMonth()===$scope.activeMonth&&date.getFullYear()===$scope.activeYear}function isInMaxRange(date){if(!$scope.dateStart)return!0;if(0!==getDateDiff($scope.dateStart,$scope.dateEnd))return!0;var diff=getDateDiff($scope.dateStart,date);return $scope.maxRange&&Math.abs(Math.ceil(diff/864e5))+1<=$scope.maxRange||!$scope.maxRange}function isInMinRange(date){if(!$scope.dateStart)return!0;if(0!==getDateDiff($scope.dateStart,$scope.dateEnd))return!0;var diff=getDateDiff($scope.dateStart,date);return $scope.minRange&&Math.abs(Math.ceil(diff/864e5))+1!=$scope.minRange||!$scope.minRange}function handleClickDate($event,date){var changed=!1,shouldConfirm=!1;if(0===getDateDiff($scope.dateStart,$scope.dateEnd)){if(0===getDateDiff($scope.dateStart,date))shouldConfirm=!0,changed=!0;else if(!$scope.isDisabledDate||!$scope.isDisabledDate({$date:date})){var diff=getDateDiff($scope.dateStart,date);diff>0?($scope.maxRange&&Math.abs(Math.ceil(diff/864e5))+1<=$scope.maxRange||!$scope.maxRange)&&($scope.minRange&&Math.ceil(diff/864e5)+1!=$scope.minRange||!$scope.minRange)&&($scope.dateEnd=date,shouldConfirm=!0,changed=!0):($scope.maxRange&&Math.abs(Math.ceil(diff/864e5))+1<=$scope.maxRange||!$scope.maxRange)&&($scope.minRange&&Math.abs(Math.ceil(diff/864e5))+1!=$scope.minRange||!$scope.minRange)&&($scope.dateStart=date,shouldConfirm=!0,changed=!0)}}else $scope.isDisabledDate&&$scope.isDisabledDate({$date:date})||($scope.dateStart=date,$scope.dateEnd=date,changed=!0);return changed&&($scope.selectedTemplate=!1,$scope.selectedTemplateName=$scope.selectedDateText()),shouldConfirm}function inSelectedDateRange(date){return!(!$scope.dateStart||!$scope.dateEnd)&&(getDateDiff($scope.dateStart,date)>=0&&0<=getDateDiff(date,$scope.dateEnd))}function updateActiveDate(isSecondMonth){var d=new Date($scope.activeYear,$scope.activeMonth,1),d2=new Date($scope.activeYear2,$scope.activeMonth2,1);isSecondMonth?(d=new Date($scope.activeYear2,$scope.activeMonth2-1,1),$scope.activeYear=d.getFullYear(),$scope.activeMonth=d.getMonth()):(d2=new Date($scope.activeYear,$scope.activeMonth+1,1),$scope.activeYear2=d2.getFullYear(),$scope.activeMonth2=d2.getMonth()),$scope.focusToDate(d)}function handleClickNextMonth($event){var d=new Date($scope.activeDate.getFullYear(),$scope.activeDate.getMonth()+1,1);$scope.focusToDate(d)}function handleClickPrevMonth($event){var d=new Date($scope.activeDate.getFullYear(),$scope.activeDate.getMonth()-1,1);$scope.focusToDate(d)}function handleClickSelectToday(){var d=new Date,d1=new Date(d.getFullYear(),d.getMonth(),d.getDate());$scope.dateStart=d1,$scope.dateEnd=d1,$scope.selectedTemplate="TD",$scope.selectedTemplateName=$scope.selectedDateText()}function handleClickSelectYesterday(){var d=new Date,d1=new Date(d.getFullYear(),d.getMonth(),d.getDate()-1);$scope.dateStart=d1,$scope.dateEnd=d1,$scope.selectedTemplate="YD",$scope.selectedTemplateName=$scope.selectedDateText()}function handleClickSelectThisWeek(){var p=new Date,d=new Date(p.getFullYear(),p.getMonth(),p.getDate()),d1=new Date(d.getFullYear(),d.getMonth(),d.getDate()-(d.getDay()-getFirstDayOfWeek())),d2=new Date(d.getFullYear(),d.getMonth(),d.getDate()+(6-d.getDay()+getFirstDayOfWeek()));$scope.dateStart=d1,$scope.dateEnd=d2,$scope.selectedTemplate="TW",$scope.selectedTemplateName=$scope.selectedDateText()}function handleClickSelectLastWeek(){var p=new Date,d=new Date(p.getFullYear(),p.getMonth(),p.getDate()-7),d1=new Date(d.getFullYear(),d.getMonth(),d.getDate()-(d.getDay()-getFirstDayOfWeek())),d2=new Date(d.getFullYear(),d.getMonth(),d.getDate()+(6-d.getDay()+getFirstDayOfWeek()));$scope.dateStart=d1,$scope.dateEnd=d2,$scope.selectedTemplate="LW",$scope.selectedTemplateName=$scope.selectedDateText()}function handleClickSelectThisMonth(){var d=new Date,d1=new Date(d.getFullYear(),d.getMonth(),1),d2=new Date(d.getFullYear(),d.getMonth()+1,0);$scope.dateStart=d1,$scope.dateEnd=d2,$scope.selectedTemplate="TM",$scope.selectedTemplateName=$scope.selectedDateText()}function handleClickSelectLastMonth(){var p=new Date,d=new Date(p.getFullYear(),p.getMonth(),0),d1=new Date(d.getFullYear(),d.getMonth(),1),d2=new Date(d.getFullYear(),d.getMonth()+1,0);$scope.dateStart=d1,$scope.dateEnd=d2,$scope.selectedTemplate="LM",$scope.selectedTemplateName=$scope.selectedDateText()}function handleClickSelectThisYear(){var d=new Date,d1=new Date(d.getFullYear(),0,1),d2=new Date(d.getFullYear(),11,31);$scope.dateStart=d1,$scope.dateEnd=d2,$scope.selectedTemplate="TY",$scope.selectedTemplateName=$scope.selectedDateText()}function handleClickSelectLastYear(){var d=new Date,d1=new Date(d.getFullYear()-1,0,1),d2=new Date(d.getFullYear()-1,11,31);$scope.dateStart=d1,$scope.dateEnd=d2,$scope.selectedTemplate="LY",$scope.selectedTemplateName=$scope.selectedDateText()}function isSelectedStartDate(date){return 0===getDateDiff($scope.dateStart,date)}function isSelectedEndDate(date){return 0===getDateDiff($scope.dateEnd,date)}function isToday(date){return 0===getDateDiff(date,new Date)}function selectedDateText(){return $scope.format&&"function"==typeof $scope.format?$scope.format($scope.dateStart,$scope.dateEnd,$scope.selectedTemplate,$scope.selectedTemplateName):$scope.dateStart&&$scope.dateEnd?$scope.selectedTemplate?null!=SELECTION_TEMPLATES_CUSTOM&&null!=SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate]?SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate].name:SELECTION_TEMPLATES[$scope.selectedTemplate]:0===getDateDiff($scope.dateStart,$scope.dateEnd)?$filter("date")($scope.dateStart,"dd MMM yyyy"):$filter("date")($scope.dateStart,"dd"+($scope.dateStart.getMonth()!==$scope.dateEnd.getMonth()||$scope.dateStart.getFullYear()!==$scope.dateEnd.getFullYear()?" MMM":"")+($scope.dateStart.getFullYear()!==$scope.dateEnd.getFullYear()?" yyyy":""))+" - "+$filter("date")($scope.dateEnd,"dd MMM yyyy"):""}function focusToDate(d){var d2=new Date(d.getFullYear(),d.getMonth()+1,1);$scope.activeDate=d,$scope.activeMonth=d.getMonth(),$scope.activeYear=d.getFullYear(),$scope.activeDate2=d2,$scope.activeMonth2=d2.getMonth(),$scope.activeYear2=d2.getFullYear(),$scope.dates=fillDateGrid(d),$scope.dates2=fillDateGrid(d2)}var SELECTION_TEMPLATES={TD:getLocalizationVal("Today"),YD:getLocalizationVal("Yesterday"),TW:getLocalizationVal("This Week"),LW:getLocalizationVal("Last Week"),TM:getLocalizationVal("This Month"),LM:getLocalizationVal("Last Month"),TY:getLocalizationVal("This Year"),LY:getLocalizationVal("Last Year")},START_OF_WEEK=1;SELECTION_TEMPLATES_CUSTOM={},$scope.isMenuContainer=!1,$scope.days=[],$scope.label="Date range picker",$scope.dates=[],$scope.dates2=[],$scope.numberOfMonthToDisplay=2,$scope.today=new Date,$scope.dateStart&&$scope.dateStart.setHours(0,0,0,0),$scope.dateEnd&&$scope.dateStart.setHours(23,59,59,999),$scope.firstDayOfMonth=$scope.dateStart?new Date($scope.dateStart.getFullYear(),$scope.dateStart.getMonth(),1):Date($scope.today.getFullYear(),$scope.today.getMonth(),1),$scope.lastDayOfMonth=$scope.dateStart?new Date($scope.dateStart.getFullYear(),$scope.dateStart.getMonth()+1,0):Date($scope.today.getFullYear(),$scope.today.getMonth()+1,0),$scope.activeDate=$scope.dateStart||$scope.today,$scope.activeDate2=new Date($scope.activeDate.getFullYear(),$scope.activeDate.getMonth()+1,1),$scope.activeMonth=$scope.activeDate.getMonth(),$scope.activeYear=$scope.activeDate.getFullYear(),$scope.activeMonth2=$scope.activeDate2.getMonth(),$scope.activeYear2=$scope.activeDate2.getFullYear(),$scope.months=[],$scope.years=[],$scope.inCurrentMonth=inCurrentMonth,$scope.isToday=isToday,$scope.handleClickDate=handleClickDate,$scope.inSelectedDateRange=inSelectedDateRange,$scope.isSelectedStartDate=isSelectedStartDate,$scope.isSelectedEndDate=isSelectedEndDate,$scope.updateActiveDate=updateActiveDate,$scope.selectedDateText=selectedDateText,$scope.focusToDate=focusToDate,$scope.handleClickNextMonth=handleClickNextMonth,$scope.handleClickPrevMonth=handleClickPrevMonth,$scope.handleClickSelectToday=handleClickSelectToday,$scope.handleClickSelectYesterday=handleClickSelectYesterday,$scope.handleClickSelectThisWeek=handleClickSelectThisWeek,$scope.handleClickSelectLastWeek=handleClickSelectLastWeek,$scope.handleClickSelectThisMonth=handleClickSelectThisMonth,$scope.handleClickSelectLastMonth=handleClickSelectLastMonth,$scope.handleClickSelectThisYear=handleClickSelectThisYear,$scope.handleClickSelectLastYear=handleClickSelectLastYear,$scope.getLocalizationVal=getLocalizationVal,$scope.selectCustomRange=selectCustomRange,$scope.isInMaxRange=isInMaxRange,$scope.isInMinRange=isInMinRange,$scope.selectionTemplate={},function(){var currTmpl,mctr=0;if(null!=$scope.customTemplates)for(var i=0;i<$scope.customTemplates.length;i++)currTmpl=$scope.customTemplates[i],SELECTION_TEMPLATES_CUSTOM[currTmpl.name]=currTmpl;if($scope.selectedTemplate){switch($scope.selectedTemplate){case"TD":$scope.handleClickSelectToday();break;case"YD":$scope.handleClickSelectYesterday();break;case"TW":$scope.handleClickSelectThisWeek();break;case"LW":$scope.handleClickSelectLastWeek();break;case"TM":$scope.handleClickSelectThisMonth();break;case"LM":$scope.handleClickSelectLastMonth();break;case"TY":$scope.handleClickSelectThisYear();break;case"LY":$scope.handleClickSelectLastYear();break;default:SELECTION_TEMPLATES_CUSTOM&&SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate]&&SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate].dateStart&&SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate].dateEnd&&($scope.dateStart=SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate].dateStart,$scope.dateEnd=SELECTION_TEMPLATES_CUSTOM[$scope.selectedTemplate].dateEnd),$scope.selectedTemplateName=$scope.selectedDateText()}$scope.updateActiveDate()}else $scope.selectedTemplate="",$scope.selectedTemplateName=$scope.selectedDateText(),$scope.updateActiveDate();$scope.$watch("selectedTemplate",function(next,prev){next===prev||!$scope.dateStart||$scope.inCurrentMonth($scope.dateStart)||$scope.inCurrentMonth($scope.dateStart,!0)||$scope.focusToDate($scope.dateStart)}),$scope.$watch("dateStart",function(next,prev){next===prev||!$scope.dateStart||$scope.inCurrentMonth($scope.dateStart)||$scope.inCurrentMonth($scope.dateStart,!0)||$scope.focusToDate($scope.dateStart)});var w=new Date(2017,0,1);for($scope.days=[],mctr=0;mctr<7;mctr++)w.setDate(mctr+1+getFirstDayOfWeek()),$scope.days.push({id:mctr,name:getLocalizationVal($filter("date")(w,"EEE"))});var m=null;for($scope.months=[],mctr=0;mctr<12;mctr++)m=new Date(2017,mctr,1),$scope.months.push({id:mctr,name:getLocalizationVal($filter("date")(m,"MMMM"))});var y=$scope.activeYear,yctr=0;for($scope.years=[],yctr=y-10;yctr',''," {{ngModel.selectedTemplateName || placeholder}}",' ',"",'',' {{ngModel.selectedTemplateName || placeholder}}',' ','

','{{getLocalizationVal("Clear")}}','{{getLocalizationVal("Ok")}}',"

","
",""].join(""),controller:["$scope","$mdMenu",function($scope,$mdMenu){$scope.ok=function($dates){$scope.mdOnSelect({$dates:$dates}),$mdMenu.hide()},$scope.clear=function(){$scope.ngModel.selectedTemplateName="",$scope.ngModel.selectedTemplate=null,$scope.ngModel.dateStart=null,$scope.ngModel.dateEnd=null},$scope.getLocalizationVal=function(val){return $scope.ngModel&&null!=$scope.ngModel.localizationMap&&null!=$scope.ngModel.localizationMap[val]?$scope.ngModel.localizationMap[val]:val}}]}}function mdDateRangePickerService($mdDialog){function getSelectedDate(dateStart,dateEnd,isDisabledDateCallback,maxRange,minRange){for(var dates=[],limit=dateEnd.getTime(),date=dateStart,ctr=0,y=dateStart.getFullYear(),m=dateStart.getMonth(),d=dateStart.getDate();date.getTime()<=limit&&(isDisabledDateCallback&&!isDisabledDateCallback({$date:date})&&dates.push(date),ctr++,date=new Date(y,m,d+ctr),!(ctr>(maxRange||1e4))););return dates}function show(config){return $mdDialog.show({locals:{mdDateRangePickerServiceModel:angular.copy(config.model),mdDateRangePickerServiceConfig:angular.copy(config)},controller:["$scope","mdDateRangePickerServiceModel","mdDateRangePickerServiceConfig",function($scope,mdDateRangePickerServiceModel,mdDateRangePickerServiceConfig){$scope.model=mdDateRangePickerServiceModel||{},$scope.config=mdDateRangePickerServiceConfig||{},$scope.model.selectedTemplateName=$scope.model.selectedTemplateName||"",$scope.ok=function(){$scope.model.dateStart&&$scope.model.dateStart.setHours(0,0,0,0),$scope.model.dateEnd&&$scope.model.dateEnd.setHours(23,59,59,999),$mdDialog.hide($scope.model)},$scope.cancel=function(){$mdDialog.cancel()},$scope.clear=function(){$scope.model.selectedTemplateName="",$scope.model.selectedTemplate=null,$scope.model.dateStart=null,$scope.model.dateEnd=null},$scope.handleOnSelect=function($dates){"function"==typeof $scope.config.mdOnSelect&&$scope.config.mdOnSelect($dates),$scope.config.autoConfirm&&$scope.ok()},$scope.getLocalizationVal=function(val){return $scope.model&&null!=$scope.model.localizationMap&&null!=$scope.model.localizationMap[val]?$scope.model.localizationMap[val]:val},$scope.model.customTemplates&&console.warn("model.customTemplates will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({customTemplates}) instead"),$scope.model.localizationMap&&console.warn("model.localizationMap will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({localizationMap}) instead"),$scope.model.firstDayOfWeek&&console.warn("model.firstDayOfWeek will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({firstDayOfWeek}) instead"),$scope.model.showTemplate&&console.warn("model.showTemplate will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({showTemplate}) instead"),$scope.model.maxRange&&console.warn("model.maxRange will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({maxRange}) instead"),$scope.model.onePanel&&console.warn("model.onePanel will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({onePanel}) instead"),$scope.model.isDisabledDate&&console.warn("model.isDisabledDate({ $date: $date }) will be removed from model on next rlease, please use root config e.g. $mdDateRangePicker.show({isDisabledDate:($date)=>{}}) instead")}],template:['','','",'{{model.selectedTemplateName}}',"","","","","",'','{{getLocalizationVal("Cancel")}}','{{getLocalizationVal("Clear")}}','{{getLocalizationVal("Ok")}}',"",""].join(""),parent:angular.element(document.body),multiple:config.multiple,targetEvent:config.targetEvent||document.body,clickOutsideToClose:!0,fullscreen:config.model.fullscreen})}var service=this;service.show=show,service.getSelectedDate=getSelectedDate}angular.module("ngMaterialDateRangePicker",["ngMaterial"]).directive("mdDateRangePicker",mdDateRangePickerDirective).directive("mdDateRange",mdDateRangeDirective).controller("mdDateRangePickerCtrl",mdDateRangePickerCtrl).service("$mdDateRangePicker",mdDateRangePickerService),mdDateRangePickerDirective.$inject=["$mdDateRangePicker"],mdDateRangePickerCtrl.$inject=["$scope","$filter"],mdDateRangePickerService.$inject=["$mdDialog"]}(window,angular),function(angular){angular.module("ui.carousel.config",[]).value("ui.carousel.config",{debug:!1}),angular.module("ui.carousel.providers",[]),angular.module("ui.carousel.controllers",[]),angular.module("ui.carousel.directives",[]),angular.module("ui.carousel",["ui.carousel.config","ui.carousel.directives","ui.carousel.controllers","ui.carousel.providers"])}(angular),angular.module("ui.carousel.controllers").controller("UICarouselController",["$scope","$element","$timeout","$q","Carousel","$window",function($scope,$element,$timeout,$q,Carousel,$window){var _this=this;this.$onInit=function(){_this.initOptions(),_this.initRanges(),_this.setProps(),_this.setupInfinite()},this.initOptions=function(){_this.options=angular.extend({},Carousel.getOptions()),void 0!==_this.initialSlide&&(_this.options.initialSlide=_this.initialSlide),void 0!==_this.fade&&(_this.options.fade=_this.fade),void 0!==_this.autoplayOn&&(_this.options.autoplayOn=_this.autoplayOn),void 0!==_this.autoplaySpeed&&(_this.options.autoplaySpeed=_this.autoplaySpeed),void 0!==_this.cssEase&&(_this.options.cssEase=_this.cssEase),void 0!==_this.speed&&(_this.options.speed=_this.speed),void 0!==_this.infinite&&(_this.options.infinite=_this.infinite),void 0!==_this.arrows&&(_this.options.arrows=_this.arrows),void 0!==_this.dots&&(_this.options.dots=_this.dots),void 0!==_this.visiblePrev&&(_this.options.visiblePrev=_this.visiblePrev),void 0!==_this.visibleNext&&(_this.options.visibleNext=_this.visibleNext),void 0!==_this.currentGallery&&(_this.options.currentGallery=_this.currentGallery),_this.options.fade?(_this.options.slidesToShow=1,_this.options.slidesToScroll=1):(_this.show&&(_this.options.slidesToShow=_this.show),_this.scroll&&(_this.options.slidesToScroll=_this.scroll))},this.initRanges=function(){_this.slides||(_this.slides=[]), _this.isCarouselReady=!1,_this.isTrackMoving=!1,_this.track=$element.find(".track"),_this.width=1,_this.currentSlide=_this.options.initialSlide,_this.trackStyle={},_this.slideStyle={},_this.isVisibleDots=!1,_this.isVisiblePrev=_this.options.visiblePrev,_this.isVisibleNext=_this.options.visibleNext,_this.isClickablePrev=!1,_this.isClickableNext=!1,_this.animType=null,_this.transformType=null,_this.transitionType=null},this.initUI=function(){_this.width=$element[0].clientWidth,_this.height=$element[0].clientHeight,_this.initTrack(),$timeout(function(){_this.updateItemStyle()},200)},this.updateItemStyle=function(){_this.itemWidth=_this.width/_this.options.slidesToShow,_this.slideStyle={width:_this.itemWidth+"px"}},this.initTrack=function(){var itemWidth=_this.width/_this.options.slidesToShow,trackWidth=itemWidth*_this.slidesInTrack.length;_this.trackStyle.width=trackWidth+"px",_this.slideHandler(_this.currentSlide).finally(function(){_this.isCarouselReady=!0,_this.options.fade||_this.refreshTrackStyle(),_this.onInit&&_this.onInit()}).catch(function(){})},this.next=function(){if(!_this.isClickableNext)return!1;var indexOffset=_this.getIndexOffset(),slideOffset=0===indexOffset?_this.options.slidesToScroll:indexOffset;_this.slideHandler(_this.currentSlide+slideOffset).catch(function(){})},this.prev=function(){if(!_this.isClickablePrev)return!1;var indexOffset=_this.getIndexOffset(),slideOffset=0===indexOffset?_this.options.slidesToScroll:_this.options.slidesToShow-indexOffset;_this.slideHandler(_this.currentSlide-slideOffset).catch(function(){})},this.getIndexOffset=function(){return _this.slides.length%_this.options.slidesToScroll!=0?0:(_this.slides.length-_this.currentSlide)%_this.options.slidesToScroll},this.movePage=function(page){var target=_this.options.slidesToScroll*page;_this.slideHandler(target).catch(function(){})},this.slideHandler=function(index){if(!_this.slides)return $q.reject("Carousel not fully setup");if(_this.isTrackMoving)return $q.reject("Track is moving");var len=_this.slides.length,show=_this.options.slidesToShow;if(len<=show)return _this.correctTrack(),$q.reject("Length of slides smaller than slides to show");var anim=index,target=null;if(target=anim<0?len%_this.options.slidesToScroll!=0?len-len%_this.options.slidesToScroll:len+anim:anim>=len?len%_this.options.slidesToScroll!=0?0:anim-len:anim,_this.onBeforeChange&&_this.onBeforeChange({currentSlide:_this.currentSlide,target:target}),_this.options.fade)return _this.currentSlide=target,$timeout(function(){_this.autoplayTrack(),_this.onAfterChange&&_this.onAfterChange({currentSlide:_this.currentSlide})},_this.options.speed),$q.when("Handler fade");var itemWidth=_this.width/_this.options.slidesToShow,left=-1*target*itemWidth;return _this.options.infinite&&(left=-1*(anim+show)*itemWidth),_this.isTrackMoving=!0,_this.moveTrack(left).then(function(){_this.isTrackMoving=!1,_this.currentSlide=target,_this.autoplayTrack(),target!==anim&&_this.correctTrack(),_this.options.infinite||(0===_this.currentSlide?(_this.isClickablePrev=!1,_this.isClickableNext=!0):_this.currentSlide===_this.slidesInTrack.length-_this.options.slidesToShow?(_this.isClickableNext=!1,_this.isClickablePrev=!0):(_this.isClickablePrev=!0,_this.isClickableNext=!0)),$timeout(function(){_this.onAfterChange&&_this.onAfterChange({currentSlide:_this.currentSlide})},200)})},this.moveTrack=function(left){var deferred=$q.defer();return!1===_this.options.vertical?_this.trackStyle[_this.animType]="translate3d("+left+"px, 0px, 0px)":_this.trackStyle[_this.animType]="translate3d(0px, "+left+"px, 0px)",$timeout(function(){deferred.resolve("Track moved")},_this.options.speed),deferred.promise},this.correctTrack=function(){_this.options.infinite&&function(){var left=0;_this.slides.length>_this.options.slidesToShow&&(left=-1*(_this.currentSlide+_this.options.slidesToShow)*_this.itemWidth),_this.trackStyle[_this.transitionType]=_this.transformType+" 0ms "+_this.options.cssEase,_this.isTrackMoving=!0,$timeout(function(){_this.trackStyle[_this.animType]="translate3d("+left+"px, 0, 0px)",$timeout(function(){_this.refreshTrackStyle(),_this.isTrackMoving=!1},200)})}()},this.refreshTrackStyle=function(){_this.trackStyle[_this.transitionType]=_this.transformType+" "+_this.options.speed+"ms "+_this.options.cssEase},this.autoplayTrack=function(){_this.options.autoplayOn&&(_this.timeout&&$timeout.cancel(_this.timeout),_this.timeout=$timeout(function(){_this.next(),$timeout.cancel(_this.timeout),_this.timeout=null},_this.options.autoplaySpeed))},this.getSlideStyle=function(index){var style=_this.slideStyle;if(_this.options.fade){var left=-1*index*_this.itemWidth,uniqueStyle={position:"relative",top:"0px",left:left+"px","z-index":index===_this.currentSlide?10:9,opacity:index===_this.currentSlide?1:0};index>=_this.currentSlide-1&&index<=_this.currentSlide+1&&(uniqueStyle.transition="opacity 250ms linear"),style=angular.extend(style,uniqueStyle)}return style},this.getSlideClass=function(index){return index===_this.currentSlide?"active":""},this.getSlideWidth=function(index){return Math.ceil(_this.itemWidth)},this.getSlideHeight=function(index){return Math.ceil(_this.height)},this.setupInfinite=function(){var len=_this.slides.length,show=_this.options.slidesToShow,tmpTrack=angular.copy(_this.slides);if(_this.options.infinite&&!1===_this.options.fade&&len>show){for(var number=show,i=0;i=len-show;_i--)tmpTrack.unshift(angular.copy(_this.slides[_i]))}_this.slidesInTrack=tmpTrack},this.getDots=function(){if(!_this.slides)return[];for(var dots=Math.ceil(_this.slides.length/_this.options.slidesToScroll),res=[],i=0;i_this.options.slidesToShow?(_this.isVisibleDots=!0,_this.isVisiblePrev=!0,_this.isVisibleNext=!0,_this.isClickablePrev=!0,_this.isClickableNext=!0):(_this.isVisibleDots=!1,_this.isVisiblePrev=_this.options.visiblePrev||!1,_this.isVisibleNext=_this.options.visibleNext||!1,_this.isClickablePrev=!1,_this.isClickableNext=!1),_this.initUI()},$scope.$watchCollection("ctrl.slides",function(slides){slides&&(_this.currentSlide>slides.length-1&&(_this.currentSlide=slides.length-1),_this.setupInfinite(),_this.refreshCarousel())}),angular.element($window).on("resize",this.refreshCarousel),$scope.$on("$destroy",function(){angular.element($window).off("resize")}),1===angular.version.major&&angular.version.minor<5&&this.$onInit()}]),angular.module("ui.carousel.directives").directive("uiCarousel",["$compile","$templateCache","$sce",function($compile,$templateCache,$sce){return{restrict:"AE",bindToController:!0,scope:{name:"=?",slides:"=",show:"=?slidesToShow",scroll:"=?slidesToScroll",classes:"@",fade:"=?",onChange:"=?",disableArrow:"=?",autoplayOn:"=?",autoplaySpeed:"=?",cssEase:"=?",speed:"=?",infinite:"=?",arrows:"=?",dots:"=?",initialSlide:"=?",visibleNext:"=?",visiblePrev:"=?",currentGallery:"=?",onBeforeChange:"&",onAfterChange:"&",onInit:"&"},link:function($scope,el,attrs){var template=angular.element($templateCache.get("ui-carousel/carousel.template.html")),injectComponentMap={"carousel-item":".carousel-item","carousel-prev":".carousel-prev","carousel-next":".carousel-next"},templateInstance=template.clone();angular.forEach(injectComponentMap,function(innerSelector,outerSelector){var outerElement=el[0].querySelector(outerSelector);outerElement&&angular.element(templateInstance[0].querySelector(innerSelector)).html(outerElement.innerHTML)});var compiledElement=$compile(templateInstance)($scope);el.addClass("ui-carousel").html("").append(compiledElement);try{$scope.photoPop=$scope.$parent.$parent.$parent.photoPop}catch(e){console.log(e)}try{$scope.popPhotos=$scope.$parent.vm.popPhotos}catch(e){console.log(e)}},controller:"UICarouselController",controllerAs:"ctrl"}}]),angular.module("ui.carousel.providers").provider("Carousel",function(){var _this=this;this.options={arrows:!0,autoplayOn:!1,autoplaySpeed:3e3,cssEase:"ease",dots:!1,easing:"linear",fade:!1,infinite:!0,initialSlide:0,slidesToShow:1,slidesToScroll:1,speed:500,visiblePrev:!1,visibleNext:!1,draggable:!0,lazyLoad:"ondemand",swipe:!0,swipeToSlide:!1,touchMove:!0,vertical:!1,verticalSwiping:!1,currentGallery:{}},this.$get=[function(){return{setOptions:function(options){_this.options=angular.extend(_this.options,options)},getOptions:function(){return _this.options}}}]}),function(module){try{module=angular.module("ui.carousel")}catch(e){module=angular.module("ui.carousel",[])}module.run(["$templateCache",function($templateCache){$templateCache.put("ui-carousel/carousel.template.html",'')}])}(),function(){"use strict";function inViewDirective($parse){return{restrict:"A",require:"?^^inViewContainer",link:function(scope,element,attrs,container){var options={};attrs.inViewOptions&&(options=scope.$eval(attrs.inViewOptions)),options.offset&&(options.offset=normalizeOffset(options.offset)),options.viewportOffset&&(options.viewportOffset=normalizeOffset(options.viewportOffset));var viewportEventSignal=signalSingle({type:"initial"}).merge(signalFromEvent(window,"checkInView click ready wheel mousewheel DomMouseScroll MozMousePixelScroll resize scroll touchmove mouseup keydown"));container&&(viewportEventSignal=viewportEventSignal.merge(container.eventsSignal)),options.throttle&&(viewportEventSignal=viewportEventSignal.throttle(options.throttle));var inviewInfoSignal=viewportEventSignal.map(function(event){var viewportRect;viewportRect=container?container.getViewportRect():getViewportRect(),viewportRect=offsetRect(viewportRect,options.viewportOffset);var elementRect=offsetRect(element[0].getBoundingClientRect(),options.offset),isVisible=!!(element[0].offsetWidth||element[0].offsetHeight||element[0].getClientRects().length),info={inView:isVisible&&intersectRect(elementRect,viewportRect),event:event,element:element,elementRect:elementRect,viewportRect:viewportRect};return options.generateParts&&info.inView&&(info.parts={},info.parts.top=elementRect.top>=viewportRect.top,info.parts.left=elementRect.left>=viewportRect.left,info.parts.bottom=elementRect.bottom<=viewportRect.bottom,info.parts.right=elementRect.right<=viewportRect.right),info}).scan({},function(lastInfo,newInfo){return options.generateDirection&&newInfo.inView&&lastInfo.elementRect&&(newInfo.direction={horizontal:newInfo.elementRect.left-lastInfo.elementRect.left,vertical:newInfo.elementRect.top-lastInfo.elementRect.top}),newInfo.changed=newInfo.inView!==lastInfo.inView||!angular.equals(newInfo.parts,lastInfo.parts)||!angular.equals(newInfo.direction,lastInfo.direction),newInfo}).filter(function(info){return!!info.changed&&!("initial"===info.event.type&&!info.inView)}),inViewExpression=$parse(attrs.inView),dispose=inviewInfoSignal.subscribe(function(info){scope.$applyAsync(function(){inViewExpression(scope,{$inview:info.inView,$inviewInfo:info})})});scope.$on("$destroy",dispose)}}}function inViewContainerDirective(){return{restrict:"A",controller:["$element",function($element){this.element=$element,this.eventsSignal=signalFromEvent($element,"scroll"),this.getViewportRect=function(){return $element[0].getBoundingClientRect()}}]}}function getViewportRect(){var result={top:0,left:0,width:window.innerWidth,right:window.innerWidth,height:window.innerHeight,bottom:window.innerHeight};return result.height?result:("CSS1Compat"===document.compatMode?(result.width=result.right=document.documentElement.clientWidth,result.height=result.bottom=document.documentElement.clientHeight):(result.width=result.right=document.body.clientWidth,result.height=result.bottom=document.body.clientHeight),result)}function intersectRect(r1,r2){return!(r2.left>r1.right||r2.rightr1.bottom||r2.bottom0}function QuickSignal(didSubscribeFunc){this.didSubscribeFunc=didSubscribeFunc}function signalMerge(){var signals=arguments;return new QuickSignal(function(subscriber){for(var disposables=[],i=signals.length-1;i>=0;i--)disposables.push(signals[i].subscribe(function(){subscriber.apply(null,arguments)}));subscriber.$dispose=function(){for(var i=disposables.length-1;i>=0;i--)disposables[i]&&disposables[i]()}})}function signalFromEvent(target,event){return new QuickSignal(function(subscriber){var handler=function(e){subscriber(e)},el=angular.element(target);event.split(" ").map(function(e){el[0].addEventListener(e,handler,!0)}),subscriber.$dispose=function(){event.split(" ").map(function(e){el[0].removeEventListener(e,handler,!0)})}})}function signalSingle(value){return new QuickSignal(function(subscriber){setTimeout(function(){subscriber(value)})})}angular.module("angular-inview",[]).directive("inView",["$parse",inViewDirective]).directive("inViewContainer",inViewContainerDirective),QuickSignal.prototype.subscribe=function(subscriber){return this.didSubscribeFunc(subscriber),function(){subscriber.$dispose&&(subscriber.$dispose(),subscriber.$dispose=null)}},QuickSignal.prototype.map=function(f){var s=this;return new QuickSignal(function(subscriber){subscriber.$dispose=s.subscribe(function(nextValue){subscriber(f(nextValue))})})},QuickSignal.prototype.filter=function(f){var s=this;return new QuickSignal(function(subscriber){subscriber.$dispose=s.subscribe(function(nextValue){f(nextValue)&&subscriber(nextValue)})})},QuickSignal.prototype.scan=function(initial,scanFunc){var s=this;return new QuickSignal(function(subscriber){var last=initial;subscriber.$dispose=s.subscribe(function(nextValue){last=scanFunc(last,nextValue),subscriber(last)})})},QuickSignal.prototype.merge=function(signal){return signalMerge(this,signal)},QuickSignal.prototype.throttle=function(threshhold){var last,deferTimer,s=this;return new QuickSignal(function(subscriber){var chainDisposable=s.subscribe(function(){var now=+new Date,args=arguments;last&&nowo;o++){for(var r=e[o],s=0;i>s&&void 0!==(r=this._queue[s](r,o,e))&&null!==r;s++);void 0!==r&&null!==r&&t.push(r)}return t},t.Pipeline.prototype.reset=function(){this._queue=[]},t.Pipeline.prototype.get=function(){return this._queue},t.Pipeline.prototype.toJSON=function(){return this._queue.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.DocumentStore,this.index={},this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var e=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,e)},t.Index.prototype.off=function(e,t){return this.eventEmitter.removeListener(e,t)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;n._fields=e.fields,n._ref=e.ref,n.documentStore=t.DocumentStore.load(e.documentStore),n.pipeline=t.Pipeline.load(e.pipeline),n.index={};for(var i in e.index)n.index[i]=t.InvertedIndex.load(e.index[i]);return n},t.Index.prototype.addField=function(e){return this._fields.push(e),this.index[e]=new t.InvertedIndex,this},t.Index.prototype.setRef=function(e){return this._ref=e,this},t.Index.prototype.saveDocument=function(e){return this.documentStore=new t.DocumentStore(e),this},t.Index.prototype.addDoc=function(e,n){if(e){var n=void 0===n||n,i=e[this._ref];this.documentStore.addDoc(i,e),this._fields.forEach(function(n){var o=this.pipeline.run(t.tokenizer(e[n]));this.documentStore.addFieldLength(i,n,o.length);var r={};o.forEach(function(e){e in r?r[e]+=1:r[e]=1},this);for(var s in r){var u=r[s];u=Math.sqrt(u),this.index[n].addToken(s,{ref:i,tf:u})}},this),n&&this.eventEmitter.emit("add",e,this)}},t.Index.prototype.removeDocByRef=function(e){if(e&&!1!==this.documentStore.isDocStored()&&this.documentStore.hasDoc(e)){var t=this.documentStore.getDoc(e);this.removeDoc(t,!1)}},t.Index.prototype.removeDoc=function(e,n){if(e){var n=void 0===n||n,i=e[this._ref];this.documentStore.hasDoc(i)&&(this.documentStore.removeDoc(i),this._fields.forEach(function(n){this.pipeline.run(t.tokenizer(e[n])).forEach(function(e){this.index[n].removeToken(e,i)},this)},this),n&&this.eventEmitter.emit("remove",e,this))}},t.Index.prototype.updateDoc=function(e,t){var t=void 0===t||t;this.removeDocByRef(e[this._ref],!1),this.addDoc(e,!1),t&&this.eventEmitter.emit("update",e,this)},t.Index.prototype.idf=function(e,t){var n="@"+t+"/"+e;if(Object.prototype.hasOwnProperty.call(this._idfCache,n))return this._idfCache[n];var i=this.index[t].getDocFreq(e),o=1+Math.log(this.documentStore.length/(i+1));return this._idfCache[n]=o,o},t.Index.prototype.getFields=function(){return this._fields.slice()},t.Index.prototype.search=function(e,n){if(!e)return[];e="string"==typeof e?{any:e}:JSON.parse(JSON.stringify(e));var i=null;null!=n&&(i=JSON.stringify(n));for(var o=new t.Configuration(i,this.getFields()).get(),r={},s=Object.keys(e),u=0;u0&&t.push(e);for(var i in n)"docs"!==i&&"df"!==i&&this.expandToken(e+i,t,n[i]);return t}, t.InvertedIndex.prototype.toJSON=function(){return{root:this.root}},t.Configuration=function(e,n){var e=e||"";if(void 0==n||null==n)throw new Error("fields should not be null");this.config={};var i;try{i=JSON.parse(e),this.buildUserConfig(i,n)}catch(o){t.utils.warn("user configuration parse failed, will use default configuration"),this.buildDefaultConfig(n)}},t.Configuration.prototype.buildDefaultConfig=function(e){this.reset(),e.forEach(function(e){this.config[e]={boost:1,bool:"OR",expand:!1}},this)},t.Configuration.prototype.buildUserConfig=function(e,n){var i="OR",o=!1;if(this.reset(),"bool"in e&&(i=e.bool||i),"expand"in e&&(o=e.expand||o),"fields"in e)for(var r in e.fields)if(n.indexOf(r)>-1){var s=e.fields[r],u=o;void 0!=s.expand&&(u=s.expand),this.config[r]={boost:s.boost||0===s.boost?s.boost:1,bool:s.bool||i,expand:u}}else t.utils.warn("field name in user configuration not found in index instance fields");else this.addAllFields2UserConfig(i,o,n)},t.Configuration.prototype.addAllFields2UserConfig=function(e,t,n){n.forEach(function(n){this.config[n]={boost:1,bool:e,expand:t}},this)},t.Configuration.prototype.get=function(){return this.config},t.Configuration.prototype.reset=function(){this.config={}},lunr.SortedSet=function(){this.length=0,this.elements=[]},lunr.SortedSet.load=function(e){var t=new this;return t.elements=e,t.length=e.length,t},lunr.SortedSet.prototype.add=function(){var e,t;for(e=0;e1;){if(r===e)return o;e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o]}return r===e?o:-1},lunr.SortedSet.prototype.locationFor=function(e){for(var t=0,n=this.elements.length,i=n-t,o=t+Math.floor(i/2),r=this.elements[o];i>1;)e>r&&(t=o),r>e&&(n=o),i=n-t,o=t+Math.floor(i/2),r=this.elements[o];return r>e?o:e>r?o+1:void 0},lunr.SortedSet.prototype.intersect=function(e){for(var t=new lunr.SortedSet,n=0,i=0,o=this.length,r=e.length,s=this.elements,u=e.elements;!(n>o-1||i>r-1);)s[n]!==u[i]?s[n]u[i]&&i++:(t.add(s[n]),n++,i++);return t},lunr.SortedSet.prototype.clone=function(){var e=new lunr.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},lunr.SortedSet.prototype.union=function(e){var t,n,i;this.length>=e.length?(t=this,n=e):(t=e,n=this),i=t.clone();for(var o=0,r=n.toArray();o=0}function a(t){return n(t),"click"}function i(t){return n(t)?t.innerText||t.value:t.id||t.name||t.tagName}function r(t){return"analytics"===t.substr(0,9)&&-1===["On","Event","If","Properties","EventType"].indexOf(t.substr(9))}function o(t){var e=t.slice(9);return void 0!==e&&null!==e&&e.length>0?e.substring(0,1).toLowerCase()+e.substring(1):e}return{restrict:"A",link:function(n,s,c){var u=c.analyticsOn||a(s[0]),l={};t.forEach(c.$attr,function(t,e){r(e)&&(l[o(e)]=c[e],c.$observe(e,function(t){l[o(e)]=t}))}),t.element(s[0]).bind(u,function(a){var r=c.analyticsEvent||i(s[0]);l.eventType=a.type,(!c.analyticsIf||n.$eval(c.analyticsIf))&&(c.analyticsProperties&&t.extend(l,n.$eval(c.analyticsProperties)),e.eventTrack(r,l))})}}}])}(angular),function(t,e,n){"use strict";e.module("angulartics.google.analytics",["angulartics"]).config(["$analyticsProvider",function(a){function i(e){if(t.ga)for(var n=1;200>=n;n++)e["dimension"+n.toString()]&&ga("set","dimension"+n.toString(),e["dimension"+n.toString()]),e["metric"+n.toString()]&&ga("set","metric"+n.toString(),e["metric"+n.toString()])}a.settings.pageTracking.trackRelativePath=!0,a.settings.ga={additionalAccountNames:void 0,userId:null},a.registerPageTrack(function(n){t._gaq&&(_gaq.push(["_trackPageview",n]),e.forEach(a.settings.ga.additionalAccountNames,function(t){_gaq.push([t+"._trackPageview",n])})),t.ga&&(a.settings.ga.userId&&ga("set","&uid",a.settings.ga.userId),ga("send","pageview",n),e.forEach(a.settings.ga.additionalAccountNames,function(t){ga(t+".send","pageview",n)}))}),a.registerEventTrack(function(n,r){if(r&&r.category||(r=r||{},r.category="Event"),r.value){var o=parseInt(r.value,10);r.value=isNaN(o)?0:o}if(t.ga){var s={eventCategory:r.category,eventAction:n,eventLabel:r.label,eventValue:r.value,nonInteraction:r.noninteraction,page:r.page||t.location.hash.substring(1)||t.location.pathname,userId:a.settings.ga.userId};i(r),a.settings.ga.transport?ga("send","event",s,{transport:a.settings.ga.transport}):ga("send","event",s),window.dataLayer=window.dataLayer||[],(s.event="gtm.customEvent")&&dataLayer.push(s),e.forEach(a.settings.ga.additionalAccountNames,function(t){ga(t+".send","event",s)})}else t._gaq&&_gaq.push(["_trackEvent",r.category,n,r.label,r.value,r.noninteraction])}),a.registerSetUsername(function(t){a.settings.ga.userId=t}),a.registerSetUserProperties(function(t){i(t)})}])}(window,window.angular),function(){"use strict";function t(t){return"[object Array]"===Object.prototype.toString.call(t)}function e(t){return void 0!==t}function n(t){return"function"==typeof t}function a(t){return null===t}function i(t){return"string"==typeof t}function r(t){return void 0===t}function o(t,e){return t.hasOwnProperty(e)}function s(t){return a(t)||r(t)||i(t)&&0==t.length}function c(t){return i(t)&&t.length>0}function u(t,e){return angular.equals(t,e)}function l(t,e){return angular.copy(t,e)}function g(t,e){return angular.module(t,e)}angular.module("sly",["slyEvaluate","slyRepeat"]),g("slyEvaluate",["gatedScope"]).directive("slyEvaluateOnlyWhen",["$parse",function(t){return{scope:!0,restrict:"A",compile:function(e,n){return{pre:function(e,n,i){var r=null,u=!1,l=t(i.slyEvaluateOnlyWhen),g=null;if(o(i,"slyAlwaysEvaluate")&&(g=i.slyAlwaysEvaluate,s(g)))throw new Exception("Empty string is illegal for value of slyAlwaysEvaluate");e.$addWatcherGate(function(){var t=l(e);if(!u)return u=!0,r=t,!0;var n=r!==t;return r=t,n},function(t){return a(g)||!(c(t)&&t.indexOf(g)>=0)},!0)}}}}}]).directive("slyAlwaysEvaluate",function(){return{restrict:"A",link:function(t,e,n){}}}).directive("slyShow",["$animate",function(t){function e(t){if(t&&0!==t.length){var e=""+t;e=i(e)?e.toLowerCase():e,t=!("f"==e||"0"==e||"false"==e||"no"==e||"n"==e||"[]"==e)}else t=!1;return t}return{restrict:"A",link:function(n,a,i){n.$watch(i.slyShow,function(n){t[e(n)?"removeClass":"addClass"](a,"ng-hide")},!1,"slyShow")}}}]).directive("slyPreventEvaluationWhenHidden",function(){return{restrict:"A",scope:!0,compile:function(t,n){return{pre:function(t,n,a){t.$addWatcherGate(function(){return!n.hasClass("ng-hide")},function(t,n,a,i){return!e(i)||"slyShow"!=i})}}}}}),g("slyRepeat",["gatedScope"]).directive("slyRepeat",["$animate","$parse",function(e,n){function a(t){t.scope.$addWatcherGate(function(){return t.isActiveForRepeat})}return{restrict:"A",scope:!0,transclude:"element",priority:1e3,terminal:!0,compile:function(n,i,r){return function(n,i,o){var s=o.slyRepeat,c=s.match(/^\s*(.+)\s+in\s+(.*?)$/);if(!c)throw Error("Expected slyRepeat in form of '_item_ in _collection_' but got '"+s+"'.");var u=c[1],l=c[2];if(!(c=u.match(/^(?:([\$\w]+))$/)))throw Error("'item' in 'item in collection' should be identifier but got '"+lhs+"'.");var g=[],f=[],h=n.$watchCollection(l,function(o){if(o){if(!t(o))throw Error("'collection' did not evaluate to an array. expression was "+l);var s=g.length;if(g.length0){var c=g.length+f.length;c>o.length&&(c=o.length),g=g.concat(f.splice(0,c-g.length))}var h=null,$=[],p=[];if(o.length>g.length){for(var d=g.length;d0){var y=h.length-1,w=h.length-1;s0&&(y-=1);for(var d=y;w>=d;++d)h[d].scope.$last=d==h.length-1,h[d].scope.$middle=0!=d&&d!=h.length-1,h[d].isActiveForRepeat||(h[d].isActiveForRepeat=!0,h[d].element.css("display",""))}for(var d=0;d<$.length&&!$[d].isActiveForRepeat;++d)$[d].element.css("display","none");for(var d=0;d0&&(m=g[g.length-1].element);for(var d=0;dt?2*t*t:(4-2*t)*t-1;case"easeInCubic":return t*t*t;case"easeOutCubic":return--t*t*t+1;case"easeInOutCubic":return.5>t?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1;case"easeInQuart":return t*t*t*t;case"easeOutQuart":return 1- --t*t*t*t;case"easeInOutQuart":return.5>t?8*t*t*t*t:1-8*--t*t*t*t;case"easeInQuint":return t*t*t*t*t;case"easeOutQuint":return 1+--t*t*t*t*t;case"easeInOutQuint":return.5>t?16*t*t*t*t*t:1+16*--t*t*t*t*t;default:return t}},s=function(e){var t=0;if(e.offsetParent)do{t+=e.offsetTop,e=e.offsetParent}while(e);return t=Math.max(t-c,0)};setTimeout(function(){var t,c,d,b,k=null,m=f(),I=s(e),v=0,g=I-m,h=function(){k=f(),u?(d=l.scrollHeight,b=l.clientHeight+k):(d=document.body.scrollheight,b=window.innerHeight+k),c!=I&&k!=I&&d>b||(clearInterval(A),o(e))},p=function(){v+=16,t=v/n,t=t>1?1:t,c=m+g*i(r,t),u?l.scrollTop=c:window.scrollTo(0,c),h()};a(e);var A=setInterval(p,16)},0)};e.factory("smoothScroll",function(){return t}),e.directive("smoothScroll",["smoothScroll",function(e){return{restrict:"A",scope:{callbackBefore:"&",callbackAfter:"&"},link:function(t,n,c){(void 0===c.scrollIf||"true"===c.scrollIf)&&setTimeout(function(){var r=function(e){if(c.callbackBefore){var n=t.callbackBefore({element:e});"function"==typeof n&&n(e)}},a=function(e){if(c.callbackAfter){var n=t.callbackAfter({element:e});"function"==typeof n&&n(e)}};e(n[0],{duration:c.duration,offset:c.offset,easing:c.easing,callbackBefore:r,callbackAfter:a,containerId:c.containerId})},0)}}}]),e.directive("scrollTo",["smoothScroll",function(e){return{restrict:"A",scope:{callbackBefore:"&",callbackAfter:"&"},link:function(t,n,c){var r;n.on("click",function(n){if(n.preventDefault(),r=document.getElementById(c.scrollTo)){var a=function(e){if(c.callbackBefore){var n=t.callbackBefore({element:e});"function"==typeof n&&n(e)}},o=function(e){if(c.callbackAfter){var n=t.callbackAfter({element:e});"function"==typeof n&&n(e)}};return e(r,{duration:c.duration,offset:c.offset,easing:c.easing,callbackBefore:a,callbackAfter:o,containerId:c.containerId}),!1}})}}}])}(),function(){"use strict";angular.module("bdmMaterialCarousel",["bdmMaterialCarousel.templates"]),function(callback){window.isLightHouse?callback(!0):window.createImageBitmap?fetch("data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAEAAQAcJaQAA3AA/v3AgAA=").then(function(response){return response.blob()}).then(function(blob){createImageBitmap(blob).then(function(){callback(!0)},function(){callback(!1)})}):callback(!1)}(function(isSupported){window.webPsupport=!!isSupported})}(),function(){"use strict";function CarouselController($timeout,$attrs,$interval,$window){var that=this;that.currentIndex=0,that.currentMarginLeftValue=0,that.radioButtonIndex=0,that.transitionsTime=500,that.transitionsEnabled=!0,$attrs.$observe("data",function(){that.onDataChange()}),that.registerElement=function(element){that.element=element,that.elementParent=that.element.parent(),that.slidesContainer=angular.element(that.element.find("div")[0]),$window.addEventListener("resize",function(){that.updateSlidesContainerWidth()})},that.onDataChange=function(){that.isDataInvalidOrTooSmall()||(that.executeCloneData(),$timeout(function(){that.updateSlidesContainerWidth(),that.restartFromFirstItem()}))},that.updateSlidesContainerWidth=function(){that.scaleContent(),that.currentWidth=that.element.prop("offsetWidth"),that.currentHeight=that.element.prop("offsetHeight"),that.resizeSlides();var newSlidesContainerWidth=that.currentWidth*that.cloneData.length;that.slidesContainer.css("width",newSlidesContainerWidth+"px"),that.scaleMarginLeft(newSlidesContainerWidth),that.currentSlidesContainerWidth=newSlidesContainerWidth},that.scaleContent=function(){that.maxWidth=that.maxWidth?parseInt(that.maxWidth):0,0===that.maxWidth&&(that.maxWidth=that.element.prop("offsetWidth")),that.maxHeight=that.maxHeight?parseInt(that.maxHeight):0,0===that.maxHeight&&(that.maxHeight=that.element.prop("offsetHeight"));var currentElementParentWidth=that.elementParent.prop("offsetWidth");if(currentElementParentWidth=that.maxWidth&&(that.element.css("width",that.maxWidth+"px"),that.element.css("height",that.maxHeight+"px"))},that.resizeSlides=function(){for(var slides=$window.document.getElementsByClassName("slide"),index=0;index1&&(that.autoSlideInterval=$interval(function(){that.navigateRight()},that.cloneData[that.currentIndex+1].autoSlideTime||that.autoSlideTime))},that.stopAutoSlide=function(){angular.isDefined(that.autoSlideInterval)&&($interval.cancel(that.autoSlideInterval),that.autoSlideInterval=void 0)},that.onNavigateLeft=function(){that.navigateLeft(),that.restartAutoSlide()},that.navigateLeft=function(){that.isDataInvalidOrTooSmall()||(that.currentIndex--,that.cloneData[that.currentIndex].src||(that.cloneData[that.currentIndex].src=that.cloneData[that.currentIndex].tmpSrc),that.radioButtonIndex=that.currentIndex,that.currentMarginLeftValue+=that.currentWidth,that.applyMarginLeft(),that.restartAutoSlide(),-1===that.currentIndex&&that.restartFromLastItem())},that.restartFromLastItem=function(){$timeout(function(){that.disableTransitions(),that.currentMarginLeftValue=that.currentWidth*that.data.length*-1,that.applyMarginLeft(),that.currentIndex=that.data.length-1,that.radioButtonIndex=that.currentIndex,that.enableTransitions()},that.transitionsTime)},that.onNavigateRight=function(){that.navigateRight(),that.restartAutoSlide()},that.navigateRight=function(){that.isDataInvalidOrTooSmall()||(that.currentIndex++,that.cloneData[that.currentIndex].src||(that.cloneData[that.currentIndex].src=that.cloneData[that.currentIndex].tmpSrc),that.radioButtonIndex=that.currentIndex,that.currentMarginLeftValue-=that.currentWidth,that.applyMarginLeft(),that.restartAutoSlide(),that.currentIndex===that.data.length&&$timeout(function(){that.restartFromFirstItem()},that.transitionsTime))},that.applyMarginLeft=function(){that.slidesContainer.css("margin-left",that.currentMarginLeftValue+"px")},that.disableTransitions=function(){that.slidesContainer.css("transition","none"),that.transitionsEnabled=!1},that.enableTransitions=function(){$timeout(function(){that.slidesContainer.css("transition","margin 0.5s ease-in-out"),that.transitionsEnabled=!0},200)},that.onRadioButtonClick=function(){var multiplier;that.radioButtonIndex>that.currentIndex?(multiplier=that.radioButtonIndex-that.currentIndex,that.currentMarginLeftValue-=that.currentWidth*multiplier):(multiplier=that.currentIndex-that.radioButtonIndex,that.currentMarginLeftValue+=that.currentWidth*multiplier),that.currentIndex=that.radioButtonIndex,that.applyMarginLeft(),that.restartAutoSlide()},that.isDataInvalidOrTooSmall=function(){return!that.data||0===that.data.length}}angular.module("bdmMaterialCarousel").controller("bdmCarouselController",["$timeout","$attrs","$interval","$window",CarouselController])}(),function(){"use strict";function CarouselDirective(){function link(scope,element,attrs,ctrl){ctrl.itemTemplateUrl="app/cards/item-carousel.html",(void 0===attrs.autoSlide||ctrl.data.length<2)&&(ctrl.autoSlide=!1),void 0===attrs.autoSlideTime&&(ctrl.data.length<2?ctrl.autoSlideTime=!1:ctrl.autoSlideTime=5e3),ctrl.registerElement(element),scope.$on("$destroy",function(){ctrl.stopAutoSlide()}),scope.$watch("ctrl.autoSlide",function(){ctrl.validateAutoSlide()}),scope.$watch("ctrl.autoSlideTime",function(){ctrl.restartAutoSlide()})}return{restrict:"E",replace:!0,templateUrl:"carousel-directive.html",scope:{},controller:"bdmCarouselController",controllerAs:"ctrl",bindToController:{data:"=",maxWidth:"@?",maxHeight:"@?",autoSlide:"@?",autoSlideTime:"@?"},link:link}}angular.module("bdmMaterialCarousel").directive("bdmCarousel",[CarouselDirective])}(),function(){angular.module("bdmMaterialCarousel.templates",[]).run(["$templateCache",function($templateCache){$templateCache.put("carousel-directive.html",'\n\n \n \n \n\n \n \n \n\n \n \n \n \n\n\n')}])}();var decamelize=require("decamelize");angular.module("humanizeText",[]).filter("escape",function(){return window.encodeURIComponent}).filter("getFirstImage",function(){return function(image){if(image&&"["==image[0])return image=JSON.parse(image),image[0];if(angular.isArray(image))for(;angular.isArray(image);)image=image[0];return image.indexOf(",")>-1?image=image.split(",")[0]:image?image.replace("(","%28").replace(")","%29"):""}}).filter("capitalize",function(){return function(input,all){return input?input.replace(/\w\S*/g,function(txt){return txt.charAt(0).toUpperCase()+txt.substr(1).toLowerCase()}):""}}).filter("camelCaseToHuman",function(){return function(input,uppercaseFirst){if("string"!=typeof input)return input;var result=decamelize(input," ");return uppercaseFirst&&(result=result.charAt(0).toUpperCase()+result.slice(1)),result.replace(/_/g," ").replace(/([A-Z])/g," $1").trim()}})},{decamelize:2}],2:[function(require,module,exports){"use strict";module.exports=function(str,sep){if("string"!=typeof str)throw new TypeError("Expected a string");return str.replace(/([a-z\d])([A-Z])/g,"$1"+(sep||"")+"$2").toLowerCase()}},{}]},{},[1]),function(){"use strict";angular.module("explorer.app",["explorer.directives","explorer.filters","explorer.config","explorer.constants","explorer.routes","explorer.services.alert","explorer.services.settings","explorer.services.data"])}(),function(){angular.module("explorer.constants",[]).constant("appConfig",{api:window.BDM_API?"https://brewer-vacations-frontend.uc.r.appspot.com/api/":window.location.protocol+"//"+(window.APP_DOMAIN.indexOf(".au")>-1||window.APP_DOMAIN.indexOf("brewer")>-1?window.APP_DOMAIN:"www."+window.APP_DOMAIN)+"/api/",searchDelay:350,messageDelay:36e3,headers:{"Content-Type":"application/json",Authorization:"XJKKAHJJS783$KKAS",X_BDM_TOKEN:"827asduuia277bbjsuw884"},requireLoggedIn:["trips","profile","messages","message","favorites","settings"],googlePlaceIdURL:"https://maps.googleapis.com/maps/api/place/details/json?placeid=",googleStaticImage:"https://maps.googleapis.com/maps/api/staticmap?center=",mapMarkerIcon:{iconUrl:"https://lh3.googleusercontent.com/PRDCn0qaaNKmfLcFhLEuGc8gvhP7JktWMRLt46voR1Dzge8YWorCxUckbzMDrDahTTxOThy-hjwCsRrApJVhmYWkl1JRR2T9Tq6LB3I=s0",iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]},mapCenter:{lat:parseFloat("29.910724"),lng:parseFloat("-26.0241557"),focus:!0,draggable:!0,zoom:L.Browser.mobile?1:2},maxClusterRadius:30,isMobileDevice:L.Browser.mobile})}(),function(){"use strict";angular.module("explorer.directives",[]).directive("countDown",function(){return{restrict:"E",replace:!0,scope:{format:"@",starts:"@",ends:"@"},templateUrl:CDN_URL+"cards/view/countdown-timer.tpl.html",controller:["$scope","$timeout","$filter",function($scope,$timeout,$filter){function countdown(){var countDownDate=new Date($scope.ends).getTime(),currentDatetime=new Date,now=new Date($scope.starts);now.setHours(currentDatetime.getHours()),now.setMinutes(currentDatetime.getMinutes()),now.setSeconds(currentDatetime.getSeconds()),now=now.getTime();var distance=countDownDate-now-612e5,days=Math.floor(distance/864e5),hours=Math.floor(distance%864e5/36e5),minutes=Math.floor(distance%36e5/6e4),seconds=Math.floor(distance%6e4/1e3);dvm.currentDate=days+"d "+hours+"h "+minutes+"m "+seconds+"s ",distance<0?(dvm.currentDate="0 days",dvm.days=0,dvm.hours=0,dvm.minutes=0,dvm.seconds=0):(dvm.days=days,dvm.hours=hours,dvm.minutes=minutes,dvm.seconds=seconds),$timeout(function(){countdown()},1e3*duration)}var dvm=this,duration=1;dvm.format=$scope.format||"",dvm.displayCountdown=!1,new Date($scope.ends).getTime()>(new Date).getTime()-612e5&&(dvm.displayCountdown=!0,dvm.currentDate=$filter("date")(new Date($scope.starts||""),$scope.format||""),countdown())}],controllerAs:"dvm"}}).directive("socialShare",function($window,$timeout,Settings){return{restrict:"E",scope:{},replace:!0,templateUrl:"app/cards/social-share.html",link:function(scope,element,attrs,filter){var currentLandingPage=Settings.get("currentLandingPage") ;scope.currentPageUrl=$window.location.href,angular.forEach($window.LANDING_PAGES,function(page){if(page.id==currentLandingPage.id)for(var i in page)i.indexOf("social")>-1&&(currentLandingPage[i]=page[i])}),scope.page=currentLandingPage}}}).directive("dynamicHtml",function($compile){return{restrict:"A",replace:!0,link:function(scope,ele,attrs){scope.$watch(attrs.dynamicHtml,function(html){ele.html(html),$compile(ele.contents())(scope)})}}}).directive("ownerRentalProgramRfp",function($window,$timeout,$filter,$mdpDatePicker,Settings,Person,Alert){return{restrict:"E",scope:{},replace:!0,templateUrl:CDN_URL+"cards/view/owner-rental-program-rfp.tpl.html",link:function(scope,element,attrs,filter){scope.attrs=attrs,scope.rfpForm={},scope.promoCode=$window.PROMOID||null,scope.propertiesAndRoomTypes=[{PropertyID:2948,ResortName:"Club Wyndham Bay Voyage Inn",RoomType1:"One Bedroom Standard Suite",RoomType2:"One Bedroom Deluxe Suite",RoomType3:"One Bedroom Superior Suite",RoomType4:"One Bedroom Superior Mobility/Visual Assist"},{PropertyID:2949,ResortName:"Club Wyndham Bentley Brook",RoomType1:"Studio Suite",RoomType2:"One Bedroom Suite",RoomType3:"Two Bedroom Suite",RoomType4:"Two Bedroom Suite Mobility w/Roll-in Shower"},{PropertyID:2995,ResortName:"Club Wyndham Inn on Long Wharf",RoomType1:"One Bedroom Deluxe Suite",RoomType2:"One Bedroom Deluxe Mobility w/Roll-in Shower"},{PropertyID:2947,ResortName:"Club Wyndham Inn on the Harbor",RoomType1:"One Bedroom Standard Suite",RoomType2:"One Bedroom Deluxe Suite",RoomType3:"One Bedroom Superior Suite",RoomType4:"One Bedroom Standard Mobility"},{PropertyID:110668,ResortName:"Club Wyndham Lake Marion",RoomType1:"Two Bedroom Deluxe",RoomType2:"Three Bedroom Deluxe"},{PropertyID:2950,ResortName:"Club Wyndham Long Wharf",RoomType1:"One Bedroom Suite",RoomType2:"One Bedroom Mobility",RoomType3:"Two Bedroom Suite",RoomType4:"Two Bedroom Mobility w/Roll-in Shower",RoomType5:"Three Bedroom Suite",RoomType6:"Three Bedroom Mobility w/Roll-in Shower"},{PropertyID:5025,ResortName:"Club Wyndham Newport Onshore",RoomType1:"One Bedroom Suite",RoomType2:"Two Bedroom Suite",RoomType3:"Two Bedroom Mobility",RoomType4:"Two Bedroom Mobility w/Roll-in Shower",RoomType5:"Three Bedroom Suite"},{PropertyID:5030,ResortName:"Club Wyndham Newport Overlook",RoomType1:"One Bedroom Suite",RoomType2:"Two Bedroom Suite",RoomType3:"Two Bedroom Mobility",RoomType4:"Two Bedroom Mobility w/Roll-in Shower",RoomType5:"Three Bedroom Suite"},{PropertyID:2933,ResortName:"Club Wyndham Ocean Walk Resort",RoomType1:"Studio",RoomType2:"One Bedroom Suite",RoomType3:"One Bedroom Suite Visual Assist",RoomType4:"One Bedroom Suite Hearing Impaired/Visual Assist",RoomType5:"One Bedroom Standard",RoomType6:"One Bedroom Oceanfront",RoomType7:"One Bedroom Deluxe",RoomType8:"One Bedroom Deluxe Hearing Impaired/Visual Assist",RoomType9:"One Bedroom Mobility w/Roll-In Shower/Visual Assist",RoomType10:"Two Bedroom Mobility w/Roll-In Shower/Visual Assist",RoomType11:"Two Bedroom Deluxe",RoomType12:"Two Bedroom Deluxe Hearing Impaired/Visual Assist",RoomType13:"Two Bedroom Lockoff",RoomType14:"Two Bedroom Oceanfront",RoomType15:"Three Bedroom Condo",RoomType16:"Three Bedroom Hearing Impaired/Visual Assist",RoomType17:"Standard Mobility w/Roll-In Shower/Visual Assist",RoomType18:"Penthouse Suite",RoomType19:"Mobility w Roll-In Shower/Hearing Impaired/Visual Assist"},{PropertyID:5028,ResortName:"Club Wyndham Riverside Suites",RoomType1:"Studio",RoomType2:"One Bedroom Suite",RoomType3:"Two Bedroom Suite",RoomType4:"2BR Mobility w/Roll-in Shower"},{PropertyID:6700,ResortName:"Club Wyndham Shawnee Village",RoomType1:"One Bedroom Villa",RoomType2:"Two Bedroom Villa",RoomType3:"Two Bedroom Deluxe Villa",RoomType4:"2 Bedroom Mobility w/ Roll-In Shower/Hearing Impaired/Vi"},{PropertyID:77689,ResortName:"WorldMark Bend - Seventh Mountain Resort",RoomType1:"Loft Suite",RoomType2:"Hotel Room",RoomType3:"Studio Suite",RoomType4:"Studio Suite Mobility w/Side Transfer/Hearing Impaired",RoomType5:"One Bedroom Mobility w/Side Transfer Shower/Visual Assist",RoomType6:"One Bedroom Suite",RoomType7:"One Bedroom Deluxe Suite",RoomType8:"Mobility w/Side Transfer/Hearing Impaired",RoomType9:"One Bedroom Plus Jr Loft Suite",RoomType10:"Two Bedroom Suite",RoomType11:"Three Bedroom Suite"}]}}}).directive("ehDefaultRfp",function($window,$timeout,$filter,$mdpDatePicker,Settings,Person,Alert){return{restrict:"E",scope:{},replace:!0,templateUrl:"app/cards/eh-default-rfp.html",link:function(scope,element,attrs,filter){function submitMeetingRFP(){scope.meetingForm.firstname&&scope.meetingForm.lastname&&scope.meetingForm.email&&scope.meetingForm.phone?Person.submitForm("MeetingRFP",scope.meetingForm).then(function(response){response&&response.data&&"ok"==response.data.status?(scope.meetingForm={},Alert.fire({message:"Thank you. We will reach out to you shortly!"})):Alert.fire({message:"There was an error, please try again later!"})}):Alert.fire({message:"Please fill in all the required fields."})}scope.attrs=attrs,scope.checkinDate=new Date(moment()),scope.checkoutDate=new Date(moment().add(2,"days")),scope.phoneReservations=$window.APP_CLIENT_PHONE_RESERVATIONS||"",scope.currentHotel=Settings.get("currentHotel"),scope.promoCode=$window.PROMOID||null,scope.hotels=[],scope.submitMeetingRFP=submitMeetingRFP,scope.checkinMinDate=new Date(moment()),scope.checkoutMinDate=new Date(moment().add(2,"days")),Settings.get("has_nearby_resorts")&&(scope.regions=Settings.get("nearby_resorts"),function(){if(angular.forEach(scope.regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){scope.hotels.push(hotel)})}),Settings.get("groupTravelProperty")){var _resort=Settings.get("groupTravelProperty");scope.meetingForm.resort=[],scope.meetingForm.resort.push(_resort),Settings.set("groupTravelProperty",null)}}())}}}).directive("ehMeetingsRfp",function($window,$timeout,$filter,$mdpDatePicker,Settings,Person,Alert){return{restrict:"E",scope:{},replace:!0,templateUrl:CDN_URL+"cards/view/eh-meetings-rfp.tpl.html",link:function(scope,element,attrs,filter){function submitMeetingRFP(){scope.meetingForm.firstname&&scope.meetingForm.lastname&&scope.meetingForm.email&&scope.meetingForm.phone?Person.submitForm("MeetingRFP",scope.meetingForm).then(function(response){response&&response.data&&"ok"==response.data.status?(scope.meetingForm={},Alert.fire({message:"Thank you. We will reach out to you shortly!"})):Alert.fire({message:"There was an error, please try again later!"})}):Alert.fire({message:"Please fill in all the required fields."})}scope.attrs=attrs,scope.checkinDate=new Date(moment()),scope.checkoutDate=new Date(moment().add(2,"days")),scope.phoneReservations=$window.APP_CLIENT_PHONE_RESERVATIONS||"",scope.currentHotel=Settings.get("currentHotel"),scope.promoCode=$window.PROMOID||null,scope.hotels=[],scope.submitMeetingRFP=submitMeetingRFP,scope.checkinMinDate=new Date(moment()),scope.checkoutMinDate=new Date(moment().add(2,"days")),Settings.get("has_nearby_resorts")&&(scope.regions=Settings.get("nearby_resorts"),function(){if(angular.forEach(scope.regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){scope.hotels.push(hotel)})}),Settings.get("groupTravelProperty")){var _resort=Settings.get("groupTravelProperty");scope.meetingForm.resort=[],scope.meetingForm.resort.push(_resort),Settings.set("groupTravelProperty",null)}}())}}}).directive("ehSweepsRfp",function($window,$timeout,$filter,$mdpDatePicker,Settings,Person,Alert){return{restrict:"E",scope:{thankYouPage:"@",formSubmitEvent:"@",campaignName:"@"},replace:!0,templateUrl:"app/cards/eh-sweeps-rfp.html",link:function(scope,element,attrs,filter){function submitSweepsForm(ev){scope.campaignName&&(scope.form.campaignName=scope.campaignName),scope.thankYouPage&&(scope.form.thankYouPage=scope.thankYouPage),scope.form.firstname&&scope.form.lastname&&scope.form.email&&scope.form.state&&scope.form.country&&scope.form.city&&scope.form.address1?Person.submitForm("SweepsForm",scope.form).then(function(response){response&&response.data&&"ok"==response.data.status?scope.thankYouPage?$window.location.href=scope.thankYouPage:(Alert.fire({ev:ev,message:"Thank you for entering our sweepstakes. Watch your email for a special thank you offer."}),scope.sweepsForm.$setUntouched()):Alert.fire({ev:ev,message:"There was an error, please try again later!"})}):Alert.fire({ev:ev,message:"Please fill in all the required fields."})}scope.attrs=attrs,scope.checkinDate=new Date(moment()),scope.checkoutDate=new Date(moment().add(2,"days")),scope.phoneReservations=$window.APP_CLIENT_PHONE_RESERVATIONS||"",scope.currentHotel=Settings.get("currentHotel"),scope.promoCode=$window.PROMOID||null,scope.hotels=[],scope.submitSweepsForm=submitSweepsForm,scope.checkinMinDate=new Date(moment()),scope.checkoutMinDate=new Date(moment().add(2,"days"))}}}).directive("pricelevel",function(){return{restrict:"E",scope:{},replace:!0,template:"{{priceLevel}}",link:function(scope,element,attrs){scope.priceLevel="";for(var i=0;icurrentRate?currentRate:leadRate,found=!0)}),found||angular.forEach(data.roomStays[0].ratePlans,function(plan){!found&&plan.default&&(leadRate=plan.leadRate-(plan.discountRate||0),found=!0)}),leadRate&&(scope.selectedResortDestination.leadRate=leadRate,scope.selectedResortDestination.priceCurrency=data.currencyCode,$analytics.eventTrack(scope.selectedResortDestination.hotelCode+": "+scope.selectedResortDestination.name,{category:"Lead Rate - Available",label:dateLabel}))}else scope.selectedResortDestination.leadRate=!1,$analytics.eventTrack(scope.selectedResortDestination.hotelCode+": "+scope.selectedResortDestination.name,{category:"Lead Rate - Unavailable",label:dateLabel});noCache||Settings.set(btoa(ratesApi),data),$rootScope.$broadcast("triggerUpdateBookingDates",data)}};scope.selectedResortDestination&&scope.selectedResortDestination.hotelCode?ratesData?handleResponse(ratesData,!0):(Settings.set(btoa(ratesApi),"loading"),$http({url:ratesApi,method:"GET",dataType:"json"}).success(function(data,status){200==status&&handleResponse(data)}).error(function(data,status,headers,config){scope.isSearching=!1})):scope.selectedResortDestination&&(scope.selectedResortDestination.leadRate=!1)}function isDisabledDate(d){return d]*>?/gm,"").replace("®","®"),scope.selectedResortDestination={hotelCode:hotel.hotelCode,name:hotel.name.replace(/<[^>]*>?/gm,"").replace("®","®"),city:hotel.cityName,state:hotel.stateName,region:regionName,postalCode:hotel.address.postalCode,country:hotel.address.addressCountry,telephone:hotel.telephone,image:hotel.image,url:"/"+hotel.cityState+"/"+hotel.slug,brand:hotel.brand||"",leadRate:hotel.leadRate,priceCurrency:hotel.priceCurrency,slug:hotel.slug,sameAs:hotel.sameAs},updateRates())})})})}function resortDestinationSearch(query){if(searchContext.length||(searchContext=loadAll(),scope.searchContext=searchContext),query){var results=searchContext.filter(createFilterFor(query));return results.length?results:[{noResult:!0,name:"No Results Found"}]}return null}function resortDestinationSelect(item){if(item=item||{},item.noResult)return!1;if(item.place)$state.go("search",{q:item.displayString});else if(item.hotelCode&&!scope.checkTriggerResortSelect){var cityStateSlug=item.url.split("/");cityStateSlug[1]&&cityStateSlug[2]&&-1==$location.path().indexOf(item.url)&&(Settings.set("selectedResort",item.hotelCode),$state.go("hotel",{cityState:cityStateSlug[1],slug:cityStateSlug[2]}))}else if(item.resortCount>-1&&!scope.checkTriggerResortSelect){var cityStateSlug=item.url.replace("/","");$location.path(item.url)}scope.checkTriggerResortSelect=!1}function postToSearch(ev){if($window.PostToSearch){if($analytics.eventTrack("Search "+scope.currentFilter.name,{category:"Booking Widget",label:(scope.selectedOrigin?scope.selectedOrigin.value+">":"")+(scope.selectedDestination?scope.selectedDestination.value:scope.selectedResortDestination?scope.selectedResortDestination.name:"")+": "+moment(scope.checkinDate).format("MM/DD/YYYY")+"-"+moment(scope.checkoutDate).format("MM/DD/YYYY")}),"resorts"==scope.attrs.selection&&scope.selectedResortDestination)angular.forEach(resortsContext,function(context){scope.selectedResortDestination.center&&500!=scope.selectedResortDestination.center.radius||context.destinationId!=scope.selectedResortDestination.destinationId||(scope.selectedResortDestination.center={lat:context.lat,lng:context.lng,radius:40})});else if(scope.search.searchText&&!scope.selectedResortDestination)return $state.go("search",{q:scope.search.searchText});if(scope.selectedResortDestination&&scope.selectedResortDestination.latlng)return $state.go("search",{q:scope.selectedResortDestination.displayString});if(scope.selectedResortDestination&&scope.selectedResortDestination.destinationId)return $state.go("search",{destinationId:scope.selectedResortDestination.destinationId});scope.selectedResortDestination&&scope.selectedResortDestination.tree&&!scope.selectedResortDestination.center&&(searchContext.length||(searchContext=loadAll()),angular.forEach(searchContext,function(tmpHotel){tmpHotel.hotelCode&&tmpHotel.tree&&(tmpHotel.tree.indexOf(scope.selectedResortDestination.tree[scope.selectedResortDestination.tree.length-1])>-1||tmpHotel.value.indexOf(scope.selectedResortDestination.tree[scope.selectedResortDestination.tree.length-1])>-1)&&(scope.selectedResortDestination.center={lat:tmpHotel.lat,lng:tmpHotel.lng,radius:500})})),$window.PostToSearch({selection:scope.attrs.selection,subSelection:scope.subFilterSelection,origin:scope.selectedOrigin,destination:scope.selectedDestination,resortDestination:scope.selectedResortDestination,departureDate:scope.checkinDate,returnDate:scope.checkoutDate,promoCode:scope.promoCode})||Alert.fire({ev:ev,message:"Please select a resort or destination."})}}function selectFilter(ev,filter){filter.isActive=!0,angular.forEach(scope.bookFilters,function(f){f.url==filter.url?f.isActive=!0:f.isActive=!1}),scope.currentFilter=filter,scope.attrs.selection=filter.url,scope.showBundleSelection="bundle"==scope.attrs.selection,setSubFilters(),scope.resortDestinationPlaceholder="resorts"==scope.attrs.selection?"Destination or resort name...":"Destination city or region...",scope.goingToLabel="flights"==scope.attrs.selection||"bundle"==scope.attrs.selection&&scope.subFilterSelection.flights?"Going To":"Destination",scope.showLeavingFrom="bundle"==scope.attrs.selection&&(firstLoad||scope.subFilterSelection.flights)||"flights"==scope.attrs.selection,scope.showGoingTo="resorts"!=scope.attrs.selection,scope.showDestinationPicker=["resorts"].indexOf(scope.attrs.selection)>-1,scope.isFlightMode="flights"==scope.attrs.selection||"bundle"==scope.attrs.selection&&(scope.subFilterSelection.flights||firstLoad),scope.isResortMode=["bundle","resorts"].indexOf(scope.attrs.selection)>-1,scope.isCarMode=["cars"].indexOf(scope.attrs.selection)>-1,scope.isActivityMode=["activities"].indexOf(scope.attrs.selection)>-1}function selectSubFilter(ev,filter){filter.isActive=!filter.isActive,$analytics.eventTrack(filter.isActive?"Check Filter":"Uncheck Filter",{category:"Booking Widget",label:"Bundle + Save>"+filter.name}),scope.subFilterSelection[filter.url]=filter.isActive,scope.goingToLabel="flights"==scope.attrs.selection||"bundle"==scope.attrs.selection&&scope.subFilterSelection.flights?"Going To":"Destination",scope.showLeavingFrom="bundle"==scope.attrs.selection&&scope.subFilterSelection.flights||"flights"==scope.attrs.selection,scope.showGoingTo="resorts"!=scope.attrs.selection,scope.showDestinationPicker=["resorts"].indexOf(scope.attrs.selection)>-1,scope.isFlightMode="flights"==scope.attrs.selection||"bundle"==scope.attrs.selection&&scope.subFilterSelection.flights,scope.isResortMode=["bundle","resorts"].indexOf(scope.attrs.selection)>-1,scope.isCarMode=["cars"].indexOf(scope.attrs.selection)>-1,scope.isActivityMode=["activities"].indexOf(scope.attrs.selection)>-1}function setSubFilters(){scope.subFilterSelection=scope.subFilterSelection||{};var carsActive=!1,activitiesActive=!1;switch(scope.attrs.selection){case"cars":carsActive=!0;break;case"activities":activitiesActive=!0;break;case"bundle":scope.subFilterSelection.resorts=!0,scope.subFilterSelection.flights=!0,firstLoad=!1}scope.currentSubFilters=scope.currentSubFilters||[{name:"Resorts",icon:"location_city",url:"resorts",isActive:!0},{name:"Flights",icon:"flight_land",icon2:"location_city",url:"flights",isActive:!0},{name:"Cars",icon:"car",url:"cars",isActive:carsActive},{name:"Activities",icon:"local_activity",url:"activities",isActive:activitiesActive}]}function createDestinationFilterFor(query){var lowercaseQuery=angular.lowercase(query);return function(item){return item.context.indexOf(lowercaseQuery)>-1}}function loadAll(){if(Settings.get("bookingBarSearchContext"))return resortsContext=Settings.get("bookingBarResortsContext"),Settings.get("bookingBarSearchContext");if(searchContext.length)return searchContext;destinationsTree=Settings.get("destinationsTree"),destinationProperties=Settings.get("destinationProperties");var completedDestinations=[];return regions=Settings.get("nearby_resorts"),angular.forEach(regions,function(region,regionName){angular.forEach(region.hotels,function(hotel){hotel.cityName&&hotel.name&&hotel.address&&(tmpHotel={id:hotel.id,hotelCode:hotel.hotelCode,name:hotel.name.replace(/<[^>]*>?/gm,"").replace("®","®"),city:hotel.cityName,state:hotel.stateName,country:hotel.address.addressCountry,region:regionName,postalCode:hotel.address.postalCode,telephone:hotel.telephone,image:hotel.image,url:"/"+hotel.cityState+"/"+hotel.slug,brand:hotel.brand||"",lat:hotel.geo?hotel.geo.latitude:"",lng:hotel.geo?hotel.geo.longitude:"",value:""},hotel.additionalProperty&&angular.forEach(hotel.additionalProperty,function(property){switch(property.name){case"Additional Locations":tmpHotel.additionalLocations=property.value}}),hotel.alternateName&&(tmpHotel.alternateName=hotel.alternateName.join(" ")),resortsContext.push(tmpHotel))})}),destinationProperties&&destinationProperties.length&&destinationsTree.length&&angular.forEach(resortsContext,function(tmpHotel){angular.forEach(destinationProperties,function(property){property.pid==tmpHotel.id&&(tmpHotel.destinationId=property.destinationId,tmpHotel.tree=property.tree,tmpHotel.value=property.tree.join(" ")+" "+tmpHotel.value)}),angular.forEach(destinationsTree,function(destinationContext){-1==destinationContext.tree.indexOf("travel destinations")&&-1==completedDestinations.indexOf(destinationContext.tree[destinationContext.tree.length-1])&&(tmpHotel.tree&&tmpHotel.tree.indexOf(destinationContext.tree[destinationContext.tree.length-1])>-1&&(destinationContext.center={lat:tmpHotel.lat,lng:tmpHotel.lng,radius:500}),destinationContext.value=destinationContext.tree.join(" ")+destinationContext.name.toLowerCase(),completedDestinations.push(destinationContext.tree[destinationContext.tree.length-1]),searchContext.push(destinationContext))})}),searchContext=searchContext.concat(resortsContext),searchContext=searchContext.map(function(item){return item.value=item.value||"",item.value+=" "+(item.name?item.name.toLowerCase():"")+" "+(item.region?item.region.toLowerCase():"")+" "+(item.additionalLocations?item.additionalLocations.toLowerCase():"")+" "+(item.alternateName?item.alternateName.toLowerCase():""),item.value=item.value.replace(/[^a-zA-Z0-9 ]/g,""),item}),Settings.set("bookingBarSearchContext",searchContext),Settings.set("bookingBarResortsContext",resortsContext),searchContext}function queryDestinationSearch(query){return destinationSearchContext=loadDestinationData(),query?destinationSearchContext.filter(createDestinationFilterFor(query)):null}function queryOriginSearch(query){return destinationSearchContext=loadOriginData(),query?destinationSearchContext.filter(createDestinationFilterFor(query)):null}function selectedDestinationChange(item){item&&item.display&&$analytics.eventTrack("Select "+scope.currentFilter.name+" Destination",{category:"Booking Widget",label:item.display})}function selectedResortDestinationChange(item){item&&item.display&&$analytics.eventTrack("Select "+scope.currentFilter.name+" Destination",{category:"Booking Widget",label:item.display})}function selectedOriginChange(item){item&&item.display&&$analytics.eventTrack("Select "+scope.currentFilter.name+" Origin",{category:"Booking Widget",label:item.display});var destEL=document.getElementById("going-to-input");angular.element(destEL).focus()}function loadDestinationData(){var passCheck=0,found=!1;return scope.airportDestinations&&(angular.forEach(scope.subFilterSelection,function(selected,selection){selected&&passCheck++}),passCheck||(passCheck=1),angular.forEach(scope.airportDestinations,function(packageType){var passes=0;switch(scope.attrs.selection){case"bundle":angular.forEach(scope.subFilterSelection,function(selected,selection){selected&&packageType.scope.indexOf(selection)>-1&&passes++}),passes!=passCheck||found||(found=packageType);break;case"flights":"A01"==packageType.name&&(found=packageType);break;case"cars":"C02"==packageType.name&&(found=packageType);break;case"activities":"F01"==packageType.name&&(found=packageType)}})),found?found.destinations.map(function(destination){return{value:destination.code.toLowerCase(),display:destination.name+" ("+destination.code+")",name:destination.name,context:destination.name.toLowerCase()+" "+destination.code.toLowerCase()}}):($window.DESTINATION_CODES||[]).map(function(destination){return{value:destination.code.toLowerCase(),display:destination.name+" ("+destination.code+")",name:destination.name,context:destination.name.toLowerCase()+" "+destination.code.toLowerCase()}})}function loadOriginData(){var passCheck=0,found=!1;return scope.airportDestinations&&(angular.forEach(scope.subFilterSelection,function(selected,selection){selected&&passCheck++}),passCheck||(passCheck=1),angular.forEach(scope.airportDestinations,function(packageType){var passes=0;switch(scope.attrs.selection){case"bundle":angular.forEach(scope.subFilterSelection,function(selected,selection){selected&&packageType.scope.indexOf(selection)>-1&&passes++}),passes!=passCheck||found||(found=packageType);break;case"flights":"A01"==packageType.name&&(found=packageType);break;case"cars":"C02"==packageType.name&&(found=packageType);break;case"activities":"F01"==packageType.name&&(found=packageType)}})),found?found.origins.map(function(origin){return{value:origin.code.toLowerCase(),display:origin.name+" ("+origin.code+")",name:origin.name,context:origin.name.toLowerCase()+" "+origin.code.toLowerCase()}}):($window.ORIGIN_CODES||[]).map(function(destination){return{value:destination.code.toLowerCase(),display:destination.name+" ("+destination.code+")",name:destination.name,context:destination.name.toLowerCase()+" "+destination.code.toLowerCase()}})}function createFilterFor(query){var lowercaseQuery=query.toLowerCase();return lowercaseQuery=lowercaseQuery.replace(/[^a-zA-Z0-9 ]/g,""),function(item){return item.value.indexOf(lowercaseQuery)>-1}}function checkinDatePicker(ev){$mdpDatePicker(scope.checkinDate,{minDate:new Date(moment(scope.checkinDate)),targetEvent:ev,dateLabel:"Check-In"}).then(function(selectedDate){scope.checkinDate=selectedDate,moment(selectedDate).diff(moment(scope.checkoutDate))>=-86400001&&(scope.checkoutDate=new Date(moment(scope.checkinDate).add(2,"days"))),$analytics.eventTrack("Pick Start Date",{category:"Booking Widget",label:moment(scope.checkinDate).format("MM/DD/YYYY")}),checkoutDatePicker(ev)})}function checkoutDatePicker(ev){$mdpDatePicker(scope.checkoutDate,{minDate:new Date(moment(scope.checkinDate).add(2,"days")),targetEvent:ev,dateLabel:"Check-Out"}).then(function(selectedDate){scope.checkoutDate=selectedDate,moment(selectedDate).diff(moment(scope.checkinDate))<=86400001&&(scope.checkinDate=new Date(moment(scope.checkoutDate).subtract(2,"days"))),$analytics.eventTrack("Pick End Date",{category:"Booking Widget",label:moment(scope.checkoutDate).format("MM/DD/YYYY")})})}var prevDiff,regions,tmpHotel,firstLoad=!0,searchContext=[],destinationSearchContext=[],resortsContext=[],destinationsTree=[],destinationProperties=[],regionsLoaded=!1,destinationsTreeLoaded=!1,setupContext=!1,today=new Date,yesterday=new Date;yesterday.setDate(today.getDate()-1),scope.attrs=attrs,scope.attrs.selection=scope.attrs.selection||"resorts",scope.leavingFromLabel="Leaving From",scope.bookFilters=[{name:"Resorts",icon:"location_city",url:"resorts",children:["resorts","flights"],isActive:"resorts"==attrs.selection},{name:"Bundle + Save",icon:"flights",icon2:"location_city",url:"bundle",children:["resorts","flights"],isActive:["bundle"].indexOf(scope.attrs.selection)>-1},{name:"Flights",icon:"flight",url:"flights",children:["resorts","flights"],isActive:"flights"==attrs.selection},{name:"Cars",icon:"directions_car",url:"cars",children:["resorts","flights","cars"],isActive:"cars"==attrs.selection},{name:"Activities",icon:"local_activity",url:"activities",children:["resorts","flights","activities"],isActive:"activities"==attrs.selection}];var _checkinDate=moment($localStorage.checkinDate),_checkoutDate=moment($localStorage.checkoutDate);if(_checkinDate.isSameOrAfter(moment(),"day")){_checkoutDate.diff(_checkinDate,"days")<2&&(_checkoutDate=_checkinDate.clone().add(2,"days"),$localStorage.checkoutDate=_checkoutDate),Settings.set("checkinDate",_checkinDate),Settings.set("checkoutDate",_checkoutDate)}else Settings.set("checkinDate",!1),Settings.set("checkoutDate",!1),$localStorage.checkinDate=null,$localStorage.checkoutDate=null ;scope.checkinDate=new Date(Settings.get("checkinDate")?moment(Settings.get("checkinDate")):moment().add(2,"days")),scope.checkoutDate=new Date(Settings.get("checkoutDate")?moment(Settings.get("checkoutDate")):moment().add(4,"days")),scope.checkinDatePicker=checkinDatePicker,scope.checkoutDatePicker=checkoutDatePicker,scope.phoneReservations=$window.APP_CLIENT_PHONE_RESERVATIONS||"",scope.currentHotel=Settings.get("currentHotel"),scope.selectedResort=$window.HOTELCODE||Settings.get("selectedResort")||scope.currentHotel&&scope.currentHotel.hotelCode,scope.selectedDestination=Settings.get("selectedDestination"),scope.promoCode=$window.PROMOID,scope.offerUrl="",scope.currentWindow={height:$window.innerHeight,width:$window.innerWidth},scope.resorts=[],scope.destinations=[],scope.cities=[],scope.search={},scope.queryDestinationSearch=queryDestinationSearch,scope.queryOriginSearch=queryOriginSearch,scope.selectedResortDestinationChange=selectedResortDestinationChange,scope.selectedDestinationChange=selectedDestinationChange,scope.selectedOriginChange=selectedOriginChange,scope.selectFilter=selectFilter,scope.selectSubFilter=selectSubFilter,scope.resortDestinationSearch=resortDestinationSearch,scope.resortDestinationSelect=resortDestinationSelect,scope.postToSearch=postToSearch,scope.isDisabledDate=isDisabledDate,scope.checkTriggerResortSelect=!1,angular.forEach(scope.bookFilters,function(filter){filter.url==scope.attrs.selection&&selectFilter({},filter)}),$window.isLightHouse||($rootScope.$on("triggerRegionsLoaded",function(){(regionsLoaded=!0)&&destinationsTreeLoaded&&!setupContext&&(scope.selectedResort&&loadSelectedResort(scope.selectedResort),setupContext=!0,searchContext=loadAll())}),$rootScope.$on("triggerDestinationsTreeLoaded",function(){destinationsTreeLoaded=!0,regionsLoaded&&destinationsTreeLoaded&&!setupContext&&(scope.selectedResort&&loadSelectedResort(scope.selectedResort),setupContext=!0,searchContext=loadAll())}),$rootScope.$on("triggerResortSelect",function(ev,selectedResort){scope.checkTriggerResortSelect=!0,scope.selectedResort=selectedResort,scope.checkinDate=new Date(moment(Settings.get("checkinDate"))),moment(Settings.get("checkoutDate")).diff(moment(Settings.get("checkinDate")))>864e5?scope.checkoutDate=new Date(moment(Settings.get("checkoutDate"))):scope.checkoutDate=new Date(moment(Settings.get("checkoutDate")).add(1,"days")),resortsContext.length?angular.forEach(resortsContext,function(resort){parseInt(resort.hotelCode)==parseInt(selectedResort)&&loadSelectedResort(selectedResort)}):Settings.get("has_nearby_resorts")?loadSelectedResort(selectedResort):$timeout(function(){loadSelectedResort(selectedResort)},1800),"hotel"!=$state.current.name&&(Settings.setMetaTitle(Settings.getMetaTitle().replace($filter("properCaps")($stateParams.slug),Settings.get("currentHotel")?Settings.get("currentHotel").name:$filter("properCaps")($stateParams.slug))),Settings.setMetaDescription(Settings.getMetaDescription().replace($filter("properCaps")($stateParams.slug),Settings.get("currentHotel")?Settings.get("currentHotel").name:$filter("properCaps")($stateParams.slug))))})),scope.$on("updatePromoCode",function(e,promoCode){scope.PROMOID=promoCode,scope.promoCode=promoCode}),$rootScope.$on("updatePromoCode",function(e,promoCode){scope.PROMOID=promoCode,scope.promoCode=promoCode}),scope.$emit("triggerBookingBarLoaded"),$rootScope.$on("triggerHideBookingBar",function(ev,showHide){scope.hideBookingBar=showHide}),scope.$on("updateProductId",function(e,productId){scope.PRODUCTID=productId,$window.PRODUCTID=$window.PRODUCTID||productId}),scope.$on("updateGaEvent",function(e,gaEvent){scope.GAEVENT=gaEvent}),$rootScope.$on("defaultSearchText",function(e,searchText){scope.search.searchText=searchText||""}),$rootScope.$on("updateSearchText",function(e,searchText){var _searchContext,found=!1;$timeout(function(){(_searchContext=Settings.get("bookingBarSearchContext"))&&angular.forEach(_searchContext,function(context){found||context.name!=searchText||(scope.selectedResortDestination=context,found=!0)})},Settings.get("bookingBarSearchContext")?100:3e3)}),$window.isLightHouse||(scope.$watch("checkinDate",function(oldDate,newDate){moment(scope.checkinDate).diff(moment(scope.checkoutDate))>=-86400001?prevDiff=moment(scope.checkinDate).diff(moment(scope.checkoutDate)):firstLoad||$timeout(function(){updateRates()},50),Settings.set("checkinDate",scope.checkinDate),$localStorage.checkinDate=scope.checkinDate}),scope.$watch("checkoutDate",function(oldDate,newDate){Settings.set("checkoutDate",scope.checkoutDate),$localStorage.checkoutDate=scope.checkoutDate,moment(scope.checkinDate).diff(moment(scope.checkoutDate))!=prevDiff&&(scope.showDatePicker=!1,$timeout(function(){scope.checkinDate!=scope.checkoutDate&&updateRates()},50))}))}}}).directive("ehTravelclickWidget",function($rootScope,$state,$stateParams,$window,$http,$timeout,$cookies,$filter,$analytics,$mdpDatePicker,Settings,Alert,appConfig){return{restrict:"AE",scope:{countries:"=",destinations:"=",states:"=",hotels:"=",currentCategory:"=",bodyContent:"=",noLogin:"=",realApi:"="},templateUrl:"app/regional/extraholidays/offers/view/eh-travelclick-widget.tpl.html",link:function(scope,element,attrs,filter){function checkinDatePicker(ev){$mdpDatePicker(scope.checkinDate,{minDate:today,targetEvent:ev,dateLabel:"Check-In"}).then(function(selectedDate){scope.checkinDate=selectedDate,moment(selectedDate).diff(moment(scope.checkoutDate))>=-86400001&&(scope.checkoutDate=new Date(moment(scope.checkinDate).add(1,"days"))),checkoutDatePicker(ev)})}function checkoutDatePicker(ev){$mdpDatePicker(scope.checkoutDate,{minDate:new Date(moment(scope.checkinDate).add(1,"days")),targetEvent:ev,dateLabel:"Check-Out"}).then(function(selectedDate){scope.checkoutDate=selectedDate,moment(selectedDate).diff(moment(scope.checkinDate))<=86400001&&(scope.checkinDate=new Date(moment(scope.checkoutDate).subtract(1,"days")))})}function isDisabledDate(d){return d-1});scope.isSearching=!0,scope.offers={length:0},results.length&&angular.forEach(results,function(result){cta=result.url.split("="),cta=cta[1].replace("&landing_site",""),result.cta=cta,result.ratePlan.leadRate="",cta=parseInt(cta)?"&ratePlanCode="+cta:"&corpCode="+cta,scope.offers[result.id]=result,endpoint=scope.realApi?"https://extraholidays.brewervacations.com/travelclick-api/?task=avail&hotelCode="+result.id+"&dateIn="+moment(startDate).format("YYYY-MM-DD")+"&dateOut="+moment(endDate).format("YYYY-MM-DD")+cta:"https://api.travelclick.com/ibe/v1/hotel/"+result.id+"/avail?lang=EN_US&adults=2&infants=0¤cy=USD&rooms=1&dateIn="+moment(startDate).format("YYYY-MM-DD")+"&dateOut="+moment(endDate).format("YYYY-MM-DD")+cta,$http({url:endpoint,method:"GET",dataType:"json"}).success(function(data,status,headers,config){200==status&&(scope.isSearching=!1,angular.forEach(data.roomStays[0].ratePlans,function(plan){angular.forEach(scope.offers,function(offer){plan.leadRate&&offer.cta==plan.ratePlanCode&&(offer.currencyCode=data.roomStays[0].currencyCode,offer.ratePlan=plan,offer.roomTypes=data.roomStays[0].allRoomTypes,scope.offers.length++)})}))}).error(function(data,status,headers,config){scope.isSearching=!1})})}else Alert.fire({message:"Please select a state/destination or resort",ev:ev})}var expireDate=new Date,properties=[],regions=null;expireDate.setMinutes(expireDate.getMinutes()+30),!0===scope.noLogin&&(Settings.set("oktaUserEnabled",!0),scope.isSignedIn=!0),regions=Settings.get("nearby_resorts"),regions&&(angular.forEach(regions,function(region,regionName){angular.forEach(region,function(items){angular.forEach(items,function(item){item.country=item.address.addressCountry,properties.push(item)})})}),scope.properties=properties.filter(function(property){var found=!1;return angular.forEach(scope.hotels,function(hotel){hotel.id==property.hotelCode&&(found=!0,hotel.country=property.country)}),found})),Settings.get("oktaUserEnabled")?scope.isSignedIn=!0:(scope.isSignedIn=!1,scope.testMode="bdmdeveloper"==$window.SESSION_ID,$http({url:appConfig.api+"oktaLogin/"+$window.SESSION_ID||$cookies.get("_gaWyn_gid"),method:"GET",dataType:"json",contentType:"application/json; charset=utf-8",headers:appConfig.headers}).success(function(data,status,headers,config){if("ok"!=data.status||data.successURL!=scope.currentCategory.slug)return Alert.fire({message:"Redirecting to Extra Holidays Login..."}),$timeout(function(){$window.location.href="owner-services-resort-stays"==scope.currentCategory.slug||"return-to-learn"==scope.currentCategory.slug?"https://wyndham.okta.com/app/wyndhamdestinations_extraholidaysownerservices_1/exk1hkra6plPCIy3n1d8/sso/saml":"https://wyndham.okta.com/app/wyndhamdestinations_wyndhamextraholidayssso_1/exk1f5s7vtnlMlNZh1d8/sso/saml"},1500);Settings.set("oktaUserEnabled",$window.SESSION_ID||$cookies.get("_gaWyn_gid")),Settings.set("oktaEnabledURL",data.successURL),Alert.fire({title:"Login Success",message:data.message}),scope.isSignedIn=!0}).error(function(data,status,headers,config){console.log(data,status)}));var prevDiff,today=new Date;scope.attrs=attrs,scope.checkinDate=new Date(moment().add(1,"days")),scope.checkoutDate=new Date(moment().add(2,"days")),scope.isSeaching=!1,scope.checkinDatePicker=checkinDatePicker,scope.checkoutDatePicker=checkoutDatePicker,scope.phoneReservations=$window.APP_CLIENT_PHONE_RESERVATIONS||"",scope.currentHotel=Settings.get("currentHotel"),scope.selectedResort=$window.HOTELCODE||Settings.get("selectedResort")||scope.currentHotel&&scope.currentHotel.hotelCode,scope.selectedDestination=Settings.get("selectedDestination"),scope.selectedState=null,scope.promoCode=$window.PROMOID,scope.offerUrl="",scope.search=search,scope.getBookingUrl=getBookingUrl,scope.isDisabledDate=isDisabledDate;var offers=scope.hotels;angular.forEach(offers,function(offer){offer.ratePlan={leadRate:" "}}),scope.offers=offers,scope.$watch("checkinDate",function(oldDate,newDate){moment(scope.checkinDate).diff(moment(scope.checkoutDate))>=-86400001&&(prevDiff=moment(scope.checkinDate).diff(moment(scope.checkoutDate)))}),scope.$watch("checkoutDate",function(oldDate,newDate){moment(scope.checkoutDate).diff(moment(scope.checkinDate))!=prevDiff&&(scope.showDatePicker=!1)})}}}).directive("ehFooter",function($window,Alert,Person){return{restrict:"E",scope:{},replace:!0,templateUrl:"app/cards/eh-footer.html",link:function(scope,element,attrs){function emailSubscribe(ev){scope.subscriberEmail?Person.submitForm("EmailSubscribe",{email:scope.subscriberEmail}).then(function(response){scope.subscriberEmail="",Alert.fire({ev:ev,title:"Thanks for signing up!",message:"We’ll send our best offers and latest news straight to your inbox."})}):Alert.fire({ev:ev,message:"Please enter a valid email address."})}scope.attrs=attrs,scope.clientPhone=$window.APP_CLIENT_PHONE,scope.clientEmail=$window.APP_CLIENT_EMAIL,scope.currentYear=(new Date).getFullYear(),scope.menu=$window.APP_CONFIG.menu,scope.clientName=$window.APP_CLIENT,scope.clientURL=$window.location.origin,$window.APP_CONFIG.core&&$window.APP_CONFIG.core.footer&&(scope.clientBrand=$window.APP_CONFIG.core.footer.brand||null,scope.footerText=$window.APP_CONFIG.core.footer.text||null,scope.clientAddress=$window.APP_CONFIG.core.footer.address||null,scope.termsLink=$window.APP_CONFIG.core.footer.termsLink||null,scope.privacyLink=$window.APP_CONFIG.core.footer.privacyLink||null,scope.newsletterLink=$window.APP_CONFIG.core.footer.newsletterLink||null,scope.subscribeHeading=$window.APP_CONFIG.core.footer.subscribeHeading||null,scope.subscribeText=$window.APP_CONFIG.core.footer.subscribeText||null),scope.emailSubscribe=emailSubscribe}}}).directive("ehCampaignFooter",function($window){return{restrict:"E",scope:{category:"="},replace:!0,templateUrl:"app/cards/eh-campaign-footer.html",link:function(scope,element,attrs){scope.attrs=attrs,scope.clientPhone=$window.APP_CLIENT_PHONE,scope.clientEmail=$window.APP_CLIENT_EMAIL,scope.currentYear=(new Date).getFullYear(),scope.menu=$window.APP_CONFIG.menu,scope.clientName=$window.APP_CLIENT,scope.clientURL=$window.location.origin,$window.APP_CONFIG.core&&$window.APP_CONFIG.core.footer&&(scope.clientBrand=$window.APP_CONFIG.core.footer.brand||null,scope.footerText=$window.APP_CONFIG.core.footer.text||null,scope.clientAddress=$window.APP_CONFIG.core.footer.address||null,scope.termsLink=$window.APP_CONFIG.core.footer.termsLink||null,scope.privacyLink=$window.APP_CONFIG.core.footer.privacyLink||null,scope.newsletterLink=$window.APP_CONFIG.core.footer.newsletterLink||null)}}}).directive("regionalPropertyHeader",function(){return{restrict:"E",scope:{property:"="},replace:!0,templateUrl:"app/cards/regional-property-header.html",link:function(scope,element,attrs){scope.attrs=attrs}}}).directive("ehHotelHeroPhoto",function(){return{restrict:"AE",scope:{property:"=",headerImage:"@"},templateUrl:"app/cards/eh-hotel-hero-photos.html",link:function(scope,element,attrs){scope.attrs=attrs}}}).directive("ehBreadcrumb",function($state,$stateParams,$window){return{restrict:"E",scope:{property:"=",destination:"=",slug:"="},templateUrl:"app/cards/eh-breadcrumb.html",link:function(scope,element,attrs){if(scope.attrs=attrs,scope.cityStateSlug=$stateParams.cityState||$stateParams.slug,$window.PORTAL_DESTINATIONS&&scope.cityStateSlug){var tmp=scope.cityStateSlug;angular.forEach($window.PORTAL_DESTINATIONS.states,function(state){tmp.indexOf(state)>-1&&(scope.stateSlug=state)})}switch($state.current.name){case"hotelRooms":case"hotelRoom":scope.isRoomsPage=!0;break;case"destinationPhotos":case"cityDestinationPhotos":scope.isDestinationPhotosPage=!0;break;case"hotelPhotos":scope.isPhotosPage=!0;break;case"hotelEvents":case"hotelEvent":scope.isEventsPage=!0;break;case"hotelDining":scope.isDiningPage=!0;break;case"destinationNearby":case"cityDestinationNearby":scope.isDestinationNearbyPage=!0;break;case"hotelNearby":scope.isNearbyPage=!0;break;case"hotelSpecial":case"hotelSpecials":scope.isOffersPage=!0}}}}).directive("hotelBannerNotice",function($filter){return{restrict:"E",scope:{crumbs:"=",lang:"="},templateUrl:"app/regional/extraholidays/cards/view/hotel-banner-notice.tpl.html",link:function(scope,element,attrs){scope.attrs=attrs}}}).directive("breadcrumb",function($filter){return{restrict:"E",scope:{crumbs:"=",lang:"="},templateUrl:"app/regional/extraholidays/cards/view/breadcrumb.tpl.html",link:function(scope,element,attrs){scope.attrs=attrs}}}).directive("ehResortCard",function($window,$filter,Settings){return{restrict:"E",scope:{property:"="},templateUrl:"app/cards/eh-resort-card.html",link:function(scope,element,attrs){function bookNow(hotel,offset){if(offset=offset||2,$window.BOOKING_URL){var options={checkin:$filter("date")(new Date(moment(Settings.get("checkinDate"))),"MM/dd/yyyy"),checkout:$filter("date")(new Date(moment(Settings.get("checkoutDate"))),"MM/dd/yyyy"),numAdults:1,numChildren:0,rooms:1,promoCode:$window.PROMOID||null,gaEvent:$window.GAEVENT||null,lid:$window.LID||null,cjevent:$window.CJEVENT||null,roktid:$window.ROKTID||null};hotel&&(hotel.hotelCode&&(options.hotelId=hotel.hotelCode),hotel.slug&&(options.slug=hotel.slug),hotel.sameAs&&(options.sameAs=hotel.sameAs),hotel.brand&&(options.brand=hotel.brand),hotel.geo&&(options.lat=hotel.geo.latitude,options.lng=hotel.geo.longitude),hotel.sameAs&&hotel.sameAs.length&&hotel.sameAs[0].indexOf("insiderextras.com")>-1&&(options.bookingURL=hotel.sameAs[0])),$window._booking_bar_link&&$window.open($window._booking_bar_link(options),"_blank")}}scope.amenityIconSet=Settings.get("amenityIconSet"),scope.attrs=attrs,scope.bookNow=bookNow}}}).directive("resortCard",function($window,$location,$filter,$timeout,$http,Settings){return{restrict:"E",scope:{property:"="},templateUrl:"app/regional/extraholidays/cards/view/resort-card.tpl.html",link:function(scope,element,attrs){function updateRates(){$http({url:"https://extraholidays.brewervacations.com/travelclick-api/?task=basicavail&hotelCode="+scope.property.hotelCode+"&dateIn="+moment(Settings.get("checkinDate")).format("YYYY-MM-DD")+"&dateOut="+moment(Settings.get("checkoutDate")).format("YYYY-MM-DD")+($window.PROMOID?"&corpCode="+$window.PROMOID:""),method:"GET",dataType:"json"}).success(function(data,status,headers,config){200==status&&scope.property&&data.dates&&data.dates[0]&&(scope.property.available=data.dates[0].isAvailable,scope.property.price=data.dates[0].rate.minRate,scope.property.priceCurrency=data.currencyCode)}).error(function(data,status,headers,config){console.log(data,status)})}function bookNow(hotel,offset){if(offset=offset||2,$window.BOOKING_URL){var options={checkin:$filter("date")(new Date(moment(Settings.get("checkinDate"))),"MM/dd/yyyy"),checkout:$filter("date")(new Date(moment(Settings.get("checkoutDate"))),"MM/dd/yyyy"),numAdults:1,numChildren:0,rooms:1,promoCode:$window.PROMOID||null,gaEvent:$window.GAEVENT||null,lid:$window.LID||null,cjevent:$window.CJEVENT||null,roktid:$window.ROKTID||null};hotel&&(hotel.hotelCode&&(options.hotelId=hotel.hotelCode),hotel.slug&&(options.slug=hotel.slug),hotel.sameAs&&(options.sameAs=hotel.sameAs),hotel.brand&&(options.brand=hotel.brand),hotel.geo&&(options.lat=hotel.geo.latitude,options.lng=hotel.geo.longitude),hotel.sameAs&&hotel.sameAs.length&&hotel.sameAs[0].indexOf("insiderextras.com")>-1&&(options.bookingURL=hotel.sameAs[0])),$window._booking_bar_link&&$window.open($window._booking_bar_link(options),"_blank")}}scope.amenityIconSet=Settings.get("amenityIconSet"),scope.attrs=attrs,scope.bookNow=bookNow;var skipLeadRates=["115043"];$location.search().showRates&&-1==skipLeadRates.indexOf(scope.property.hotelCode)&&$timeout(function(){updateRates(),scope.$on("triggerUpdateBookingDates",function(){updateRates()})},50)}}}).directive("searchResortCard",function($rootScope,$window,$location,$filter,$timeout,$http,Places,Settings){return{restrict:"E",scope:{property:"=",filters:"="},templateUrl:"app/regional/extraholidays/cards/view/search-resort-card.tpl.html",link:function(scope,element,attrs){function dateRangeHasWeekend(dateRange){for(var startDate=dateRange.start,endDate=dateRange.end,start=new Date(startDate),end=new Date(endDate),currentDate=start;currentDate<=end;currentDate.setDate(currentDate.getDate()+1)){var dayOfWeek=currentDate.getDay();if(5===dayOfWeek||6===dayOfWeek)return!0}return!1}function handleResponse(data,status,headers,config,cached){if($window.pendingRateLookups--,"loading"!=data){if(200==status&&data.roomStays&&data.roomStays.length){dateRangeHasWeekend(data.roomStays[0].timeSpan);if(scope.property.roomTypes=data.roomStays[0].allRoomTypes.map(function(room){room.imageIndex=0;var specialRateFound=!1,lowestRate=!1,currentRate=0;return angular.forEach(room.averageRates,function(rate){"Promotional"==rate.ratePlanCategory&&rate.available&&(currentRate=rate.rate-(rate.discount||0),(!lowestRate||lowestRate.rate-lowestRate.discount>currentRate)&&(lowestRate=rate,specialRateFound=!0))}),lowestRate?room.averageRates[0]=lowestRate:angular.forEach(room.averageRates,function(rate){specialRateFound||"Rack"!=rate.ratePlanCategory||(room.averageRates[0]=rate,specialRateFound=!0)}),room}),data.roomStays&&data.roomStays.length){var leadRate=!1,found=!1,currentRate=0;found||angular.forEach(data.roomStays[0].ratePlans,function(plan){"Promotional"==plan.ratePlanCategory&&plan.available&&(currentRate=plan.leadRate-(plan.discountRate||0),leadRate=!leadRate||leadRate>currentRate?currentRate:leadRate,found=!0,console.log(scope.property.name,leadRate))}),found||angular.forEach(data.roomStays[0].ratePlans,function(plan){!found&&plan.default&&(leadRate=plan.leadRate-(plan.discountRate||0),found=!0,console.log(scope.property.name,leadRate))}),leadRate?(scope.property.available=!0,scope.property.price=leadRate,scope.property.priceCurrency=data.currencyCode):(scope.property.available=!1,scope.property.price=0,scope.property.priceCurrency="USD")}else scope.property.available=!1,scope.property.price=0,scope.property.priceCurrency="USD"}else scope.property.available=!1,scope.property.price=0,scope.property.priceCurrency="USD";scope.isLoadingRate=!1,0==$window.pendingRateLookups&&$rootScope.$broadcast("triggerRatesLookupComplete"),cached||Settings.set(btoa("https://extraholidays.brewervacations.com/travelclick-api/?task=avail&hotelCode="+data.hotelCode+"&dateIn="+moment(Settings.get("checkinDate")).format("YYYY-MM-DD")+"&dateOut="+moment(Settings.get("checkoutDate")).format("YYYY-MM-DD")+($window.PROMOID?"&corpCode="+$window.PROMOID:"")),data)}}function updateRates(resetRooms){resetRooms&&(scope.viewRooms=!1),ratesApi="https://extraholidays.brewervacations.com/travelclick-api/?task=avail&hotelCode="+scope.property.hotelCode+"&dateIn="+moment(Settings.get("checkinDate")).format("YYYY-MM-DD")+"&dateOut="+moment(Settings.get("checkoutDate")).format("YYYY-MM-DD")+($window.PROMOID?"&corpCode="+$window.PROMOID:""),ratesData=Settings.get(btoa(ratesApi)),scope.property.roomTypes=[],$window.pendingRateLookups++,scope.property.available=!1,scope.property.price=0,scope.property.priceCurrency="USD",ratesData?handleResponse(ratesData,200,{},{},!0):(Settings.set(btoa(ratesApi),"loading"),$http({url:ratesApi,method:"GET",dataType:"json",headers:{"Cache-Control":"max-age=1000"}}).success(handleResponse).error(function(data,status,headers,config){console.log(data,status),scope.isLoadingRate=!1,$window.pendingRateLookups--}))}function toggleRooms(ev){scope.viewRooms||(scope.isLoadingRate=!0,roomsLoaded?updateRates():Places.get("PortalPropertyDetails",scope.property.id).then(function(response){"ok"==response.data.status&&(roomsLoaded=!0,response.data.details.hasOfferCatalog&&response.data.details.hasOfferCatalog&&(scope.property.hasOfferCatalog=response.data.details.hasOfferCatalog,updateRates()))})),scope.viewRooms=!scope.viewRooms}function bookNow(room){if(room=room||null,$window.BOOKING_URL){var options={checkin:$filter("date")(new Date(moment(Settings.get("checkinDate"))),"MM/dd/yyyy"),checkout:$filter("date")(new Date(moment(Settings.get("checkoutDate"))),"MM/dd/yyyy"),numAdults:1,numChildren:0,rooms:1,promoCode:$window.PROMOID||null,gaEvent:$window.GAEVENT||null,lid:$window.LID||null,cjevent:$window.CJEVENT||null,roktid:$window.ROKTID||null};scope.property&&(scope.property.hotelCode&&(options.hotelId=scope.property.hotelCode),scope.property.slug&&(options.slug=scope.property.slug),scope.property.sameAs&&(options.sameAs=scope.property.sameAs),scope.property.brand&&(options.brand=scope.property.brand),scope.property.geo&&(options.lat=scope.property.geo.latitude,options.lng=scope.property.geo.longitude),scope.property.sameAs&&scope.property.sameAs.length&&scope.property.sameAs[0].indexOf("insiderextras.com")>-1&&(options.bookingURL=scope.property.sameAs[0])),room&&room.roomTypeCode&&(options.roomType=room.roomTypeCode),room&&room.averageRates&&room.averageRates[0]&&(options.rateType=room.averageRates[0].ratePlanCode),$window._booking_bar_link&&$window.open($window._booking_bar_link(options),"_blank")}}scope.amenityIconSet=Settings.get("amenityIconSet"),scope.attrs=attrs,scope.bookNow=bookNow,scope.toggleRooms=toggleRooms,$window.pendingRateLookups=$window.pendingRateLookups||0,scope.showAvailabilityAlert=$rootScope.showAvailabilityAlert;var ratesApi,ratesData,skipLeadRates=["115043"],roomsLoaded=!1;-1==skipLeadRates.indexOf(scope.property.hotelCode)&&(updateRates(),scope.$on("triggerUpdateBookingDates",function(){scope.property.available=!1,scope.property.price=0,scope.isLoadingRate=!0,updateRates(!0)}),scope.$on("triggerUpdateSearchFilters",function(){scope.isLoadingRate=!0,scope.viewRooms=!1,updateRates(!0)}))}}}).directive("trustyouPropertyReview",function(Places){var _languageNames={en:"English",de:"German",fr:"French",es:"Spanish",it:"Italian",pt:"Portuguese",nl:"Dutsch",ru:"Russian",pl:"Polish",zh:"Chinese",ja:"Japanese",th:"Thai",id:"Indonesian",ko:"Korean",ar:"Arabic",sv:"Swedish",no:"Norwegian",fi:"Finnish",he:"Hebrew"};return{restrict:"E",scope:{id:"="},templateUrl:"app/cards/trustyou-property-review.html",link:function(scope,element,attrs){scope.attrs=attrs,scope.languageNames=_languageNames,scope.id&&Places.get("PropertyReviewData",scope.id).then(function(response){"ok"==response.data.status&&response.data.reviewData&&(scope.reviewData=response.data.reviewData.meta,scope.guestReviews=response.data.reviewData.reviews)})}}}).directive("offerResortCard",function($mdDialog,$filter,Settings){return{restrict:"E",scope:{propertyId:"=",offer:"="},templateUrl:"app/regional/extraholidays/cards/view/offer-resort-card.tpl.html",link:function(scope,element,attrs){scope.attrs=attrs;var tmp,regions=Settings.get("nearby_resorts"),found=!1;regions&&angular.forEach(regions,function(region,regionName){found||angular.forEach(region,function(hotels){found||angular.forEach(hotels,function(hotel){if(!found&&hotel.id==scope.propertyId){if(found=!0,scope.property=hotel,tmp=scope.offer,"object"==typeof tmp.cta)scope.ctaType="multi";else if(scope.offer.cta)try{tmp.cta=JSON.parse(scope.offer.cta),scope.ctaType="multi"}catch(e){scope.ctaType="single"}scope.currentOffer=tmp}})})})}}}).directive("ehCategoryOfferCard",function($state,$mdDialog,$window,$filter,Settings){function _popPhotos(ev,imageSet,imgIndex){$mdDialog.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,targetEvent:ev,templateUrl:"app/cards/photo-gallery.html",controller:function($scope,$filter,$mdDialog){var tmpIndex=imgIndex||0;$scope.image={url:imageSet[tmpIndex],index:tmpIndex},$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image={url:imageSet[$scope.image.index-1]},$scope.image.index=tmpIndex-1):($scope.image={url:imageSet[$scope.image.index-1]},$scope.image.index=imageSet.length-1)}}})}return{restrict:"E",scope:{property:"=",offer:"=",offerViewMode:"=",currentCategoryId:"="},templateUrl:"app/cards/eh-category-offer-card.html",link:function(scope,element,attrs){if(scope.attrs=attrs,scope.popPhotos=_popPhotos,scope.isMultiProperty=!1,scope.offer.propertyIds&&scope.offer.propertyIds.length>1){var regions=Settings.get("nearby_resorts"),properties=[];regions&&(angular.forEach(regions,function(region,regionName){angular.forEach(region,function(hotels){angular.forEach(hotels,function(hotel){scope.offer.propertyIds.indexOf(hotel.id)>-1&&properties.push(hotel)})})}),scope.offer.properties=properties),"offerCategory"==$state.current.name?scope.isMultiProperty=!0:scope.isMultiProperty=!1}else scope.isMultiProperty=!1;var imgObj;try{imgObj="string"!=typeof imgObj?JSON.parse(scope.offer.image):scope.offer.image}catch(e){imgObj=scope.offer.image}scope.isMultiImage=!!(scope.offer&&scope.offer.image&&"object"==typeof imgObj&&imgObj.length>1),scope.isMultiImage?scope.offer.image=imgObj:"object"==typeof imgObj&&1==imgObj.length?scope.offer.image=scope.offer.image:scope.offer.image=angular.isArray(scope.offer.image)?scope.offer.image:[scope.offer.image||scope.property.image],$window.CJEVENT&&-1==scope.offer.cta.indexOf("cjevent")&&(scope.offer.cta.indexOf("?")>0?scope.offer.cta=scope.offer.cta+"&cjevent="+$window.CJEVENT:scope.offer.cta=scope.offer.cta+"?cjevent="+$window.CJEVENT),$window.ROKTID&&-1==scope.offer.cta.indexOf("rtid")&&(scope.offer.cta.indexOf("?")>0?scope.offer.cta=scope.offer.cta+"&rtid="+$window.ROKTID:scope.offer.cta=scope.offer.cta+"?rtid="+$window.ROKTID),scope.getImageUrl=function(url){return"object"==typeof url&&(url=url[0]),{"background-image":"url('"+$filter("scaleTo")(url,300)+"')"}}}}}).directive("ehHotelNav",function(){return{restrict:"E",scope:{view:"@",property:"="},replace:!0,templateUrl:"app/cards/eh-hotel-nav.html",link:function(scope,element,attrs){scope.attrs=attrs}}}).directive("iconSquare",function(){return{restrict:"E",scope:{},replace:!0,templateUrl:"app/cards/icon-square.html",link:function(scope,element,attrs){scope.attrs=attrs}}}).directive("searchBar",function(){return{restrict:"E",scope:{},replace:!0,templateUrl:"app/cards/search-bar.html",link:function(scope,element,attrs){scope.attrs=attrs}}}).directive("focus",function(){return{restrict:"A",link:function(scope,elem,attrs){elem.bind("keydown",function(e){elem.next().focus()})}}}).directive("eventFocus",function(focus){return function(scope,elem,attrs){elem.on(attrs.eventFocus,function(){focus(attrs.eventFocusId)}),scope.$on("$destroy",function(){elem.off(attrs.eventFocus)})}}).directive("mdSearchAutocompleteOnEnter",function($state,Settings){return function(scope,element,attrs){element.bind("keydown keypress",function(event){13===event.which&&(scope.$apply(function(){scope.$$childHead.$mdAutocompleteCtrl&&(scope.$$childHead.$mdAutocompleteCtrl.hidden=!0),Settings.hideKeyboard(),console.log(scope.search.searchText),$state.go("search",{q:scope.search.searchText})}),event.preventDefault())})}}).directive("datePicker",function($rootScope,$state,$stateParams,$window,$timeout,$filter,$analytics,$mdpDatePicker,Settings,Alert){return{restrict:"E",scope:{},replace:!0,templateUrl:"app/regional/extraholidays/cards/view/eh-date-picker.tpl.html",controller:function($rootScope,$scope,$state,$stateParams,$window,$timeout,$filter,$analytics,$mdpDatePicker,Settings,Alert){function isDisabledDate(d){return d0?$scope.attrs.endOffset-$scope.attrs.startOffset:2)+" night stay." }):$window.open($scope.attrs.cta+"&dateIn="+$filter("date")($scope.checkinDate,"MM/dd/yyyy")+"&dateOut="+$filter("date")($scope.checkoutDate,"MM/dd/yyyy")+"&adults="+($scope.attrs.adults||2)+"&children="+($scope.attrs.children||2)+"&rooms="+($scope.attrs.rooms||1),"_blank")}var prevDiff,today=new Date;$scope.isDisabledDate=isDisabledDate,$scope.checkAvailability=checkAvailability,$scope.promoCode=$window.PROMOID,$scope.$watch("checkinDate",function(oldDate,newDate){moment($scope.checkinDate).diff(moment($scope.checkoutDate))>=-86400001&&(prevDiff=moment($scope.checkinDate).diff(moment($scope.checkoutDate)))}),$scope.$watch("checkoutDate",function(oldDate,newDate){moment($scope.checkoutDate).diff(moment($scope.checkinDate))!=prevDiff&&($scope.showDatePicker=!1)})},link:function(scope,element,attrs,filter){scope.attrs=attrs,scope.checkinDate=new Date(moment().add(attrs.startOffset||1,"days")),scope.checkoutDate=new Date(moment().add(attrs.endOffset||2,"days"))}}})}(),function(){angular.module("explorer.filters",[]).filter("dateAdd",function(){return function(input,days){var date=new Date(input);return date.setDate(date.getDate()+days),date}}).filter("containTo",function(){var vfmSizeKeys=["B","Q","C","D","E","F","H","I","M","J","Z","P","R","S","O"],vfmSizeValues=[100,120,150,200,250,300,350,384,400,480,600,800,1024,2048,5e3];return function(image,size){if(!image)return"";if(image&&(image.indexOf("www.cfmedia.vfmleonardo.com")>-1||image.indexOf("wyndham-extra-holidays.leonardocontentcloud.com")>-1)){if(parseInt(size))var width=parseInt(size);else var result=document.getElementsByClassName(size),el=angular.element(result),width=el&&el[0]?parseInt(el[0].clientWidth):300;width<67&&(width=300);var maxSize=image.split("_");maxSize=maxSize[maxSize.length-1],maxSize=maxSize.split("."),maxSize=vfmSizeKeys.indexOf(maxSize[0]);var finalSizeIndex=0;if(vfmSizeValues.indexOf(width)>=0)finalSizeIndex=vfmSizeValues.indexOf(width);else if(width>=vfmSizeValues[vfmSizeValues.length-1])finalSizeIndex=vfmSizeValues[vfmSizeValues.length-1];else for(var i in vfmSizeValues){if(i=parseInt(i),!(vfmSizeValues[i]maxSize?maxSize:finalSizeIndex,image=image.slice(0,-5)+(vfmSizeKeys[finalSizeIndex]?vfmSizeKeys[finalSizeIndex]:"H")+image.substr(image.length-4)}if(!parseInt(size)){var result=document.getElementsByClassName(size),el=angular.element(result),devicePixelRatioMultiplier=window.mobileTabletDevice?window.devicePixelRatio||1:1;return image.indexOf("=s0")>-1&&el[0].clientWidth&&el[0].clientHeight?image.replace("=s0","=w"+Math.round(el[0].clientWidth*devicePixelRatioMultiplier).toString()+"-h"+Math.round(el[0].clientHeight*devicePixelRatioMultiplier).toString())+(window.webPsupport?"-rw-e31536000":""):image}return image.indexOf("=s0")>-1?image.replace("=s0","=w"+size.toString())+(window.webPsupport?"-rw-e31536000":""):image}}).filter("scaleTo",function(){var vfmSizeKeys=["B","Q","C","D","E","F","H","I","M","J","Z","P","R","S","O"],vfmSizeValues=[100,120,150,200,250,300,350,384,400,480,600,800,1024,2048,5e3];return function(image,size){if(!(image=image||""))return"";if(image&&(image.indexOf("www.cfmedia.vfmleonardo.com")>-1||image.indexOf("wyndham-extra-holidays.leonardocontentcloud.com")>-1)){if(parseInt(size))var width=parseInt(size);else var result=document.getElementsByClassName(size),el=angular.element(result),width=el&&el[0]?parseInt(el[0].clientWidth):300;width<67&&(width=300);var finalSizeIndex=0,originalSizeIndex=0;if(vfmSizeValues.indexOf(width)>=0)finalSizeIndex=vfmSizeValues.indexOf(width);else if(width>=vfmSizeValues[vfmSizeValues.length-1])finalSizeIndex=vfmSizeValues[vfmSizeValues.length-1];else for(var i in vfmSizeValues){if(i=parseInt(i),!(vfmSizeValues[i]-1&&(originalSizeIndex=i);return finalSizeIndex>originalSizeIndex&&(finalSizeIndex=originalSizeIndex),image=image.slice(0,-5)+(vfmSizeKeys[finalSizeIndex]?vfmSizeKeys[finalSizeIndex]:"H")+image.substr(image.length-4)}if(!parseInt(size)){var result=document.getElementsByClassName(size),el=angular.element(result),size=el&&el[0]?parseInt(el[0].clientWidth):300,devicePixelRatioMultiplier=window.mobileTabletDevice?window.devicePixelRatio||1:1;return image.indexOf("=s0")>-1&&size?image.replace("=s0","=w"+Math.round(size*devicePixelRatioMultiplier).toString())+(window.webPsupport?"-rw-e31536000":""):image}return image.indexOf("=s0")>-1?image.replace("=s0","=w"+size.toString())+(window.webPsupport?"-rw-e31536000":""):image}}).filter("scaleToPlus10",function(){var vfmSizeKeys=["B","Q","C","D","E","F","H","I","M","J","Z","P","R","S","O"],vfmSizeValues=[100,120,150,200,250,300,350,384,400,480,600,800,1024,2048,5e3];return function(image,size){if(!(image=image||""))return"";if(image&&(image.indexOf("www.cfmedia.vfmleonardo.com")>-1||image.indexOf("wyndham-extra-holidays.leonardocontentcloud.com")>-1)){if(parseInt(size))var width=parseInt(size);else var result=document.getElementsByClassName(size),el=angular.element(result),width=el&&el[0]?parseInt(1.2*el[0].clientWidth):300;width<100&&(width=300);var finalSizeIndex=0;if(vfmSizeValues.indexOf(width)>=0)finalSizeIndex=vfmSizeValues.indexOf(width);else if(width>=vfmSizeValues[vfmSizeValues.length-1])finalSizeIndex=vfmSizeValues[vfmSizeValues.length-1];else for(var i in vfmSizeValues){if(i=parseInt(i),!(vfmSizeValues[i]-1&&(originalSizeIndex=i);return finalSizeIndex>originalSizeIndex&&(finalSizeIndex=originalSizeIndex),image=image.slice(0,-5)+(vfmSizeKeys[finalSizeIndex]?vfmSizeKeys[finalSizeIndex]:"H")+image.substr(image.length-4)}if(!parseInt(size)){var result=document.getElementsByClassName(size),el=angular.element(result),size=el&&el[0]?parseInt(1.2*el[0].clientWidth):300;return image.indexOf("=s0")>-1&&size?image.replace("=s0","=w"+size.toString())+(window.webPsupport?"-rw":""):image}return image.indexOf("=s0")>-1?image.replace("=s0","=w"+size.toString())+(window.webPsupport?"-rw":""):image}}).filter("cropTo",function(){var vfmSizeKeys=["B","Q","C","D","E","F","H","I","M","J","Z","P","R","S","O"],vfmSizeValues=[100,120,150,200,250,300,350,384,400,480,600,800,1024,2048,5e3];return function(image,size){if(!image)return"";if(image&&(image.indexOf("www.cfmedia.vfmleonardo.com")>-1||image.indexOf("wyndham-extra-holidays.leonardocontentcloud.com")>-1)){if(parseInt(size))var width=parseInt(size);else var result=document.getElementsByClassName(size),el=angular.element(result),width=el&&el[0]?parseInt(el[0].clientWidth):300;width<67&&(width=300);var finalSizeIndex=0,originalSizeIndex=0;if(vfmSizeValues.indexOf(width)>=0)finalSizeIndex=vfmSizeValues.indexOf(width);else if(width>=vfmSizeValues[vfmSizeValues.length-1])finalSizeIndex=vfmSizeValues[vfmSizeValues.length-1];else for(var i in vfmSizeValues){if(i=parseInt(i),!(vfmSizeValues[i]-1&&(originalSizeIndex=i);return finalSizeIndex>originalSizeIndex&&(finalSizeIndex=originalSizeIndex),image=image.slice(0,-5)+(vfmSizeKeys[finalSizeIndex]?vfmSizeKeys[finalSizeIndex]:"H")+image.substr(image.length-4)}if(!parseInt(size)){var result=document.getElementsByClassName(size),el=angular.element(result),devicePixelRatioMultiplier=window.mobileTabletDevice?window.devicePixelRatio||1:1;return image.indexOf("=s0")>-1&&el&&el[0]&&el[0].clientWidth&&el[0].clientHeight?image.replace("=s0","=w"+Math.round(el[0].clientWidth*devicePixelRatioMultiplier).toString()+"-h"+Math.round(el[0].clientHeight*devicePixelRatioMultiplier).toString()+"-n")+(window.webPsupport?"-rw-e31536000":""):image}return image.indexOf("=s0")>-1?image.replace("=s0","=w"+size.toString())+(window.webPsupport?"-rw-e31536000":""):image}}).filter("toTime",function($filter){return function(dateString){return dateString?moment(dateString,moment.ISO_8601,!0).isValid()?$filter("date")(new Date(moment(dateString)),"h:mm a"):dateString:""}}).filter("firstDateIsZero",function(){return function(date){return"0"==date[0]?"0"+(parseInt(date[1])-1).toString():(parseInt(date)-1).toString()}}).filter("dateOffset",function(){return function(){return function(date,offset){var result,type="+"==offset.charAt(0)?"add":"subtract",days=offset.substring(1);switch(type){case"add":result=new Date(moment(date).add(days,"days"));break;case"subtract":result=new Date(moment(date).subtract(days,"days"))}return result}}()}).filter("plaintext",function(){return function(text){return text?String(text).replace(/<[^>]+>/gm,""):""}}).filter("interpolate",function($interpolate){return function(){return function(template,myObject){return $interpolate(template)(myObject)}}()}).filter("unique",function(){return function(items,filterOn){if(!1===filterOn)return items;if((filterOn||angular.isUndefined(filterOn))&&angular.isArray(items)){var newItems=[],extractValueToCompare=function(item){return angular.isObject(item)&&angular.isString(filterOn)?item[filterOn]:item};angular.forEach(items,function(item){for(var isDuplicate=!1,i=0;i-1||image.indexOf("wyndham-extra-holidays.leonardocontentcloud.com")>-1)?image.replace("_S.jpg","_H.jpg").replace("_R.jpg","_H.jpg"):image:""}}).filter("toArray",function(){return function(obj,addKey){return angular.isObject(obj)?!1===addKey?Object.keys(obj).map(function(key){return obj[key]}):Object.keys(obj).map(function(key){var value=obj[key];return angular.isObject(value)?Object.defineProperty(value,"$key",{enumerable:!1,value:key}):{$key:key,$value:value}}):obj}}).filter("properCaps",function(){var _skip=["to","or","and","of"];return function(str){if(void 0===str||"boolean"==typeof str)return"";var frags=str.split("_");return frags.length<2&&(frags=frags[0].split("-")),frags=frags.map(function(frag){return _skip.indexOf(frag)>0?frag:frag.charAt(0).toUpperCase()+frag.slice(1)}),frags.join(" ").replace("Worldmark","WorldMark")}}).filter("orderBySearch",function(){return function(input,text){return text?input.sort(function(a,b){return a.length-b.length}):input}}).filter("trustAsHTML",["$sce",function($sce){return function(text){return text?$sce.trustAsHtml(text.replace(/\\"/g,'"').replace(/\\"/g,'"').replace("®","®").replace("u00ae","®").replace("u2019","'").replace("u2013","-").replace("’","'").replace("á","á").replace("ú","ú").replace("é","é")):""}}]).filter("safeHTML",function($filter){return function(data){return data?data.replace(/\n\r?/g,"
").replace(/\\"/g,'"').replace("®","®").replace("u00ae","®").replace("u2019","'").replace("u2013","-").replace("’","'"):data}}).filter("encodeURIComponent",function(){return window.encodeURIComponent}).filter("tagURL",function(){return window._tag_url||function(){}}).filter("toSlug",function(){return function(input){if(input){var slug=input.replace(/<[^>]*>?/gm,"").toLowerCase().replace("®","").replace("©","").trim();return slug=slug.replace(/&/g,"and"),slug=slug.replace(/'/g,""),slug=slug.replace(/"/g,""),slug=slug.replace(/[^a-z0-9\s-]/g," "),slug=slug.replace(/[\s-]+/g,"-"),"-"==slug.charAt(slug.length-1)&&(slug=slug.substr(0,slug.length-1)),slug}}}).filter("tel",function(){return function(tel){if(!tel)return"";var internationalCodes=["+61","+64","+62","+66","+679","+52"];for(var i in internationalCodes)if(tel.startsWith(internationalCodes[i]))return tel.replace(/-/g," ");var value=tel.toString().trim().replace("(","").replace(") ","-").replace(")","-").replace(/^\+/,"").replace(/-/g,"");if(value.match(/[^0-9]/))return value;var country,city,number;switch(value.length){case 10:country=1,city=value.slice(0,3),number=value.slice(3);break;case 11:1==value[0]?(country=value[0],city=value.slice(1,4),number=value.slice(4)):(country=value.slice(0,2),city=value.slice(2,4),number=value.slice(4));break;default:value=value.replace(/[^0-9]/g,"");var finalValue=[];return value=0==value.indexOf("011")?value.slice(3,value.length):value,value=value.reversePhone(),finalValue.push(value.slice(0,4)),finalValue.push(value.slice(4,7)),finalValue.push(value.slice(7,10)),finalValue.push(value.slice(10,value.length)),("+"+finalValue.join(" ").reversePhone()).replace("+ ","+")}return 1!=country&&country||(country="",number=number.slice(0,3)+"-"+number.slice(3)),(""==country?"("+city+") "+number:"+"+country+" "+city+" "+number).trim()}})}(),function(){"use strict";function AlertService($mdDialog,$timeout){var _alert={};return{fire:function(alert){_alert=$mdDialog.alert().title(alert.title||"Attention").textContent(alert.message).clickOutsideToClose(!0).ok("Close").targetEvent(alert.ev),$timeout(function(){alert.noHide||$mdDialog.hide()},alert.duration||2500),$mdDialog.show(_alert).finally(function(){_alert=void 0})},toast:function(alert){_alert=$mdToast.show($mdToast.simple().position("bottom").textContent(alert.message).action("Dismiss").hideDelay(alert.noHide?0:3e3).toastClass(alert.className||"")),alert.callback&&_alert.then(alert.callback)}}}angular.module("explorer.services.alert",[]).service("Alert",["$mdDialog","$timeout",AlertService])}(),function(){"use strict";function StoriesFactory($http,$window,appConfig,Alert,Settings){return{get:function(listName,objectId){return listName=listName||null,objectId=objectId||$window.SITE_ID,$http({url:appConfig.api+"site/"+objectId+"/"+listName,method:"POST",dataType:"json",data:{task:"get"+listName,objectId:objectId},headers:appConfig.headers})}}}function PersonFactory($http,$window,$localStorage,appConfig,Alert,Settings){var _user={};return{submitForm:function(formName,formData){return $http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"submit"+formName,siteId:$window.SITE_ID,data:formData},headers:appConfig.headers})},login:function(user,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"login",email:user.email,pass:user.password},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):(Alert.fire({message:"There was a problem with your username/password."}),callback(data))}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem. Please try again later."})})},register:function(user,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"register",reservationId:Settings.get("reservationId"),email:user.email,password:user.password},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"There was a problem with your username/password."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem registering. Please try again later."})})},getTripMessages:function(tripId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getTripMessages",tripId:tripId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting messages."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},getMessages:function(callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getMessages",token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting messages."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},getMessageById:function(objectId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getMessageById",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):(Alert.fire({message:"Error getting message."}),callback(null))}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},getArchiveMessages:function(callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getArchiveMessages",token:Settings.get("token"),model:"messages"},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting messages."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},getArchiveMessageById:function(objectId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getArchiveMessageById",objectId:objectId,token:Settings.get("token"),model:"messages"},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):(Alert.fire({message:"Error getting message."}),callback(null))}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},removeMessageById:function(objectId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"removeMessageById",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting messages."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},removeArchiveMessageById:function(objectId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"removeArchiveMessageById",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error updating."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},clickMessageCTA:function(objectId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"clickMessageCTA",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status&&callback(data)}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},findReservation:function(user,callback){Settings.set("has_user_reservations",!1),$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"findReservation",uniqueId:user.uniqueId,lastName:user.lastName,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status&&callback(data)}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem logging you in. Please try again later."})})},findGuestReservation:function(user,callback){return Settings.set("has_user_reservations",!1),$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"findGuestReservation",uniqueId:user.uniqueId,lastName:user.lastName},headers:appConfig.headers}).success(function(data,status,headers,config){}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem looking up your reservation. Please try again later."})})},getReservationById:function(resId,callback){if(Settings.get("has_user_reservation_"+resId))return callback(Settings.get("user_reservation_"+resId));$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getReservationById",token:Settings.get("token"),resId:resId},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(Settings.set("has_user_reservation_"+resId,!0),Settings.set("user_reservation_"+resId,data),callback(data)):callback(null)}).error(function(data,status,headers,config){callback(null),Alert.fire({message:"There was a problem logging you in. Please try again later."})})},listAllReservations:function(options,callback){options=options||{},options.limit=options.limit||2,$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"allReservations",limit:options.limit,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status&&callback(data)}).error(function(data,status,headers,config){callback(null),Alert.fire({message:"There was a problem logging you in. Please try again later."})})},setPerson:function(user){_user=user},getProfiles:function(callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getProfiles",token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Could not find profile."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem logging you in. Please try again later."}),callback(null)})},getUserLocalFavorites:function(options,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getUserFavorites",limit:options.limit||3,hotelcode:options.hotelcode,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting favorites. Please try again later."})}).error(function(data,status,headers,config){callback(null),Alert.fire({message:"Error getting favorites. Please try again later."})})},getUserFavorites:function(options,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getUserFavorites",token:Settings.get("token"),tripId:options.tripId},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting favorites. Please try again later."})}).error(function(data,status,headers,config){callback(null),Alert.fire({message:"Error getting favorites. Please try again later."})})},updateUserFavorite:function(placeId,category,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"updateUserFavorite",placeId:placeId,category:category,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(Settings.set("user_favorites_no_update",!1),callback(data)):Alert.fire({message:"Error updating favorite. Please try again later."})}).error(function(data,status,headers,config){callback(null),Alert.fire({message:"Error updating favorite. Please try again later."})})}}}function DestinationsFactory($rootScope,$http,$q,$window,$localStorage,appConfig,Alert,Settings){var regionId=$window.RID;return{get:function(listName,objectId,childId,language){return language=language||"",language==objectId&&(language=""),objectId=objectId||"",childId=childId||"",$http({url:appConfig.api+"destinations/"+$window.RID+"/"+listName+(objectId?"/"+("string"==typeof objectId?objectId:objectId.id||objectId.destinationId):"")+(childId?"/"+childId:""),method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"get"+listName,objectId:objectId,childId:childId,regionId:regionId,language:language},headers:appConfig.headers})}}}function PlacesFactory($rootScope,$http,$q,$window,$localStorage,$location,appConfig,Alert,Settings){var places=[],destinations=[],cityId=null;return{autocomplete:function(query,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"autocomplete",q:query},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){callback(null)})},get:function(listName,objectId,propertyId,isPreview){if(isPreview=isPreview||"",propertyId=propertyId||"",objectId=objectId||$window.RID,Settings.get("has_"+listName+objectId+propertyId)){var deferred=$q.defer();return deferred.resolve({data:Settings.get(listName+objectId+propertyId)}),deferred.promise}return"RegionOffersDetails"==listName?$http.get("https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/dist/extraholidays.offers.json?ver="+$window.APP_VERSION).success(function(data){"ok"==data.status&&(Settings.set("has_"+listName+objectId+propertyId,!0),Settings.set(listName+objectId+propertyId,data))}):$http({url:appConfig.api+"region/"+objectId+"/"+listName,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"get"+listName,objectId:objectId,propertyId:propertyId,isPreview:isPreview},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status&&(Settings.set("has_"+listName+objectId+propertyId,!0),Settings.set(listName+objectId+propertyId,data))})},markView:function(listName,id){return $http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"markView"+listName,id:id,token:Settings.get("token")},headers:appConfig.headers})},addErrorPage:function(url,referrer){return $http({url:appConfig.api,method:"POST",dataType:"json",data:{task:"addErrorPage",siteId:window.SITE_ID,url:url,referrer:referrer},headers:appConfig.headers})},setCityId:function(_cityId){cityId=_cityId},getCityId:function(slug){return slug?destinations[slug]:cityId},getPlaces:function(){return places},getNearbyResorts:function(){function _fetchAPI(){return $http({url:appConfig.api+"region/"+$window.RID+"/nearbyResorts"+($location.search().isPreview?"?isPreview=1":""),method:"GET",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"nearbyResorts",objectId:$window.RID},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status&&(Settings.set("has_nearby_resorts",!0),Settings.set("nearby_resorts",data.regions),$window.isLightHouse||$rootScope.$broadcast("triggerRegionsLoaded",data.regions))}).error(function(data,status,headers,config){Settings.set("has_nearby_resorts",!0),Settings.set("nearby_resorts",{}),$window.isLightHouse||$rootScope.$broadcast("triggerRegionsLoaded",{})})}return $location.search().isPreview?_fetchAPI():$http.get("https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/dist/extraholidays.json?ver="+$window.APP_VERSION).success(function(data){if("ok"!=data.status)return console.log("JSON fetch fail, calling API"),_fetchAPI();Settings.set("has_nearby_resorts",!0),Settings.set("nearby_resorts",data.regions),$window.isLightHouse||$rootScope.$broadcast("triggerRegionsLoaded",data.regions)}).error(function(error){return console.log("JSON fetch error, calling API"),_fetchAPI()})},getPropertyDetails:function(objectId,callback){var order="object"==typeof objectId?objectId.order:null;objectId="object"==typeof objectId?objectId.hotelcode:objectId,$http({url:appConfig.api+"/property/details/"+objectId,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getPropertyDetails",objectId:objectId},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(order&&(data.order=order),callback(data)):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){callback(null)})},getMetaPropertyDetails:function(objectId){if(Settings.get("hasCurrentListing"))return!0;"object"==typeof objectId&&objectId.order;return objectId="object"==typeof objectId?objectId.hotelcode:objectId,$http({url:appConfig.api+"property/details/"+objectId,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getPropertyDetails",objectId:objectId},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(Settings.set("hasCurrentListing",!0),Settings.set("currentListing",data.property)):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){callback(null)})},getListingById:function(id){angular.forEach(places,function(place){if(place.id==id)return place})},all:function(query,callback){return $http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"placeSearch",q:query},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(places=data.places.map(function(entry){return entry._name=angular.lowercase(entry.name),entry._city=angular.lowercase(entry.city),entry._address=angular.lowercase(entry.formatted_address.AddressLine+" "+entry.formatted_address.CityName),entry._state=angular.lowercase(entry.state),entry}),angular.forEach(data.destinations,function(value,key){destinations[value.slug]=parseInt(value.id)})):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){})},getNearbyListing:function(slug){return $http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getNearbyListing",token:Settings.get("token"),slug:slug},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(Settings.set("has_place_id_listing_"+slug,!0),Settings.set("place_id_listing_"+slug,data)):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){})},getPlaceIdListing:function(placeId,callback){if(Settings.get("has_place_id_listing_"+placeId))return callback(Settings.get("place_id_listing_"+placeId));$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getPlaceIdListing",token:Settings.get("token"),placeId:placeId},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(Settings.set("has_place_id_listing_"+placeId,!0),Settings.set("place_id_listing_"+placeId,data),callback(data)):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){callback(null)})},getPropertyDirections:function(hotelcode,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getPropertyDirections",hotelcode:hotelcode},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){callback(null)})},getPlaceDirections:function(placeId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getPlaceDirections",placeId:placeId},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"No Results"})}).error(function(data,status,headers,config){callback(null)})}, getPropertyByMessageId:function(objectId,callback){$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getPropertyByMessageId",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?callback(data):Alert.fire({message:"Error getting messages."})}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},getSpecials:function(objectId){return objectId=objectId||"",$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getSpecials",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data){Settings.set("specials",data.specials)}).error(function(data,status,headers,config){Alert.fire({message:"There was a problem getting your messages. Please try again later."})})},getDestinationsList:function(){return $http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getDestinationsList",token:Settings.get("token")},headers:appConfig.headers}).success(function(data){Settings.set("hasDestinationsList",!0),Settings.set("destinationsList",data.destinations),Settings.set("featuredResortsList",data.resorts)}).error(function(data,status,headers,config){})},getDestinationDetails:function(objectId){return $http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:{task:"getDestinationDetails",objectId:objectId,token:Settings.get("token")},headers:appConfig.headers}).success(function(data){Settings.set("hasDestinationDetails_".objectId,!0),Settings.set("destinationDetails_".objectId,data.destinations)}).error(function(data,status,headers,config){})},nearby:function(options,callback){if(options=options||{},options.task="nearby",options.id=options.listingId||window.PROPERTY_ID,Settings.get("has_nearby_listings_"+options.category+"_"+options.id))return callback(Settings.get("nearby_listings_"+options.category+"_"+options.id));$http({url:appConfig.api+"nearby/property/"+options.id+"/"+options.category,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:options,headers:{"Content-Type":"application/json"}}).success(function(data,status,headers,config){"ok"==data.status&&(Settings.set("has_nearby_listings_"+options.category+"_"+options.id,!0),Settings.set("nearby_listings_"+options.category+"_"+options.id,data),callback(data))}).error(function(data,status,headers,config){callback(null)})},nearbyDestination:function(options,callback){if(options=options||{},options.task="nearbyDestination",options.token=Settings.get("token"),Settings.get("has_destination_nearby_listings_"+options.category+"_"+options.destinationId))return Settings.get("destination_nearby_listings_"+options.category+"_"+options.destinationId);$http({url:appConfig.api,method:"POST",dataType:"json",contentType:"application/json; charset=utf-8",data:options,headers:{"Content-Type":"application/json"}}).success(function(data,status,headers,config){"ok"==data.status&&(Settings.set("has_destination_nearby_listings_"+options.category+"_"+options.destinationId,!0),Settings.set("destination_nearby_listings_"+options.category+"_"+options.destinationId,data),callback(data))}).error(function(data,status,headers,config){})}}}angular.module("explorer.services.data",[]).factory("Person",["$http","$window","$localStorage","appConfig","Alert","Settings",PersonFactory]).factory("Places",["$rootScope","$http","$q","$window","$localStorage","$location","appConfig","Alert","Settings",PlacesFactory]).factory("Destinations",["$rootScope","$http","$q","$window","$localStorage","appConfig","Alert","Settings",DestinationsFactory]).factory("Stories",["$http","$window","appConfig","Alert","Settings",StoriesFactory])}(),function(){"use strict";function Focus($timeout,$window){return function(id){$timeout(function(){var element=$window.document.getElementById(id);element&&element.focus()})}}function Settings($rootScope,$state,$stateParams,$document,$localStorage,$focus){var _storage={};new Date(moment()),new Date(moment().add(2,"days"));return{hideKeyboard:function(){document.activeElement.blur();for(var inputs=document.querySelectorAll("input"),i=0;i-1&&(_promoId=_promoId.split("?")[0]),"object"==typeof _promoId&&(_promoId=_promoId[0]),$window.PROMOID=_promoId,$window.PROMOID.toLowerCase()){case"bf2020":case"bf2020dt":case"bd2020pp":case"bf2020soc":case"bf22":case"hol2020":case"psearch":break;case"psearch15":case"eh_20off":$window.PROMOID="PSearch15",15e3;break;case"psearch20":case"eh_20off":$window.PROMOID="PSearch20",15e3}$rootScope.$emit("updatePromoCode",$window.PROMOID)}}function handlePopupData(popupData){if(popupData&&!Settings.get("displayed_"+popupData.id)&&!$cookies.get("optout_"+popupData.id)){var currentTime=new Date,expireTime=new Date,lastVisit=$cookies.get("popup_"+popupData.id),showPopup=!1;expireTime.setHours(expireTime.getHours()+19080);var popup=$mdDialog.confirm({controller:function($scope,$cookies,$mdDialog,popupData){$scope.popup=popupData,$scope.closeDialog=function(ev){$mdDialog.hide()},$scope.optOut=function(ev){$cookies.put("optout_"+popupData.id,moment(currentTime).format("YYYY-MM-DD"),{expires:expireTime,secure:!0}),$mdDialog.hide()}},templateUrl:"app/cards/pop-up.html",locals:{popupData:popupData},parent:angular.element(document.body),clickOutsideToClose:"1"==popupData.clickAwayToClose});if($cookies.put("popup_"+popupData.id,moment(currentTime).format("YYYY-MM-DD"),{expires:expireTime,secure:!0}),lastVisit&&(lastVisit=new Date(lastVisit)),"all"==popupData.urlDisplay||"home"==popupData.urlDisplay&&"/"==$window.location.pathname||"show"==popupData.urlDisplay&&popupData.displayUrls&&popupData.displayUrls.indexOf($window.location.pathname)>-1){switch(popupData.frequency){case"always":showPopup=!0;break;case"once":lastVisit||(showPopup=!0);break;case"daily":(!lastVisit||moment().diff(moment(lastVisit),"days")>1)&&(showPopup=!0);break;case"weekly":(!lastVisit||moment().diff(moment(lastVisit),"weeks")>=1)&&(showPopup=!0);break;case"monthly":(!lastVisit||moment().diff(moment(lastVisit),"months")>=1)&&(showPopup=!0)}showPopup&&("always"!=popupData.frequency&&Settings.set("displayed_"+popupData.id,!0),popupData.delay=popupData.delay||3e3,$timeout(function(){$analytics.eventTrack("Pop-Up Open",{category:"Pop-Up Interaction",label:popupData.title}),angular.element(document.body).hasClass("md-dialog-is-showing")?popupQueue.push(popupData):$mdDialog.show(popup).then(function(){popupQueue.length&&handlePopupData(popupQueue.pop())})},parseInt(popupData.delay)),parseInt(popupData.duration)&&$timeout(function(){$mdDialog.hide(),$analytics.eventTrack("Auto Close",{category:"Pop-Up Interaction",label:popupData.title,value:3e3+parseInt(popupData.duration)})},parseInt(popupData.delay)+parseInt(popupData.duration)))}}}function openSidenav(){$mdSidenav("right").open()}function closeSidenav(){$mdSidenav("right").close()}function isSidenavOpen(){return $mdSidenav("right").isOpen()}function createFilterFor(query){var lowercaseQuery=angular.lowercase(query);return lowercaseQuery=lowercaseQuery.replace(/[^a-zA-Z0-9 ]/g,""),function(item){return item.value.indexOf(lowercaseQuery)>-1}}function loadAll(){if(searchContext.length>0)return searchContext;regions=Settings.get("nearby_resorts");return angular.forEach(regions,function(region,regionName){regionsContext.push({name:regionName,resortCount:region.hotels.length,url:"/"+$filter("toSlug")(regionName)}),angular.forEach(region,function(hotels){angular.forEach(hotels,function(hotel){hotel.cityName&&hotel.name&&hotel.address&&(tmpHotel={id:hotel.id,name:hotel.name.replace(/<[^>]*>?/gm,""),city:hotel.cityName,state:hotel.stateName,region:regionName,country:hotel.address.addressCountry,postalCode:hotel.address.postalCode,telephone:hotel.telephone,image:hotel.image,url:"/"+hotel.cityState+"/"+hotel.slug,brand:hotel.brand||$window.APP_CLIENT},hotel.additionalProperty&&angular.forEach(hotel.additionalProperty,function(property){switch(property.name){case"Additional Locations":tmpHotel.additionalLocations=property.value}}),hotel.alternateName&&(tmpHotel.alternateName=hotel.alternateName.join(" ")),resortsContext.push(tmpHotel))})})}),angular.forEach(resortsContext,function(context){destinationProperties.length&&angular.forEach(destinationProperties,function(property){property.pid==context.id&&(context.value=property.tree.join(" ")+" "+context.value)}),searchContext.push(context)}),destinationsTree.length&&angular.forEach(destinationsTree,function(context){searchContext.push(context)}),angular.forEach(_menuItems,function(item){1==item.isActive&&(item.name=item.menuName,searchContext.push(item))}),angular.forEach($window.LANDING_PAGES,function(item){var exists=!1;1==item.isActive&&-1==item.slug.indexOf("http")&&(angular.forEach(searchContext,function(context){(context.url&&context.url==item.url||context.slug&&context.slug==item.url)&&(exists=!0)}),exists||(item.url=item.slug,item.menuName=item.title||item.pageTitle,item.name=item.menuName,item.value=item.title.toLowerCase(),searchContext.push(item)))}),searchContext=searchContext?searchContext.map(function(item){return item.value=item.value||"",item.value+=" "+item.name.toLowerCase()+" "+(item.city?item.city.toLowerCase():"")+" "+(item.state?item.state.toLowerCase():"")+" "+(item.region?item.region.toLowerCase():"")+" "+(item.country?item.country.toLowerCase():"")+" "+(item.additionalLocations?item.additionalLocations.toLowerCase():"")+" "+(item.alternateName?item.alternateName.toLowerCase():"")+" "+(item.brand?item.brand.toLowerCase():"")+" "+item.telephone+" "+item.postalCode,item.value=item.value.replace(/[^a-zA-Z0-9 ]/g,""),item}):[]}function exit(uri){$timeout(function(){window.location.href=uri},800)}function go(state,params){params=params||{},$state.go(state,params)}function goBack(){$state.go($rootScope.header.backState.pop()||"welcome",$rootScope.header.backParams.pop()||{}),$rootScope.header.deferStackTrace=!0}function close(){Settings.focus(),$state.go($rootScope.header.backState.pop()||"welcome",$rootScope.header.backParams.pop()||{}),$rootScope.header.deferStackTrace=!0}if($window.isLightHouse||Places.getNearbyResorts(),$rootScope.mediaMode={},$window.innerWidth>0&&($window.innerWidth>599&&($rootScope.mediaMode.nonMobile=!0),$window.innerWidth<600?($rootScope.mediaMode.xs=!0,$window.mobileTabletDevice=!0):$window.innerWidth<960?($rootScope.mediaMode.sm=!0,$window.mobileTabletDevice=!0):$window.innerWidth<1280?$rootScope.mediaMode.md=!0:$window.innerWidth<1920?$rootScope.mediaMode.lg=!0:$rootScope.mediaMode.xl=!0),angular.element($window).on("resize",function(){$window.innerWidth>0&&($rootScope.mediaMode={},$window.innerWidth>599&&($rootScope.mediaMode.nonMobile=!0),$window.innerWidth<600?$rootScope.mediaMode.xs=!0:$window.innerWidth<960?$rootScope.mediaMode.sm=!0:$window.innerWidth<1280?$rootScope.mediaMode.md=!0:$window.innerWidth<1920?$rootScope.mediaMode.lg=!0:$rootScope.mediaMode.xl=!0)}),$location.hash()&&$window.hashReplacements&&$window.hashReplacements.indexOf($location.hash())&&$timeout(function(){$anchorScroll($window.hashReplacements[$location.hash()])},3e3),1==$window.LANG_SUPPORT){if($location.hash().indexOf("googtrans")>-1){var _currentLanguage=$location.hash().replace("googtrans(en|","").replace(")","");if("en"==_currentLanguage)$cookies.remove("currentLanguage"),$cookies.remove("googtrans"),$cookies.remove("googtrans",{path:"/",domain:".brewerdigitalmarketing.com"}),$cookies.remove("googtrans",{path:"/",domain:$window.location.hostname.replace("www.",".")});else{var expireDate=new Date;expireDate.setMinutes(expireDate.getMinutes()+30),$cookies.put("currentLanguage",_currentLanguage,{secure:!0,expires:expireDate})}$timeout(function(){$location.hash("")},4500)}$window.currentLanguage=$cookies.get("currentLanguage"),$rootScope.currentLanguage=$cookies.get("currentLanguage"),$rootScope.currentLanguage&&"en"!=$rootScope.currentLanguage&&"null"!=$rootScope.currentLanguage?$rootScope.googleTranslateActive=!0:($cookies.remove("googtrans"),$cookies.remove("googtrans",{path:"/",domain:".brewerdigitalmarketing.com"}),$cookies.remove("googtrans",{path:"/",domain:$window.location.hostname.replace("www.",".")}))}var urlParams=$location.search();angular.forEach(urlParams,function(value,key){switch(key.toLowerCase()){case"lid":$window.LID=value,$analytics.eventTrack(key,{category:"phone"}),Places.get("SiteDynamicPhone",$window.LID).then(function(response){"ok"==response.data.status&&response.data.phone&&($rootScope.headerPhone=response.data.phone)});break;case"identifier":$location.url().indexOf("memberbenefit")>-1&&-1==$location.url().indexOf("memberbenefit-aarp")&&($window.PROMOID=value,$analytics.eventTrack(value,{category:"memberbenefit"}),Places.get("SiteMemberBenefit",value).then(function(response){"ok"==response.data.status&&response.data.name&&$rootScope.$broadcast("triggerUpdateH1",response.data.name)}));break;case"discount":$window.DISCOUNTCODE=value,$window.RATEPLANID=$location.search().ratePlanId||$location.search().RatePlanId,Alert.fire({message:'Discount: "'+$window.DISCOUNTCODE.toUpperCase()+'" applied!'});break;case"gaevent":$window.GAEVENT=value;break;case"promoid":$analytics.eventTrack(value,{category:"promotion"});break;case"prodid":$window.PRODUCTID=value;break;case"message":Alert.fire({message:value.replace("+"," "),noHide:!0});break;case"hotelid":$window.HOTELCODE=value;break;case"rtid":$window.ROKTID=value}}),$rootScope.decoration=$rootScope.decoration||{},$rootScope.isDesktop=!appConfig.isMobileDevice,$rootScope.isMobile=appConfig.isMobileDevice;var popupQueue=[],_menuItems=$window.APP_CONFIG.menu,_footerMenuItems=[],pageOrdering=1;$window.LANDING_PAGES&&(angular.forEach($window.LANDING_PAGES,function(page){"1"==page.isActive&&(page.params={},page.menuName=page.title,page.state=page.id,page.slug&&0==page.slug.indexOf("http")&&(page.params.external=1),page.slug=page.slug&&page.slug.replace("https://"+$window.location.hostname,""),page.ordering=page.ordering?parseInt(page.ordering):pageOrdering++,page.children=[],page.parent&&"0"!=page.parent||(_menuItems[page.state]=page),"1"==page.isFooterMenuItem&&(_footerMenuItems[page.state]=page))}),angular.forEach($window.LANDING_PAGES,function(page){angular.forEach(_menuItems,function(menuItem){menuItem.children=menuItem.children||[],page.parent!=menuItem.id&&page.parent!=menuItem.state||"1"!=page.isMenuItem||"1"!=page.isActive||menuItem.children.push({id:page.id,parent:page.parent,title:page.title,pageTitle:page.pageTitle||page.title,slug:page.slug,ordering:"1"==page.isMenuItem?parseInt(page.ordering):menuItem.ordering,children:[]})})}),angular.forEach($window.LANDING_PAGES,function(page){angular.forEach(_menuItems,function(menuItem){angular.forEach(menuItem.children,function(child){page.parent!=child.id&&page.parent!=child.state||"1"!=page.isMenuItem||"1"!=page.isActive||child.children.push({id:page.id,parent:page.parent,title:page.title,pageTitle:page.pageTitle||page.title,slug:page.slug,ordering:"1"==page.isMenuItem?parseInt(page.ordering):menuItem.ordering})})})}));var gdpr=$cookies.get("gdpr_agree"),hideGdpr=!1;if(!gdpr&&1!=$window.CUSTOM_GDPR){$timeout(function(){hideGdpr=!0},3e3);var linksHTML="";$window.APP_CONFIG.core&&$window.APP_CONFIG.core.footer&&($window.APP_CONFIG.core.footer.privacyLink&&(linksHTML+=' Privacy Notice'),$window.APP_CONFIG.core.footer.termsLink&&(linksHTML+=' Terms')),$mdToast.show({hideDelay:0,position:"bottom left",template:'
To personalize content and provide a safer experience, we use cookies. By using this site you agree to our use of cookies.'+linksHTML+'
Dismiss
',controller:function($mdToast){this.hideToast=function(){$mdToast.hide();var currentTime=new Date,expireTime=new Date;expireTime.setHours(expireTime.getHours()+8760),$cookies.put("gdpr_agree",moment(currentTime).format("YYYY-MM-DD"),{expires:expireTime,secure:!0})}},controllerAs:"ctrl"}).then(function(result){})}$rootScope.menuItems=_menuItems,$rootScope.MetaTags=MetaTags,$rootScope.header={},$rootScope.header.hasBackButton=!1,$rootScope.contentLoaded=!0,$rootScope.noHeaderImageClass="",$rootScope.openSidenav=openSidenav,$rootScope.closeSidenav=closeSidenav,$rootScope.isSidenavOpen=isSidenavOpen;var amenityIconSet={Accessible:"","Air-conditioned":"","Air Conditioned":"","Airport shuttle":"",Bar:"","Business center":"","Fitness Center":"","2 Fitness Centers":"","Exercise Gym":"","Free breakfast":"","Free Breakfast":"","Continental breakfast":"","Gift Shop":"","Nearby Shopping":"",Golf:"","Golf Nearby":"","18-hole Golf Course":"","Championship Golf Course":"","Access to Championship Golf Course":"","14-Station Driving Range":"","Free parking":"","Wi-Fi":"","Complimentary Wi-Fi":"","Free Wi-Fi":"","Free Wi-fi":"","Hot tub":"","Hot Tub":"","2 Hot Tubs":"","3 Hot Tubs":"","4 Hot Tubs":"","5 Hot Tubs":"","6 Hot Tubs":"","Indoor Hot Tub & Sauna":"","Kid-friendly":"","Full Kitchens":"","Kitchen in all rooms":"","Kitchen/Kitchenette":"","In Room Kitchens/Kitchenettes":"","Laundry service":"","Laundry Service":"","Laundry Facilities":"",Pool:"","2 Pools":"","2 Outdoor Pools":"","6 Sparkling Pools":"","Outdoor Pool":"","Heated Pool":"","Outdoor Pool with Whirlpool":"","Indoor & Outdoor Swimming Pools":"","Childrens Pool":"",Restaurant:"","Restaurant & Lobby Bar":"","Restaurant - The Toll Booth Tavern":"","Pet-friendly":"",Smoking:"","Smoke free":"","Indoor Parking":"","Free Parking":"","Valet Parking - Fee":"","Shuttle Bus":"","Shuttle to Napa":"","Disney Shuttle - Fee":""};Settings.set("amenityIconSet",amenityIconSet),$rootScope.amenityIconSet=amenityIconSet,$rootScope.search={};var regions,tmpHotel,searchContext=[],searchContext=[],regionsContext=[],resortsContext=[],destinationsTree=[],destinationProperties=[];$window.isLightHouse||function(){$http.get("https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/dist/extraholidays.destinations.json?v="+$window.APP_VERSION).then(function(response){response.data&&"ok"==response.data.status&&(destinationsTree=response.data.destinationsTree,destinationProperties=response.data.destinationProperties,Settings.set("destinationsTree",destinationsTree),Settings.set("destinationProperties",destinationProperties),$rootScope.$broadcast("triggerDestinationsTreeLoaded"))},function(error){console.log(error)})}(),$rootScope.navSearch=function(query){return console.log(query),searchContext.length?query.length&&$analytics.eventTrack(query,{category:"search",label:"top nav search"}):searchContext=loadAll(),query?searchContext.filter(createFilterFor(query)):null},$rootScope.navItemChange=function(item){$rootScope.search.searchText&&item&&(Settings.hideKeyboard(),$location.path(item.url),$rootScope.search.searchText="",angular.element("search-bar-autocomplete").blur())},$rootScope.translatePopup=function(ev){var popup=$mdDialog.confirm({controller:function($scope,$cookies,$window,$analytics,$mdDialog){$scope.updateLanguage=function(language){$analytics.eventTrack("Select Language Modal",{category:"Language Selection",label:language}),$cookies.put("currentLanguage",language,{secure:!0}),$window.location.href=$window.location.href.split("?")[0].split("#")[0]+"?#googtrans(en|"+language+")"},$scope.closeDialog=function(ev){$mdDialog.hide()}},templateUrl:"app/cards/translate-popup.html",parent:angular.element(document.body),targetEvent:ev,clickOutsideToClose:!0});$mdDialog.show(popup).then(function(){})},$rootScope.showAvailabilityAlert=function(ev,resort,roomType){var availabilityAlert=$mdDialog.show({targetEvent:ev,parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"app/regional/extraholidays/cards/view/availability-alert.tpl.html",controller:function($scope,$filter,$timeout,$window,$mdDialog,Places,Settings){new Date;$window.dataLayer=$window.dataLayer||[],$scope.selectedResortDestination=resort,$scope.roomTypeFilter=roomType||!1,$scope.roomType=roomType,$scope.availabilityAlertsForm={numberOfTravelers:2,checkinDate:new Date(Settings.get("checkinDate")?moment(Settings.get("checkinDate")):moment().add(2,"days")),checkoutDate:new Date(Settings.get("checkoutDate")?moment(Settings.get("checkoutDate")):moment().add(4,"days")),contactMethod:"Email"},$window.dataLayer.push({event:"availabilityAlert.open",eventCategory:"Availability Alert",eventAction:"Open",eventLabel:$scope.availabilityAlertsForm.numberOfTravelers+": "+moment($scope.availabilityAlertsForm.checkinDate).format("YYYY-MM-DD")+" - "+moment($scope.availabilityAlertsForm.checkoutDate).format("YYYY-MM-DD")}),$scope.$watch("availabilityAlertsForm.checkinDate",function(oldVal,newVal){moment($scope.availabilityAlertsForm.checkoutDate).diff(moment($scope.availabilityAlertsForm.checkinDate))<=86400001&&($scope.availabilityAlertsForm.checkoutDate=new Date(moment($scope.availabilityAlertsForm.checkinDate).add(2,"days")))}),$scope.$watch("availabilityAlertsForm.checkoutDate",function(oldVal,newVal){moment($scope.availabilityAlertsForm.checkinDate).diff(moment($scope.availabilityAlertsForm.checkoutDate))>=-86400001&&($scope.availabilityAlertsForm.checkinDate=new Date(moment($scope.availabilityAlertsForm.checkoutDate).subtract(2,"days")))}),$scope.closeDialog=function(){$mdDialog.hide()},$window.submitAvailabilityRequest=function(){return $window.dataLayer.push({event:"availabilityAlert.submitRequest",eventCategory:"Availability Alert",eventAction:"Submit Request",eventLabel:$scope.availabilityAlertsForm.numberOfTravelers+": "+moment($scope.availabilityAlertsForm.checkinDate).format("YYYY-MM-DD")+" - "+moment($scope.availabilityAlertsForm.checkoutDate).format("YYYY-MM-DD")}),$timeout(function(){Alert.fire({title:"Thanks for reaching out!",message:"Someone from our team will be reaching out via email as soon as these dates become available for your party.",duration:8e3})},500),!0}}}).finally(function(){availabilityAlert=void 0})},$rootScope.bookNow=function(hotel,offset,room){if(console.log(hotel,offset,room),offset=offset||2,$window.BOOKING_URL){var options={checkin:$filter("date")(new Date(moment(Settings.get("checkinDate"))),"MM/dd/yyyy"),checkout:$filter("date")(new Date(moment(Settings.get("checkoutDate"))),"MM/dd/yyyy"),numAdults:1,numChildren:0,rooms:1,promoCode:$window.PROMOID||null,gaEvent:$window.GAEVENT||null,lid:$window.LID||null,cjevent:$window.CJEVENT||null,roktid:$window.ROKTID||null};hotel&&(hotel.hotelCode&&(options.hotelId=hotel.hotelCode),hotel.slug&&(options.slug=hotel.slug),hotel.sameAs&&(options.sameAs=hotel.sameAs),hotel.brand&&(options.brand=hotel.brand),hotel.geo&&(options.lat=hotel.geo.latitude,options.lng=hotel.geo.longitude),hotel.sameAs&&hotel.sameAs.length&&hotel.sameAs[0].indexOf("insiderextras.com")>-1&&(options.bookingURL=hotel.sameAs[0])),room&&room.identifier&&(options.roomType=room.identifier),$window._booking_bar_link&&$window.open($window._booking_bar_link(options),"_blank")}},$rootScope.propertyGroupTravel=function(hotel){Settings.set("groupTravelProperty",hotel.name),$state.go("meetings")},$rootScope.getPhotoUrl=function(target,url,size,crop){if(url&&"string"==typeof url){if(target&&""!=target)var result=document.getElementsByClassName(target);if("auto"===(size=size||"200")&&target){var el=angular.element(result);return el&&el[0]?url.replace("=s0","=s"+el[0].clientWidth+(crop?"-c":"")):""}return url.replace("=s0","=s"+size+(crop?"-c":""))}},$rootScope.scrollToTop=function(){$window.scrollTo(0,0)},$rootScope.blurSelect=function(){$mdSelect.hide()},$rootScope.blurSearchAutocomplete=function(){angular.element(document.querySelector("#search-autocomplete"))[0].querySelector("input").blur()};var clientId=$window.getClientId();clientId&&Settings.set("token",clientId);var contentGroup1,dimension2,firstRun=!0;$rootScope.search={},$rootScope.go=go,$rootScope.close=close,$rootScope.goBack=goBack,$rootScope.exit=exit,$rootScope.data={},$rootScope.header.backState=[],$rootScope.header.backParams=[],$rootScope.$on("triggerUpdateDecoration",function(ev,decoration){$timeout(function(){$rootScope.decoration=decoration},250)}),$rootScope.$on("triggerUpdatePromoCode",function(ev,promoCode){checkIdentifier(promoCode)}),$rootScope.$on("$stateChangeSuccess",function(ev,to,toParams,from,fromParams){Settings.get("locationSearchUrlParams")&&($location.search(Settings.get("locationSearchUrlParams")),Settings.set("locationSearchUrlParams",null)),$rootScope.noHeaderImageClass="";try{$window.scrollTo(0,0),$window.onScrollHandler&&onScrollHandler()}catch(e){console.log(e)}$window.customTracking&&"function"==typeof $window.customTracking&&$window.customTracking(to.url,to),$timeout(function(){$rootScope.bodyClass="string"==typeof to.url&&"/"!=to.url?to.url.replace(/\//g,"").toLowerCase():"home",$rootScope.data.selectedIndex=to.data.index,checkIdentifier();try{from.url!=to.url&&($window.scrollTo(0,0),$window.onScrollHandler&&onScrollHandler()),$window.POPUP_NOTIFICATIONS?angular.forEach($window.POPUP_NOTIFICATIONS,function(popupData){handlePopupData(popupData)}):$window.POPUP_NOTIFICATION&&handlePopupData($window.POPUP_NOTIFICATION)}catch(e){console.log(e)}hideGdpr&&(hideGdpr=!1,$mdToast.hide()),$location.hash()&&$timeout(function(){$anchorScroll()},1800),to.data.pageTitle=document.title,to.data.pageTitle&&Settings.setPageTitle(to.data.pageTitle),$rootScope.header.deferStackTrace?$rootScope.header.deferStackTrace=!1:($rootScope.header.backState.push(from.name),$rootScope.header.backParams.push(fromParams)),$window.ga&&$window.ga("send","pageview",{location:$location.absUrl(),page:$location.path(),title:to.data.pageTitle||$filter("camelCaseToHuman")($location.path())}),$window.dataLayer&&(dataLayer.push({event:"content-view"}),dataLayer.push({event:"internalPageview"})),!firstRun&&$window.ga?($rootScope.decoration={},contentGroup1="hotel"==to.name?toParams.slug.ucwords():to.data.pageTitle||$filter("camelCaseToHuman")($location.path()),dimension2=contentGroup1,$window.ga("rT.send","pageview",{location:$location.absUrl(),dimension2:dimension2,dimension4:$location.path(),page:$location.path(),title:to.data.pageTitle||$filter("camelCaseToHuman")($location.path())}),$window.ga("pT.send","pageview",{location:$location.absUrl(),page:$location.path(),title:to.data.pageTitle||$filter("camelCaseToHuman")($location.path())})):firstRun=!1;try{$timeout(function(){document.getElementById("header-toolbar")?$rootScope.headerToolbarHeight=document.getElementById("header-toolbar").clientHeight+"px":$rootScope.headerToolbarHeight="0px",document.getElementById("sitewide-notice")?$rootScope.sitewideNoticeHeight=document.getElementById("sitewide-notice").clientHeight+"px":$rootScope.sitewideNoticeHeight="0px"},window.delayRoutingTrigger?100:300)}catch(e){console.log(e),$rootScope.headerToolbarHeight="162px",$rootScope.sitewideNoticeHeight="34px"}},200)})}String.prototype.ucwords=function(){return this.replaceAll("-"," ").replace(/^([a-z\u00E0-\u00FC])|\s+([a-z\u00E0-\u00FC])/g,function($1){return $1.toUpperCase()})},String.prototype.replaceAll=function(search,replacement){return this.replace(new RegExp(search,"g"),replacement)},String.prototype.reversePhone=function(){return this.split("").reverse().join("")},String.prototype.startsWith||(String.prototype.startsWith=function(searchString,position){return position=position||0,this.indexOf(searchString,position)===position});var uiroutermetatags;!function(t){function e(t,e,r,s){function i(t,e,r,i,o){s.prerenderReady=!1}function o(e,s){s.metaTags||t.debug('MetaTags - route: "'+s.name+'" does not contain any metatags'),r.update(s.metaTags)}function a(t,e,i,o,a,n){r.prerender.statusCode=500,s.prerenderReady=!0}function n(t,e,i){r.prerender.statusCode=404,s.prerenderReady=!0}e.MetaTags=r,e.$on("$stateChangeStart",i),e.$on("$stateChangeSuccess",o),e.$on("$stateChangeError",a),e.$on("$stateNotFound",n)}e.$inject=["$log","$rootScope","MetaTags","$window"];var r=angular.module("ui.router.metatags",["ui.router"]),s=function(){function t(){this.prefix="",this.suffix="",this.defaultTitle="", this.defaultDescription="",this.defaultKeywords="",this.defaultRobots="",this.staticProperties={},this.enableOGURL=!1}return t.prototype.setTitlePrefix=function(t){return this.prefix=t,this},t.prototype.setTitleSuffix=function(t){return this.suffix=t,this},t.prototype.setDefaultTitle=function(t){return this.defaultTitle=t,this},t.prototype.setDefaultDescription=function(t){return this.defaultDescription=t,this},t.prototype.setDefaultKeywords=function(t){return this.defaultKeywords=t,this},t.prototype.setDefaultRobots=function(t){return this.defaultRobots=t,this},t.prototype.setStaticProperties=function(t){return this.staticProperties=t,this},t.prototype.setOGURL=function(t){return this.enableOGURL=t,this},t.prototype.$get=function(){return{prefix:this.prefix,suffix:this.suffix,defaultTitle:this.defaultTitle,defaultDescription:this.defaultDescription,defaultKeywords:this.defaultKeywords,defaultRobots:this.defaultRobots,staticProperties:this.staticProperties,enableOGURL:this.enableOGURL}},t}();r.provider("UIRouterMetatags",s);var i=function(){function t(t,e,r,s,i,o,a){this.$log=t,this.UIRouterMetatags=e,this.$interpolate=r,this.$injector=s,this.$state=i,this.$location=o,this.$window=a,this.prerender={}}return t.$inject=["$log","UIRouterMetatags","$interpolate","$injector","$state","$location","$window"],t.prototype.update=function(t){var e=this;try{this.properties=angular.extend({},this.UIRouterMetatags.staticProperties),this.UIRouterMetatags.enableOGURL&&(this.properties["og:url"]=this.$location.absUrl()),t?(this.title=t.title?this.UIRouterMetatags.prefix+(this.getValue("title",t.title)||"")+this.UIRouterMetatags.suffix:this.UIRouterMetatags.defaultTitle,this.description=t.description?this.getValue("description",t.description):this.UIRouterMetatags.defaultDescription,this.keywords=t.keywords?this.getValue("keywords",t.keywords):this.UIRouterMetatags.defaultKeywords,this.robots=t.robots?this.getValue("robots",t.robots):this.UIRouterMetatags.defaultRobots,angular.forEach(t.properties,function(t,r){var s=e.getValue(r,t);s&&(e.properties[r]=s)})):(this.title=this.UIRouterMetatags.defaultTitle,this.description=this.UIRouterMetatags.defaultDescription,this.keywords=this.UIRouterMetatags.defaultKeywords,this.robots=this.UIRouterMetatags.defaultRobots),t&&t.prerender?(this.prerender.statusCode=t.prerender.statusCode?this.getValue("prerender.statusCode",t.prerender.statusCode):200,this.prerender.header=t.prerender.header?this.getValue("rerender.header",t.prerender.header):null):(this.prerender.statusCode=200,this.prerender.header=null),this.$window.prerenderReady=!0}catch(r){this.$log.error("error occured when extracting metatags:",r)}},t.prototype.getValue=function(t,e){try{return e?"number"==typeof e?e:"string"==typeof e&&0===e.trim().length?null:angular.isFunction(e)||Array.isArray(e)?this.$injector.invoke(e,this,this.$state.$current.locals.globals):this.$interpolate(e)(this.$state.$current.locals.globals):null}catch(r){return this.$log.error("error occured when trying to get the value of tag:",t,r),null}},t}();r.service("MetaTags",i),r.run(e)}(uiroutermetatags||(uiroutermetatags={})),angular.module("brewervacations-app",["ngMaterial","ngStorage","ngCookies","ngMessages","humanizeText","ngSanitize","leaflet-directive","smoothScroll","mdPickers","ngMaterialDateRangePicker","ui.router","ui.router.util","ui.router.metatags","ui.carousel","sly","angular-inview","bdmMaterialCarousel","angulartics","angulartics.google.analytics","explorer.app"]).run(["$rootScope","$state","$stateParams","$window","$filter","$localStorage","$timeout","$location","$q","$anchorScroll","$mdSidenav","$mdDialog","$mdToast","$mdSelect","$analytics","$cookies","$http","MetaTags","Person","Places","Settings","Alert","appConfig",GuestAppInit])}(),function(){"use strict";angular.module("explorer.app").controller("ContactUsCtrl",function($state,$stateParams,Settings){var vm=this;vm.CallTel=function(tel){window.location.href="tel:"+tel},vm.MailTo=function(mail){window.location.href="mailto:"+mail},Settings.enableBackButton()}).controller("AboutCtrl",function($state,$stateParams,Settings){var vm=this;Settings.enableBackButton(),vm.property=Settings.get("currentListing")}).controller("PrivacyCtrl",function($state,$stateParams,Settings){Settings.enableBackButton()}).controller("TermsCtrl",function($state,$stateParams,Settings){Settings.enableBackButton()}).controller("OktaLoginCtrl",function($state,$stateParams,$timeout,$window,$cookies,$http,Settings,Alert,appConfig){var vm=this;if(vm.showLoginButton=!1,$cookies.get("_gaWyn_gid")&&Settings.get("oktaUserEnabled")&&Settings.get("oktaEnabledURL"))return $state.go("offerCategory",{slug:Settings.get("oktaEnabledURL")});$timeout(function(){$http({url:appConfig.api+"oktaLogin/"+$window.SESSION_ID||$cookies.get("_gaWyn_gid"),method:"GET",dataType:"json",contentType:"application/json; charset=utf-8",headers:appConfig.headers}).success(function(data,status,headers,config){"ok"==data.status?(Settings.set("oktaUserEnabled",$cookies.get("_gaWyn_gid")),Settings.set("oktaEnabledURL",data.successURL),Alert.fire({title:"Login Success",message:data.message}),$timeout(function(){if(Settings.get("oktaEnabledURL"))return $state.go("offerCategory",{slug:Settings.get("oktaEnabledURL")})},350)):(Alert.fire({title:"Login Error",message:data.message}),vm.showLoginButton=!0)}).error(function(data,status,headers,config){console.log(data,status)})},1e3)})}(),function(){"use strict";function Configure(UIRouterMetatagsProvider,$sceDelegateProvider,$mdAriaProvider){$mdAriaProvider.disableWarnings(),UIRouterMetatagsProvider.setDefaultTitle(window.APP_CLIENT).setDefaultDescription(window.PROPERTY_DESCRIPTION)}function ConfigureRoutes($stateProvider,$urlMatcherFactory){var languageMatcher,CDN_URL=window.CDN_URL||"/app/regional",APP_URL=window.APP_URL||"/",APP_THEME=window.APP_THEME||"",LANDING_PAGES=window.LANDING_PAGES||[],statesMatcher=(window.UNPUBLISHED_PAGES,window.PORTAL_DESTINATIONS?window.PORTAL_DESTINATIONS.states:[]),cityStatesMatcher=window.PORTAL_DESTINATIONS?window.PORTAL_DESTINATIONS.cityStates:[],isPreviewMode=window.location.search.indexOf("ispreview")>-1;$urlMatcherFactory.caseInsensitive(!0),$urlMatcherFactory.strictMode(!1),statesMatcher=statesMatcher.join("|"),statesMatcher=$urlMatcherFactory.compile("/{slug:(?:"+statesMatcher+")}"),cityStatesMatcher=cityStatesMatcher.join("|"),$urlMatcherFactory.compile("/{cityState:(?:"+cityStatesMatcher+")}"),cityStatesMatcher=$urlMatcherFactory.compile("/{slug:(?:"+cityStatesMatcher+")}"),$urlMatcherFactory.compile("/:lang/{parent:(?:us|international|travel-destinations)}"),$urlMatcherFactory.compile("/:lang/{parent:(?:us|international|travel-destinations)}/{child:.*}"),languageMatcher="{lang:(?:en-af|en-sq|en-am|en-ar|en-hy|en-az|en-eu|en-be|en-bn|en-bs|en-bg|en-ca|en-ceb|en-zh|en-zh-CN|en-zh-TW|en-co|en-hr|en-cs|en-da|en-nl|en-en|en-eo|en-et|en-fi|en-fr|en-fy|en-gl|en-ka|en-de|en-el|en-gu|en-ht|en-ha|en-haw|en-he|en-hi|en-hmn|en-hu|en-is|en-ig|en-id|en-ga|en-it|en-ja|en-jv|en-kn|en-kk|en-km|en-rw|en-ko|en-ku|en-ky|en-lo|en-la|en-lv|en-lt|en-lb|en-mk|en-mg|en-ms|en-ml|en-mt|en-mi|en-mr|en-mn|en-my|en-ne|en-no|en-ny|en-or|en-ps|en-fa|en-pl|en-pt|en-pa|en-ro|en-ru|en-sm|en-gd|en-sr|en-st|en-sn|en-sd|en-si|en-sk|en-sl|en-so|en-es|en-su|en-sw|en-sv|en-tl|en-tg|en-ta|en-tt|en-te|en-th|en-tr|en-tk|en-uk|en-ur|en-ug|en-uz|en-vi|en-cy|en-xh|en-yi|en-yo|en-zu)}/";var counter=0;if(LANDING_PAGES.length){var pageCount=1;angular.forEach(LANDING_PAGES,function(page){$stateProvider.state("landingPage"+pageCount++,{url:"/"+page.slug,templateUrl:CDN_URL+APP_THEME+"landingpage/view/"+(page.template||"landingpage")+".tpl.html",controller:"LandingPageCtrl as vm",resolve:{landingPage:function($state,$stateParams,Settings){return Settings.set("currentLandingPage",page),{content:page}}},metaTags:{title:page.pageTitle,description:page.metaDescription,properties:{"og:title":page.pageTitle,"og:description":page.metaDescription}},data:{id:page.id,index:-1,template:page.template,headerLogo:page.headerLogo,title:page.title,pageTitle:page.pageTitle||page.title,headerImage:page.headerImage,mobileHeaderImage:page.mobileHeaderImage,headerImageURL:page.headerImageURL,hasFixedWidthHero:"1"==page.hasFixedWidthHero,featuredImage:page.featuredImage,featuredImageURL:page.featuredImageURL,featuredImagePosition:page.featuredImagePosition,h1:page.h1,h2:page.h2,hasRFP:"1"==page.hasRFP,RFPID:page.RFPID,RFPPosition:page.RFPPosition,hideBookingBarNumber:page.hideBookingBarNumber,promoCode:page.promoCode,gaEvent:page.gaEvent,productId:page.productId,altState:page.altState,altLogo:page.altLogo,headerImagePositionY:page.headerImagePositionY,thankYouPage:page.thankYouPage,formSubmitEvent:page.formSubmitEvent,campaignName:page.campaignName}})})}angular.forEach(window.APP_CONFIG.menu,function(options,menuItem){if(parseInt(options.isActive)||isPreviewMode){var state=options.controller?options.controller.toLowerCase():menuItem.toLowerCase(),templateUrl=options.templateUrl&&options.templateUrl.length>1?options.templateUrl:state+"/view/"+state+".tpl.html",stateOptions={url:APP_URL+(options.controller?"{slug:(?:"+options.url+")}":options.url)+(["hotels","destinations"].indexOf(state)>-1?"?q":""),params:{lid:null,gaevent:null,Identifier:null},templateUrl:CDN_URL+templateUrl,controller:(options.controller||menuItem)+"Ctrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!(!Settings.get("has_nearby_resorts")&&"home"!=state)||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams){var _title=window.APP_CLIENT,_description=window.PROPERTY_DESCRIPTION;return _title=options.pageTitle||_title,_description=options.metaDescription||_description,{title:_title,description:_description}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}",properties:{"og:title":"{{meta.title}}","og:description":"{{meta.description}}"}},data:{index:counter,menuName:options.menuName||menuItem,pageTitle:options.pageTitle||menuItem,headerImage:options.headerImage||"",mobileHeaderImage:options.mobileHeaderImage||"",featuredImage:options.featuredImage||"",featuredImageURL:options.featuredImageURL||null,template:options.template||null,bodyContent:options.bodyContent||"",secondaryBodyContent:options.secondaryBodyContent||"",promoBanner:options.promoBanner||null,h1:options.h1||"",h2:options.h2||"",headerImagePositionY:options.headerImagePositionY,promoId:options.promoId||null,notices:options.notices||null,RFPID:options.RFPID,sidebarPromo:options.sidebarPromo}};switch(state){case"home":options.homeSpecials&&(stateOptions.data.homeSpecials=options.homeSpecials),options.homeLocation&&(stateOptions.data.homeLocation=options.homeLocation);break;case"categories":$stateProvider.state("category",{url:APP_URL+"{type:(?:destinations|"+options.url+")}/:slug",templateUrl:CDN_URL+"categories/view/categories.tpl.html",controller:"CategoriesCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Best "+$filter("properCaps")($stateParams.slug)+" Resorts from "+window.APP_CLIENT,description:"Find amazing "+$filter("properCaps")($stateParams.slug)+" Resorts from "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:2,pageTitle:"{{meta.title}}",headerImage:options.headerImage||"",featuredImage:options.featuredImage||"",featuredImageURL:options.featuredImageURL||null,template:options.template||null}});break;case"offercategory":$stateProvider.state("featuredOfferCategory",{url:APP_URL+"{slug:(?:"+options.url+")}/:child?Identifier",params:{lid:null,gaevent:null,Identifier:null},templateUrl:CDN_URL+"offers/view/offer-category.tpl.html",controller:"OfferCategoryCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Best "+$filter("properCaps")($stateParams.slug)+" Resorts from "+window.APP_CLIENT,description:"Find amazing "+$filter("properCaps")($stateParams.slug)+" Resorts from "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:counter,pageTitle:"{{meta.title}}",headerImage:options.headerImage||"",featuredImage:options.featuredImage||"",featuredImageURL:options.featuredImageURL||null,template:options.template||null,promoId:options.promoId||null}});break;case"offers":$stateProvider.state("offerCategory",{url:APP_URL+"promotion/:slug?Identifier",params:{lid:null,gaevent:null,Identifier:null},templateUrl:CDN_URL+"offers/view/offer-category.tpl.html",controller:"OfferCategoryCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Best "+$filter("properCaps")($stateParams.slug)+" Resorts from "+window.APP_CLIENT,description:"Find amazing "+$filter("properCaps")($stateParams.slug)+" Resorts from "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:counter,pageTitle:"{{meta.title}}",headerImage:options.headerImage||"",featuredImage:options.featuredImage||"",featuredImageURL:options.featuredImageURL||null,template:options.template||null}});break;case"stories":$stateProvider.state("storiesCategory",{url:APP_URL+"stories/category/:slug",templateUrl:CDN_URL+"stories/view/stories.tpl.html",controller:"StoriesCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){var storyName=$filter("properCaps")($stateParams.slug);return{title:storyName+" | "+window.APP_CLIENT,description:"Discover "+storyName+" from "+window.APP_CLIENT+", and enjoy spacious, generously appointed accommodations, with incredible views of "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:counter,pageTitle:"{{meta.title}}",headerImage:options.headerImage||"",featuredImage:options.featuredImage||"",featuredImageURL:options.featuredImageURL||null,template:options.template||null}}).state("story",{url:APP_URL+"stories/{slug:.*}",templateUrl:CDN_URL+"stories/view/story.tpl.html",controller:"StoryCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){var storyName=$filter("properCaps")($stateParams.slug);return{title:storyName+" | "+window.APP_CLIENT,description:"Discover "+storyName+" from "+window.APP_CLIENT+", and enjoy spacious, generously appointed accommodations, with incredible views of "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:counter,pageTitle:"{{meta.title}}",headerImage:options.headerImage||"",featuredImage:options.featuredImage||"",featuredImageURL:options.featuredImageURL||null,template:options.template||null}})}options.pageTitle&&(stateOptions.data.pageTitle=options.pageTitle),$stateProvider.state(state,stateOptions),counter++}}),$stateProvider.state("parentDestination",{url:"/:lang/{parent:(?:us|international|travel-destinations)}",params:{lang:{value:null,squash:!0},parent:"us"},cache:!1,templateUrl:CDN_URL+"destination/view/new-destination.tpl.html",controller:"DestinationsCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,Destinations){return Destinations.get("DestinationsList",$stateParams.parent,"",$stateParams.lang)}},metaTags:{title:function(meta){return meta.data.destination?meta.data.destination.pageTitle:""},description:function(meta){return meta.data.destination?meta.data.destination.metaDescription:""}},data:{index:3,pageTitle:function(meta){return meta.data.destination?meta.data.destination.pageTitle:""}}}).state("childDestination",{url:"/:lang/{parent:(?:us|international|travel-destinations)}/{child:.*}",params:{lang:{value:null,squash:!0}},cache:!1,templateUrl:CDN_URL+"destination/view/new-destination.tpl.html",controller:"DestinationsCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,Destinations){return Destinations.get("DestinationsList",$stateParams.parent,$stateParams.child,$stateParams.lang)}},metaTags:{title:function(meta){return meta.data.destination?meta.data.destination.pageTitle:""},description:function(meta){return meta.data.destination?meta.data.destination.metaDescription:""}},data:{index:3,pageTitle:function(meta){return meta.data.destination?meta.data.destination.pageTitle:""}}}),$stateProvider.state("sitemap",{url:APP_URL+"sitemap",templateUrl:CDN_URL+"sitemap/view/sitemap.tpl.html",controller:"SiteMapCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return Settings.get("has_nearby_resorts")?Settings.get("nearby_resorts"):Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"View our Sitemap for "+window.APP_CLIENT+" | "+window.APP_CLIENT,description:"Discover world-class accommodations at "+window.APP_CLIENT+", the perfect hotels for business and leisure travelers alike."}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:-1,pageTitle:"Sitemap"}}).state("special",{url:APP_URL+"specials/:slug",templateUrl:CDN_URL+APP_THEME+"offers/view/offer.tpl.html",controller:"OfferCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){var specialName=$filter("properCaps")($stateParams.slug);return{title:specialName+" from "+window.APP_CLIENT,description:"Find "+specialName+" from "+window.APP_CLIENT+" | "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:2,pageTitle:"{{meta.title}}"}}).state("hotel",{url:APP_URL+":cityState/:slug",templateUrl:CDN_URL+"hotels/view/hotel.tpl.html",controller:"HotelCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:$filter("properCaps")($stateParams.slug)+" | "+window.APP_CLIENT,description:"Discover world-class accommodations at "+$filter("properCaps")($stateParams.slug)+", the perfect hotel for business and leisure travelers alike. Enjoy spacious, generously appointed rooms at "+$filter("properCaps")($stateParams.slug)+" to book your next unforgettable vacation."}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelNearby",{url:APP_URL+":cityState/:slug/nearby",templateUrl:CDN_URL+"nearby/view/nearby.tpl.html",controller:"NearbyHotelCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Things to do near "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.cityState),description:"Find amazing things to do near "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.cityState)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelDining",{url:APP_URL+":cityState/:slug/dining",templateUrl:CDN_URL+"dining/view/dining.tpl.html",controller:"DiningCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return Settings.get("has_nearby_resorts")?Settings.get("nearby_resorts"):Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Dining near "+$filter("properCaps")($stateParams.slug)+" by "+window.APP_CLIENT,description:"Find amazing dining near "+$filter("properCaps")($stateParams.slug)+" | "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelEvents",{url:APP_URL+":cityState/:slug/events",templateUrl:CDN_URL+"events/view/events.tpl.html",controller:"EventsCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Events near "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.cityState),description:"Find amazing events near "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.cityState)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelEvent",{url:APP_URL+":cityState/:hotel/events/:slug",templateUrl:CDN_URL+"events/view/event.tpl.html",controller:"EventCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){var eventName=$filter("properCaps")($stateParams.slug),resortName=$filter("properCaps")($stateParams.hotel);return{title:eventName+" near "+resortName+" | "+window.APP_CLIENT,description:"Discover "+eventName+" near "+resortName+" in "+$filter("properCaps")($stateParams.cityState)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelSpecials",{url:APP_URL+":cityState/:slug/specials",templateUrl:CDN_URL+"offers/view/offers.tpl.html",controller:"OffersCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Specials at "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.cityState),description:"Find amazing specials at "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.cityState)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:2,pageTitle:"{{meta.title}}"}}).state("hotelSpecial",{url:APP_URL+":cityState/:hotel/specials/:slug?lid&gaevent&Identifier&HotelId",templateUrl:CDN_URL+APP_THEME+"offers/view/offer.tpl.html",controller:"OfferCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){var specialName,specialSlug=$stateParams.slug.match(/\d+$/),resortName=$filter("properCaps")($stateParams.hotel);return specialName=specialSlug&&specialSlug[0]?$filter("properCaps")($stateParams.slug.replace("-"+specialSlug[0],"")):$filter("properCaps")($stateParams.slug),{title:specialName+" at "+resortName,description:"Find "+specialName+" at "+resortName+" in "+$filter("properCaps")($stateParams.cityState)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:2,pageTitle:"{{meta.title}}"}}).state("hotelRooms",{url:APP_URL+languageMatcher+":cityState/:slug/rooms",templateUrl:CDN_URL+"rooms/view/rooms.tpl.html",controller:"RoomsCtrl as vm",params:{lang:{value:null,squash:!0}},resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Rooms at "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.cityState),description:"Discover amazing rooms at "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.cityState)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelRoom",{url:APP_URL+languageMatcher+":cityState/:hotel/rooms/:slug",templateUrl:CDN_URL+APP_THEME+"rooms/view/room.tpl.html",controller:"RoomCtrl as vm",params:{lang:{value:null,squash:!0}},resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){var roomName=$filter("properCaps")($stateParams.slug),resortName=$filter("properCaps")($stateParams.hotel);return{title:roomName+" at "+resortName+" in "+$filter("properCaps")($stateParams.cityState),description:"Discover "+roomName+" at "+resortName+", and enjoy spacious, generously appointed accommodations in "+$filter("properCaps")($stateParams.cityState)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelPhotos",{url:APP_URL+":cityState/:slug/photos",templateUrl:CDN_URL+"photos/view/photos.tpl.html",controller:"PhotosCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Photos of "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.cityState),description:"View incredible photos of "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.cityState)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("hotelAmenities",{url:APP_URL+":cityState/:slug/amenities",templateUrl:CDN_URL+"amenities/view/amenities.tpl.html",controller:"AmenitiesCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Amenities of "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.cityState),description:"Find out about our amenities at "+$filter("properCaps")($stateParams.slug)+" in "+$filter("properCaps")($stateParams.cityState)}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:1,pageTitle:"{{meta.title}}"}}).state("testingHomepage",{url:"",templateUrl:CDN_URL+"home/view/home.tpl.html",controller:"HomeCtrl as vm",resolve:{meta:function($stateParams,$filter){return{title:window.APP_CLIENT,description:window.PROPERTY_DESCRIPTION}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}"},data:{index:0,pageTitle:"Home Page"}}).state("404",{url:"*path",templateUrl:CDN_URL+"404/view/404.tpl.html",controller:"ErrorCtrl as vm",resolve:{resorts:function($stateParams,Places,Settings){return!!Settings.get("has_nearby_resorts")||Places.getNearbyResorts($stateParams.slug)},meta:function($stateParams,$filter){return{title:"Page Not Found | "+window.APP_CLIENT,description:"Page Not Found | "+window.APP_CLIENT}}},metaTags:{title:"{{meta.title}}",description:"{{meta.description}}",keywords:"not found"},data:{index:-1,pageTitle:"Page Not Found"}})}angular.module("explorer.routes",["ui.router","ui.router.util","ui.router.metatags","ngSanitize"]).config(["UIRouterMetatagsProvider","$sceDelegateProvider","$mdAriaProvider",Configure]).config(["$stateProvider","$urlMatcherFactoryProvider",ConfigureRoutes]).config(["$provide",function($provide){$provide.decorator("formDirective",["$delegate",function($delegate){var formDirective=$delegate[0],oldCompile=formDirective.compile;return formDirective.compile=function(tElement,tAttrs,transclude){var compile=oldCompile?oldCompile.apply(this,arguments):{};return tElement.attr("spellcheck","false"),compile},$delegate}])}])}(),function(){"use strict";function ErrorCtrl($rootScope,$state,$window,$filter,Places,Settings){function setupRegions(regions){vm.allHotels=[],angular.forEach(regions,function(region,regionName){region.slug=$filter("toSlug")(regionName),angular.forEach(region.hotels,function(hotel){vm.allHotels.push(hotel)})}),vm.regions=regions}var _menuItems,vm=this;console.log($state.current),$window.APP_CONFIG.core&&$window.APP_CONFIG.core.sitemap&&(vm.headerImage=$window.APP_CONFIG.core.sitemap.headerImage,vm.bodyContent=$window.APP_CONFIG.core.sitemap.bodyContent),_menuItems=angular.copy($rootScope.menuItems),$window.LANDING_PAGES&&$window.LANDING_PAGES.length&&angular.forEach($window.LANDING_PAGES,function(page){"0"==page.isMenuItem&&"1"==page.isActive&&(_menuItems[page.title]={url:page.slug,icon:"next",isActive:1,menuName:page.title})}),vm.menuItems=_menuItems,Settings.get("has_nearby_resorts")?setupRegions(Settings.get("nearby_resorts")):Places.getNearbyResorts().then(function(response){response.data&&"ok"==response.data.status&&setupRegions(response.data.regions)},function(){$state.go("home")});try{var errorPage=new URL(document.querySelector("link[rel='canonical']").getAttribute("href"));Places.addErrorPage(errorPage.pathname,document.referrer).then(function(response){"ok"==response.data.status&&console.log(response)})}catch(e){console.log(e)}}angular.module("explorer.app").controller("ErrorCtrl",["$rootScope","$state","$window","$filter","Places","Settings",ErrorCtrl])}(),function(){"use strict";function AccessibilityCtrl($rootScope,$state,$window,$filter,Places,Settings){var vm=this;vm.pageTitle=$state.current.data.pageTitle,vm.bodyContent=$state.current.data.bodyContent,vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.featuredImageURL=$state.current.data.featuredImageURL,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2}angular.module("explorer.app").controller("AccessibilityCtrl",["$rootScope","$state","$window","$filter","Places","Settings",AccessibilityCtrl])}(),function(){"use strict";function AmenitiesCtrl($scope,$state,$stateParams,$window,$filter,Settings){var vm=this,regions=Settings.get("nearby_resorts")||[],_amenityFeatureSet=[];vm.property={},vm.amenityFeatureSet=[],$stateParams.slug?(vm.isProperty=!0,angular.forEach(regions,function(region,regionName){angular.forEach(region.hotels,function(hotel){hotel.slug==$stateParams.slug&&(vm.property=hotel,vm.pageTitle=hotel.name+" Amenities at "+vm.property.name,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode),hotel.hasOfferCatalog&&hotel.hasOfferCatalog.itemListElement&&angular.forEach(hotel.hasOfferCatalog.itemListElement,function(offer){angular.forEach(offer.itemOffered.amenityFeature,function(feature){-1==_amenityFeatureSet.indexOf(feature.name)&&(_amenityFeatureSet.push(feature.name),vm.amenityFeatureSet.push(feature))})}))})})):$state.go($window.APP_CONFIG.menu.Destinations?"destinations":"hotels")}angular.module("explorer.app").controller("AmenitiesCtrl",["$scope","$state","$stateParams","$window","$filter","Settings",AmenitiesCtrl])}(),function(){"use strict";function CategoriesCtrl($scope,$state,$stateParams,$window,$timeout,$filter,Settings,Places,appConfig){function setupCategories(data){var _categories,_regions;vm.hotels=[],vm.destinations=[],vm.currentCategory=null,"ok"==data.status&&(_regions=Settings.get("nearby_resorts")||[],_categories=data.categories,angular.forEach(_categories,function(category,index){category.hotels=[],angular.forEach(_regions,function(region){angular.forEach(region.hotels,function(hotel){-1!=hotel.cid.indexOf(category.id.toString())&&category.hotels.push(hotel)})}),category.offers&&angular.forEach(_regions,function(region){angular.forEach(region.hotels,function(hotel){ angular.forEach(category.offers,function(offer){offer.pid==hotel.id&&(offer.hotel=hotel,vm.hotels.push(hotel),vm.destinations.push({name:hotel.cityName+", "+hotel.stateName,slug:hotel.state}))})})}),$stateParams.slug&&category.slug==$stateParams.slug?vm.currentCategory=category:(category.hotels=[],angular.forEach(_regions,function(region){angular.forEach(region.hotels,function(hotel){-1!=hotel.cid.indexOf(category.id.toString())&&category.hotels.push(hotel)})}))}),vm.allCategories=_categories,vm.currentCategory?vm.categories=[vm.currentCategory]:vm.categories=_categories),_setupMarkers(vm.currentCategory?vm.currentCategory.hotels:vm.hotels)}function _setupMarkers(hotels){var _hotels=[],_markers={},counter=1;vm.mapCenter=appConfig.mapCenter||(vm.centerLat?{lat:parseFloat(vm.centerLat),lng:parseFloat(vm.centerLng),focus:!0,draggable:!0,zoom:L.Browser.mobile?6:8}:{}),angular.forEach(hotels,function(hotel){_hotels.push(hotel),_markers["marker_"+counter]={lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),layer:"locations",message:""+hotel.name+""+hotel.name+'
'+hotel.address.addressLocality+", "+hotel.address.addressRegion+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+hotel.address.addressLocality+", "+hotel.address.addressRegion,icon:$window.LOGO_MAP_MARKER?{iconUrl:hotel.logo,iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72],className:"map-tip-popup"}:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72],className:"map-tip-popup"}},counter++}),vm.mapMarkers=_markers}function loadMore(){currentPage++;var newItems=Places.getPlaces();vm.pagedItems.length>=newItems.length&&(vm.hideLoadMore=!0),offset=currentPage*itemsPerPage,newItems=newItems.slice(offset,offset+itemsPerPage),vm.pagedItems=vm.pagedItems.concat(newItems)}function nextPageDisabledClass(){return currentPage===vm.pageCount()-1?"disabled":""}function pageCount(){return Math.ceil(vm.total/itemsPerPage)}function viewHotel(hotel){Settings.hideKeyboard(),$state.go("viewListing",{slug:hotel.slug,listingId:hotel.id})}var vm=this,offset=0,itemsPerPage=15,currentPage=0;Settings.getCityId();vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.bodyContent=$state.current.data.bodyContent,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.currentSlug=$stateParams.slug||null,vm.isCategoryPage=!!$stateParams.slug,vm.searchQuery=Settings.get("searchQuery")||"",vm.showMore=!0,vm.destinationIcon={url:"./content/img/icons/map-marker-a.png",scaledSize:[32,32],origin:[0,0],anchor:[16,32]},vm.resortIcon={url:"./content/img/icons/map-marker-b.png",scaledSize:[32,32],origin:[0,0],anchor:[16,32]},vm.loadMore=loadMore,vm.nextPageDisabledClass=nextPageDisabledClass,vm.pageCount=pageCount,vm.viewHotel=viewHotel,vm.search="",vm.types=[{type:"eat",name:"Eat"},{type:"play",name:"Play"},{type:"shop",name:"Shop"}],vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,dragging:!L.Browser.mobile,tap:!L.Browser.mobile,zoomControlPosition:"topright",tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"},vm.mapLayers={baselayers:{osm:{name:"Our Locations",type:"xyz",url:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"}},overlays:{locations:{name:"Locations",type:"markercluster",visible:!0}}},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},vm.center={},Settings.get("has_RegionCategories")?setupCategories(Settings.get("RegionCategories")):Places.get("RegionCategories").then(function(response){setupCategories(response.data)})}angular.module("explorer.app").controller("CategoriesCtrl",["$scope","$state","$stateParams","$window","$timeout","$filter","Settings","Places","appConfig",CategoriesCtrl])}(),function(){"use strict";function ContactCtrl($state,$stateParams,$window,$timeout,Places,Settings,leafletData,appConfig){function scrollBy(last,inview){last&&inview&&(vm.regionsLimit+=4)}function setupRegions(_regions){var _hotels=[],_markers=[],counter=1;vm.mapCenter=appConfig.mapCenter||(vm.centerLat?{lat:parseFloat(vm.centerLat),lng:parseFloat(vm.centerLng),focus:!0,draggable:!0,zoom:L.Browser.mobile?2:4}:{}),angular.forEach(_regions,function(region,regionName){region.name=regionName,angular.forEach(region.hotels,function(hotel){_hotels.push(hotel),_markers.push({lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),layer:"locations",message:""+hotel.name+""+hotel.name+'
'+hotel.address.addressLocality+", "+hotel.address.addressRegion+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+hotel.address.addressLocality+", "+hotel.address.addressRegion,icon:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]}}),counter++})}),vm.regions=_regions,vm.allHotels=_hotels,vm.mapMarkers=_markers,$timeout(function(){vm.zoomToMarkers&&leafletData.getMap("contact-map").then(function(map){_markers.length&&(map.invalidateSize(),map.fitBounds(_markers,!0))})},50)}var vm=this;vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,dragging:!L.Browser.mobile,tap:!L.Browser.mobile,zoomControlPosition:"topright",tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"},vm.mapLayers={baselayers:{osm:{name:"Our Locations",type:"xyz",url:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"}},overlays:{locations:{name:"Hotels",type:"markercluster",visible:!0,layerOptions:{maxClusterRadius:appConfig.maxClusterRadius||80,disableClusteringAtZoom:appConfig.disableClusteringAtZoom||!1,spiderfyDistanceMultiplier:appConfig.spiderfyDistanceMultiplier||1}}}},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},vm.bodyContent=$state.current.data.bodyContent,vm.property=Settings.get("currentListing"),vm.callTel=$window.APP_CLIENT_PHONE,vm.contactEmail=$window.APP_CLIENT_EMAIL,vm.scrollBy=scrollBy,vm.MailTo=function(mail){window.location.href="mailto:"+mail},vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),vm.regionName=$window.PROPERTY_CITY+", "+$window.PROPERTY_STATE,Settings.get("has_nearby_resorts")?setupRegions(Settings.get("nearby_resorts")):Places.getNearbyResorts().then(function(response){response.data&&"ok"==response.data.status&&setupRegions(response.data.regions)},function(){$state.go("home")})}angular.module("explorer.app").controller("ContactCtrl",["$state","$stateParams","$window","$timeout","Places","Settings","leafletData","appConfig",ContactCtrl])}(),function(){"use strict";function DestinationCtrl($scope,$state,$stateParams,$timeout,$window,$filter,Settings,Places,appConfig,leafletData){function _setupMarkers(hotels){var _hotels=[],_markers=[],counter=1;vm.mapCenter=appConfig.mapCenter||(vm.centerLat?{lat:parseFloat(vm.centerLat),lng:parseFloat(vm.centerLng),focus:!0,draggable:!0,zoom:L.Browser.mobile?6:8}:{}),hotels=hotels.filter(function(hotel){return!(!hotel.geo.latitude||!hotel.geo.longitude)||(console.log("mising lat/long",hotel.name),!1)}),angular.forEach(hotels,function(hotel){var hotelHref;hotelHref=hotel.brand&&$window.LOGO_MAP_MARKER?$state.href("hotel",{brand:hotel.brand.slug,city:hotel.cityState.substring(0,hotel.cityState.lastIndexOf("-")),state:hotel.state,slug:hotel.slug}):$state.href("hotel",{cityState:hotel.cityState,slug:hotel.slug}),_hotels.push(hotel),_markers.push({lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),layer:"locations",message:"
"+hotel.name+""+hotel.name+'
'+hotel.address.addressLocality+", "+hotel.address.addressRegion+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+hotel.address.addressLocality+", "+hotel.address.addressRegion,icon:$window.LOGO_MAP_MARKER?{iconUrl:hotel.logo,iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72],className:"map-tip-popup"}:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72],className:"map-tip-popup"}}),counter++}),vm.mapMarkers=_markers,vm.zoomToMarkers&&leafletData.getMap("destination-map").then(function(map){_markers.length&&(map.invalidateSize(),map.fitBounds(_markers,!0))})}function scrollByProperties(last,inview){last&&inview&&(vm.destinationPropertiesLimit+=6)}function loadMore(){currentPage++;var newItems=Places.getPlaces();vm.pagedItems.length>=newItems.length&&(vm.hideLoadMore=!0),offset=currentPage*itemsPerPage,newItems=newItems.slice(offset,offset+itemsPerPage),vm.pagedItems=vm.pagedItems.concat(newItems)}function nextPageDisabledClass(){return currentPage===vm.pageCount()-1?"disabled":""}function pageCount(){return Math.ceil(vm.total/itemsPerPage)}function viewHotel(hotel){Settings.hideKeyboard(),$state.go("viewListing",{slug:hotel.slug,listingId:hotel.id})}function showMarkerWindow(evt,id){if(vm.map){var _currentHotel=null;vm.currentMarker=this,angular.forEach(_allHotels,function(hotel){hotel.id==id&&(_currentHotel=hotel,$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode))}),_currentHotel&&(vm.map.setZoom(12),this.setAnimation(google.maps.Animation.DROP),vm.currentHotel=_currentHotel,vm.mapConfig.center.lat=vm.currentHotel.geo.latitude,vm.mapConfig.center.lng=vm.currentHotel.geo.longitude,vm.map.showInfoWindow("marker-window",this))}}var vm=this,offset=0,itemsPerPage=15,currentPage=0;Settings.getCityId();vm.searchQuery=Settings.get("searchQuery")||"",vm.showMore=!0,vm.destinationIcon={url:"./content/img/icons/map-marker-a.png",scaledSize:[32,32],origin:[0,0],anchor:[16,32]},vm.resortIcon={url:"./content/img/icons/map-marker-b.png",scaledSize:[32,32],origin:[0,0],anchor:[16,32]},vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.center={},vm.loadMore=loadMore,vm.nextPageDisabledClass=nextPageDisabledClass,vm.pageCount=pageCount,vm.viewHotel=viewHotel,vm.showMarkerWindow=showMarkerWindow,vm.scrollByProperties=scrollByProperties,vm.destinationSlug=$stateParams.slug,vm.isState=!1,vm.isCityState=!1,vm.hotels=[],vm.destinations=[],vm.states=[],vm.countries=[],vm.selectedDestination="",vm.selectedState="",vm.selectedCountry="",vm.selectedResort="",vm.search="",vm.types=[{type:"eat",name:"Eat"},{type:"play",name:"Play"},{type:"shop",name:"Shop"}],vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,dragging:!L.Browser.mobile,tap:!L.Browser.mobile,zoomControlPosition:"topright",tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"},vm.mapLayers={baselayers:{osm:{name:"Our Locations",type:"xyz",url:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"}},overlays:{locations:{name:"Locations",type:"markercluster",visible:!0,layerOptions:{maxClusterRadius:appConfig.maxClusterRadius||80,disableClusteringAtZoom:appConfig.disableClusteringAtZoom||!1,spiderfyDistanceMultiplier:appConfig.spiderfyDistanceMultiplier||1}}}},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},Settings.get("has_nearby_resorts")?vm.regions=Settings.get("nearby_resorts"):Places.getNearbyResorts().then(function(response){response.data&&"ok"==response.data.status&&(vm.regions=response.data.regions)});var stateSlug,tmp=$stateParams.slug.split("-");angular.forEach($window.PORTAL_DESTINATIONS.states,function(state){(tmp.indexOf(state)>-1||$stateParams.slug.indexOf(state)>-1)&&(stateSlug=state)});var regions=Settings.get("nearby_resorts")||[],tmpCity=[],breakLoop=!1,foundDestinationName=!1;if(breakLoop||$window.PORTAL_DESTINATIONS.states.indexOf($stateParams.slug)>-1&&(vm.isState=!0,vm.destinationName=$filter("properCaps")($stateParams.slug),angular.forEach(regions,function(destination,destinationName){vm.destinationName.toLowerCase()==destinationName.toLowerCase()&&angular.forEach(destination.hotels,function(hotel){hotel.state==$stateParams.slug&&tmpCity.push(hotel)})}),breakLoop=!0),breakLoop||$window.PORTAL_DESTINATIONS.cityStates.indexOf($stateParams.slug)>-1&&(vm.isCityState=!0,$filter("properCaps")($stateParams.slug),angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.cityState==$stateParams.slug?(foundDestinationName||(foundDestinationName=!0,vm.destinationName=hotel.cityName+", "+hotel.stateName),tmpCity.push(hotel)):hotel.additionalProperty&&hotel.additionalProperty[0]&&hotel.additionalProperty[0].value&&hotel.additionalProperty[0].value.replace(/\s+/g,"-").toLowerCase().indexOf($stateParams.slug)>-1&&tmpCity.push(hotel)})}),breakLoop=!0),!breakLoop){var tmpName;vm.destinationName=$filter("properCaps")($stateParams.slug),angular.forEach(regions,function(destination,destinationName){tmpName=$filter("properCaps")($filter("toSlug")(destinationName)),tmpName.toLowerCase()==vm.destinationName.toLowerCase()&&angular.forEach(destination.hotels,function(hotel){tmpCity.push(hotel)})})}Places.get("PortalDestinationDetails",$window.RID,$stateParams.slug.replace("-"+stateSlug,"")).then(function(response){var description="",h1="",h2="";"ok"==response.data.status&&(description=response.data.description,h1=response.data.h1,h2=response.data.h2,h1&&(vm.h1=h1),h2&&(vm.h2=h2)),vm.destination={hotels:tmpCity,description:description,h1:h1,h2:h2},vm.headerImage=response.data.headerImage||null,vm.headerImagePositionY=response.data.headerImagePositionY||null,vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),_setupMarkers(tmpCity)})}angular.module("explorer.app").controller("DestinationCtrl",["$scope","$state","$stateParams","$timeout","$window","$filter","Settings","Places","appConfig","leafletData",DestinationCtrl])}(),function(){"use strict";function DestinationsCtrl($scope,$state,$stateParams,$timeout,$window,$location,$filter,$mdDialog,Settings,Destinations,leafletData,appConfig){function scrollByProperties(last,inview){last&&inview&&(vm.destinationPropertiesLimit+=4)}function resetFilters(type,skip){switch(type){case"themes":angular.forEach(themeGroups,function(themes,name){name!=skip&&(vm.searchFilters.type[name]=0)});break;default:vm.searchWords="",vm.searchFilters.type={},vm.searchFilters.destination=[],vm.searchFilters.brand={},vm.updateSearchResults()}}function loadNearby(){Destinations.get("DestinationNearby",vm.destination.destinationId,$stateParams.child,vm.lang,$stateParams.category).then(function(response){vm.items=response.data.items})}function loadProperties(noDestinationPropertiesList){var regions=Settings.get("nearby_resorts");noDestinationPropertiesList=noDestinationPropertiesList||!1,regions?(angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){properties[hotel.id]=hotel})}),noDestinationPropertiesList?(setupMap($filter("toArray",!1)(properties)),vm.destination&&"1"===vm.destination.showFilters&&setupFilters()):getDestinationPropertiesList()):$scope.$on("triggerRegionsLoaded",function(){loadProperties(noDestinationPropertiesList)}),Settings.get("topSearchQuery")?(vm.searchWords=Settings.get("topSearchQuery"),updateSearchResults(),Settings.set("topSearchQuery",null)):$stateParams.q&&(vm.searchWords=$stateParams.q,updateSearchResults(),Settings.set("topSearchQuery",null))}function getDestinationPropertiesList(destination){Destinations.get("PropertiesList",destination||vm.destination).then(function(response){if("ok"==response.data.status&&response.data.properties){var tmp=[];angular.forEach(response.data.properties,function(prop){prop&&tmp.push(prop.id)}),tmp.length?(angular.forEach(response.data.properties,function(prop){if(prop&&properties[prop.id])if(properties[prop.id].destinationId=destination?destination.destinationId:vm.destination.destinationId,properties[prop.id].rooms=prop.rooms,properties[prop.id].destinationContent={destinationId:properties[prop.id].destinationId},properties[prop.id].destinationName=vm.destination.name,destination||(prop.bodyContent&&(properties[prop.id].destinationContent.bodyContent=prop.bodyContent),prop.image&&(properties[prop.id].destinationContent.image=prop.image),prop.imageCredit&&(properties[prop.id].destinationContent.imageCredit=prop.imageCredit)),angular.forEach(prop.rooms,function(room){-1==vm.availableRooms.indexOf(room)&&vm.availableRooms.push(room)}),destination){destination.properties||(destination.properties=[]);var _found=!1;angular.forEach(vm.destination.properties,function(p){p&&p.id==prop.id&&(_found=!0)}),_found&&(childPropertyIds.push(prop.id),destination.properties.push(properties[prop.id]))}else destinationProperties.push(properties[prop.id]),vm.allProperties.push(properties[prop.id]);else;}),vm.destination.properties=destinationProperties.filter(function(property){return property&&-1==childPropertyIds.indexOf(property.id)})):destination&&destination.children&&angular.forEach(destination.children,function(child){getDestinationPropertiesList(child)}),!destination&&vm.destination.children&&angular.forEach(vm.destination.children,function(child){getDestinationPropertiesList(child)});var uniqueObject={},deduplicatedArray=[];angular.forEach(vm.destination.properties,function(item){var name=item.name;uniqueObject[name]||(uniqueObject[name]=!0,deduplicatedArray.push(item))}),console.log(deduplicatedArray),!destination&&"1"==vm.destination.showMap&&vm.destination.properties&&setupMap(),vm.destination&&"1"===vm.destination.showFilters&&setupFilters(),vm.isLoading=!1}},function(error){vm.isLoading=!1})}function setupFilters(){angular.forEach(vm.destination.properties,function(property){-1==_countries.indexOf(property.address.addressCountry)&&(_countries.push(property.address.addressCountry),vm.countries.push({name:property.address.addressCountry,slug:property.address.addressCountry.toLowerCase()})),-1==_states.indexOf(property.stateName)&&(_states.push(property.stateName),vm.states.push({name:property.stateName,country:property.address.addressCountry||"",slug:property.state})),-1==_destinations.indexOf(property.cityState)&&(_destinations.push(property.cityState),vm.destinations.push({destinationId:property.destinationId,name:property.cityName+", "+property.stateName,slug:property.cityState,country:property.address.addressCountry}))}),$location.search().country?($location.search().state&&($location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase()===$location.search().city.toLowerCase()+", "+$location.search().state.toLowerCase()&&(vm.selectedDestination=destination.slug)}),angular.forEach(vm.states,function(state){state.name.toLowerCase()===$location.search().state.toLowerCase()&&(vm.selectedState=state.name)})),angular.forEach(vm.countries,function(country){country.name.toLowerCase()===$location.search().country.toLowerCase()&&(vm.selectedCountry=country.name)})):$location.search().state?($location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase()===$location.search().city.toLowerCase()+", "+$location.search().state.toLowerCase()&&(vm.selectedDestination=destination.slug)}),angular.forEach(vm.states,function(state){state.name.toLowerCase()===$location.search().state.toLowerCase()&&(vm.selectedState=state.name)})):$location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase().indexOf($location.search().city.toLowerCase())>-1&&(vm.selectedDestination=destination.slug)})}function setupMap(markers){markers=markers||null,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,dragging:!L.Browser.mobile,tap:!L.Browser.mobile,zoomControlPosition:"topleft",boxZoom:!0,zoomControl:!0,tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png",minZoom:1},vm.mapLayers={baselayers:{osm:{name:(vm.destination&&!vm.globalSearch?vm.destination.name:"Our")+" Resorts",type:"xyz",url:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"}},overlays:{locations:{name:(vm.destination&&!vm.globalSearch?vm.destination.name:"Our")+" Resorts",type:"markercluster",visible:!0,layerOptions:{maxClusterRadius:appConfig.maxClusterRadius||60}}}},setupMapMarkers(markers)}function getSearchValue(hotel){return hotel.value=hotel.name.toLowerCase(),hotel.address&&(hotel.amenityFeature||console.log("missing amenities",hotel.name),hotel.value+=" "+(hotel.address.streetAddress?hotel.address.streetAddress.toLowerCase():"")+" "+(hotel.address.addressLocality?hotel.address.addressLocality.toLowerCase():"")+" "+(hotel.address.addressRegion?hotel.address.addressRegion.toLowerCase():"")+" "+(hotel.stateName?hotel.stateName.toLowerCase():"")+" "+(hotel.cityName?hotel.cityName.toLowerCase():"")+" "+(hotel.address.addressCountry?hotel.address.addressCountry.toLowerCase():"")+" "+hotel.telephone+" "+hotel.address.postalCode+" "+(hotel.amenityFeature?hotel.amenityFeature.map(function(amenity){return amenity.name.toLowerCase().trim()}).join(" "):"")+" "+hotel.description),hotel}function setupMapMarkers(locations){locations=locations||(vm.destination?vm.destination.properties:[]),locations?locations=locations.map(getSearchValue):vm.destination.properties.map(getSearchValue),origResults||(origResults=locations);var _mapMarkers=[];locations=locations.filter(function(hotel){return!!(hotel.geo&&hotel.geo.latitude&&hotel.geo.longitude)||(console.log("missing lat/long",hotel.name),!1)}),_mapMarkers=locations.map(function(hotel){hotel.geo||(hotel.geo={}),hotel.cityState||(hotel.cityState="");var hotelHref;return hotelHref=hotel.brand&&$window.LOGO_MAP_MARKER?$state.href("hotel",{brand:hotel.brand.slug,city:hotel.cityState.substring(0,hotel.cityState.lastIndexOf("-")),state:hotel.state,slug:hotel.slug}):$state.href("hotel",{cityState:hotel.cityState,slug:hotel.slug}),{lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),layer:"locations",message:"
'+hotel.name+''+hotel.name+'
'+hotel.address.addressLocality+", "+hotel.address.addressRegion+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+hotel.address.addressLocality+", "+hotel.address.addressRegion,icon:$window.LOGO_MAP_MARKER?{iconUrl:hotel.logo,iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]}:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]}}}),vm.mapMarkers=_mapMarkers,leafletData.getMap(mapID).then(function(map){_mapMarkers.length&&(map.invalidateSize(),map.fitBounds(_mapMarkers,!0))})}function updateSearchResults(){timer&&$timeout.cancel(timer),timer=$timeout(function(){pagedResults=filteredResults(),origResults.length>pagedResults.length?vm.pagedResults=pagedResults:vm.pagedResults=[],setupMapMarkers(pagedResults),vm.currentMarker&&(vm.currentMarker=null)},10)}function filteredResults(){vm.themeExtensions=[],vm.themeExtensionTypes=[],vm.themeLimit=10;var passBrandCheck=!0,passDestinationCheck=!0,passTypeCheck=!0,passRoomCheck=!0,queryFilter=function(query,hotel){var lowercaseQuery=angular.lowercase(query);return hotel.value.indexOf(lowercaseQuery)>-1||(lowercaseQuery=lowercaseQuery.replace(/[^a-zA-Z0-9 ]/g,""),hotel.value.indexOf(lowercaseQuery)>-1)},brandFilter=function(brands,hotel){var activeFilter=!1;return angular.forEach(brands,function(filter,brand){1==filter&&(activeFilter=!0)}),hotel.brand=hotel.brand||$window.APP_CLIENT,!activeFilter||!brands||1==brands[hotel.brand]},roomFilter=function(rooms,hotel){var activeFilters=0,passCheck=0,used=[];return angular.forEach(rooms,function(filter,room){1==filter&&activeFilters++}),!(activeFilters>0)||(angular.forEach(rooms,function(filter,room){1==filter&&angular.forEach(hotel.rooms,function(searchRoom){-1==used.indexOf(searchRoom)&&searchRoom.toLowerCase().indexOf(room.toLowerCase())>-1&&(passCheck++,used.push(searchRoom))})}),passCheck==activeFilters)},destinationFilter=function(destinations,hotel){return!destinations||!destinations.length||(destinations.indexOf("1")>-1&&destinations.indexOf("2")>-1||(destinations.indexOf("1")>-1&&(0==hotel.address.addressCountry.toLowerCase().indexOf("us")||hotel.address.addressCountry.toLowerCase().indexOf("united states")>-1)||(destinations.indexOf("2")>-1&&0!=hotel.address.addressCountry.toLowerCase().indexOf("us")&&-1==hotel.address.addressCountry.toLowerCase().indexOf("united states")||(destinations.indexOf("all")>-1&&1==destinations.length||!!hotel.destinationId&&destinations.indexOf(hotel.destinationId.toString())>-1))))},typeFilter=function(types,hotel){var activeFilters=0,passCheck=0,used=[];return angular.forEach(types,function(filter,type){1==filter&&activeFilters++}),!(activeFilters>0)||(angular.forEach(types,function(filter,searchType){1==filter&&angular.forEach(themeGroups[searchType],function(theme){angular.forEach(hotel.amenityFeature,function(amenity){-1==used.indexOf(searchType)&&("ski"!=theme&&amenity.name.toLowerCase().indexOf(theme)>-1||"ski"==theme&&amenity.name.toLowerCase().indexOf(theme)>-1&&-1==amenity.name.toLowerCase().indexOf("waterskiing")&&-1==amenity.name.toLowerCase().indexOf("cross-country skiing"))&&(passCheck++,used.push(searchType))})})}),passCheck==activeFilters)},_properties=null;if(vm.destination&&vm.destination.properties&&!vm.globalSearch?(_properties=vm.destination.properties,vm.destination.children&&vm.destination.children.length&&angular.forEach(vm.destination.children,function(child){child.properties&&(_properties=_properties.concat(child.properties))})):_properties=$filter("toArray",!1)(properties),!prevAllSearch&&vm.searchFilters.destination&&vm.searchFilters.destination.indexOf("all")>-1?(prevAllSearch=!0,vm.searchFilters.destination=vm.searchFilters.destination.filter(function(destination){return"all"==destination})):vm.searchFilters.destination&&vm.searchFilters.destination.length>1&&(vm.searchFilters.destination=vm.searchFilters.destination.filter(function(destination){return"all"!=destination}),prevAllSearch=!1),$window.dataLayer){if(vm.searchWords&&$window.dataLayer.push({event:"destinationSearch.searchQueryUpdate",eventCategory:"Destination Search",eventLabel:vm.searchWords.trim()}),vm.searchFilters.destination&&vm.searchFilters.destination!=["all"]){var trackingDestinationNames=[];vm.searchFilters.destination.map(function(destinationId){vm.destinations?angular.forEach(vm.destinations,function(destination){destination.destinationId==destinationId&&trackingDestinationNames.push(destination.name)}):vm.destination&&angular.forEach(vm.destination.children,function(destination){destination.destinationId==destinationId&&trackingDestinationNames.push(destination.name)})}),trackingDestinationNames.length&&$window.dataLayer.push({event:"destinationSearch.destinationFilterUpdate",eventCategory:"Destination Search",eventLabel:trackingDestinationNames.toString()})}vm.searchFilters.type&&$window.dataLayer.push({event:"destinationSearch.tripTypeFilterUpdate",eventCategory:"Destination Search",eventLabel:Object.keys(vm.searchFilters.type).toString()})}return _properties.filter(function(hotel){var pass=!0;return vm.searchWords&&(pass=queryFilter(vm.searchWords,hotel)),!!pass&&(angular.forEach(vm.searchFilters,function(filters,filterType){switch(filterType){case"brand":passBrandCheck=brandFilter(filters,hotel);break;case"room":passRoomCheck=roomFilter(filters,hotel);break;case"destination":passDestinationCheck=vm.searchFilters.destination==["all"]||destinationFilter(filters,hotel);break;case"type":passTypeCheck=typeFilter(filters,hotel)}}),passDestinationCheck&&passRoomCheck&&passTypeCheck&&passBrandCheck)})}var dynamicFlex,dynamicFlexTwo,timer,mapID,pagedResults,vm=this,properties={},destinationProperties=[],childPropertyIds=[],origResults=null,themeGroups={Beaches:["beach"],Golfing:["golf","putt"],Family:["child","playground","picnic","pool","bbq","game","restaurant","bowling","wedding","kid","activities","river","mall"],Fun:["fish","lake","hot","night","tennis","basketball","volleyball","horse","hiking","bar","heli","plane","dance","cook","tub","massage","mall"],Ski:["ski"]},prevAllSearch=!1,_countries=[],_states=[],_destinations=[];switch(vm.pageTitle=$state.current.data.pageTitle,vm.bodyContent=$state.current.data.bodyContent,vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.featuredImageURL=$state.current.data.featuredImageURL,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.lang=$stateParams.lang||null,vm.updateSearchResults=updateSearchResults,vm.resetFilters=resetFilters,vm.searchFilters={destination:["all"]},vm.pagedResults=[],vm.availableRooms=[],vm.allProperties=[],vm.searchLimit=25,vm.tripTypes=themeGroups,vm.scrollByProperties=scrollByProperties,vm.isLoading=!0,vm.hotels=[],vm.destinations=[],vm.states=[],vm.countries=[],vm.selectedDestination="",vm.selectedState="",vm.selectedCountry="",vm.selectedResort="",vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),$state.current.name){case"parentDestination":mapID="destination-map",vm.isParentDestination=!0,Destinations.get("DestinationsList",$stateParams.parent,"",vm.lang).then(function(response){"ok"==response.data.status&&response.data.destination?(vm.destination=response.data.destination, dynamicFlex=vm.destination.children.length%4,dynamicFlexTwo=vm.destination.children.length%2,vm.dynamicFlex=dynamicFlex?Math.floor(100/dynamicFlex):25,vm.dynamicFlexTwo=dynamicFlexTwo?Math.floor(100/dynamicFlexTwo):50,vm.searchMode=vm.destination.defaultResortView||"map","1"==vm.destination.showProperties||"1"==vm.destination.showMap?(vm.destination.isLoaded?(setupMap(),vm.isLoading=!1):(loadProperties(),vm.destination.isLoaded=!0),vm.destination&&"1"===vm.destination.showFilters&&setupFilters()):vm.isLoading=!1,$scope.$emit("updateSearchText",vm.destination.name),$scope.$broadcast("updateSearchText",vm.destination.name)):$state.go("home")},function(error){console.log(error),vm.isLoading=!1});break;case"childDestination":mapID="destination-map",vm.isParentDestination=!1,Destinations.get("DestinationsList",$stateParams.parent,$stateParams.child,vm.lang).then(function(response){if("ok"==response.data.status&&response.data.destination){if(vm.destination=response.data.destination,dynamicFlex=vm.destination.children.length%4,dynamicFlexTwo=vm.destination.children.length%2,vm.dynamicFlex=dynamicFlex?Math.floor(100/dynamicFlex):25,vm.dynamicFlexTwo=dynamicFlexTwo?Math.floor(100/dynamicFlexTwo):50,vm.searchMode=vm.destination.defaultResortView||"map",vm.destination.parentId&&"0"!=vm.destination.parentId){var parentDestinationSlug=vm.destination.breadcrumbs[vm.destination.breadcrumbs.length-2].slug.replace(/^\/+/,"").replace($stateParams.parent+"/","");Destinations.get("DestinationsList",$stateParams.parent,parentDestinationSlug!=$stateParams.parent?parentDestinationSlug:"",vm.lang).then(function(response){"ok"==response.data.status&&(vm.parentDestination=response.data.destination)})}"1"==vm.destination.showProperties||"1"==vm.destination.showMap?(vm.destination.isLoaded?(setupMap(),vm.isLoading=!1):(loadProperties(),vm.destination.isLoaded=!0),vm.destination&&"1"===vm.destination.showFilters&&setupFilters()):vm.isLoading=!1,$scope.$emit("updateSearchText",vm.destination.name),$scope.$broadcast("updateSearchText",vm.destination.name)}else $state.go("home")});break;case"destinationNearby":Destinations.get("DestinationsList",$stateParams.parent,$stateParams.child,vm.lang).then(function(response){if("ok"==response.data.status&&response.data.destination){if(vm.destination=response.data.destination,dynamicFlex=vm.destination.children.length%4,dynamicFlexTwo=vm.destination.children.length%2,vm.dynamicFlex=dynamicFlex?Math.floor(100/dynamicFlex):25,vm.dynamicFlexTwo=dynamicFlexTwo?Math.floor(100/dynamicFlexTwo):50,vm.category=$stateParams.category,vm.destination.parentId&&"0"!=vm.destination.parentId){var parentDestinationSlug=vm.destination.breadcrumbs[vm.destination.breadcrumbs.length-2].slug.replace(/^\/+/,"").replace($stateParams.parent+"/","");Destinations.get("DestinationsList",$stateParams.parent,parentDestinationSlug!=$stateParams.parent?parentDestinationSlug:"",vm.lang).then(function(response){"ok"==response.data.status&&(vm.parentDestination=response.data.destination)})}vm.isLoading=!1,$scope.$emit("updateSearchText",vm.destination.name),$scope.$broadcast("updateSearchText",vm.destination.name),loadNearby()}else $state.go("home")});break;case"destinations":default:mapID="destinations-map",Destinations.get("DestinationsList","","",vm.lang).then(function(response){"ok"==response.data.status&&(response.data.destinations?(vm.destinations=response.data.destinations,dynamicFlex=vm.destinations.length%4,dynamicFlexTwo=vm.destinations.length%2,vm.dynamicFlex=dynamicFlex?Math.floor(100/dynamicFlex):25,vm.dynamicFlexTwo=dynamicFlexTwo?Math.floor(100/dynamicFlexTwo):50):response.data.destination&&(vm.destination=response.data.destination,dynamicFlex=vm.destination.children.length%4,dynamicFlexTwo=vm.destination.children.length%2,vm.dynamicFlex=dynamicFlex?Math.floor(100/dynamicFlex):25,vm.dynamicFlexTwo=dynamicFlexTwo?Math.floor(100/dynamicFlexTwo):50,vm.searchMode=vm.destination.defaultResortView||"map"),loadProperties(!0))})}$scope.$on("$destroy",function(){leafletData.unresolveMap(mapID)}),vm.getStates=function(){if(vm.destination&&vm.destination.properties)return console.log(vm.states),$filter("orderBy")($filter("filter")(vm.states,vm.selectedCountry),"name")}}angular.module("explorer.app").controller("DestinationsCtrl",["$scope","$state","$stateParams","$timeout","$window","$location","$filter","$mdDialog","Settings","Destinations","leafletData","appConfig",DestinationsCtrl])}(),function(){"use strict";function DiningCtrl($scope,$state,$stateParams,$window,$filter,$mdDialog,Places,Settings,appConfig){function photoPop(index,image){image.title&&(image.title=$filter("capitalize")($filter("camelCaseToHuman")(image.title)),image.title=image.title.replace("Photo Urls","")),image.index=index,$mdDialog.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"app/cards/photo-gallery.html",controller:function($scope,$filter,$mdDialog){function getPhotoUrl(target,url,size,crop){if(url&&"string"==typeof url){if(target&&""!=target)var result=document.getElementsByClassName(target);if("auto"===(size=size||"200")&&target){return size=angular.element(result)[0].clientWidth,url.replace("=s0","=s"+size+(crop?"-c":""))}return url.replace("=s0","=s"+size+(crop?"-c":""))}}var tmpIndex;$scope.image=image,$scope.totalImages=vm.property.diningOptions&&vm.property.diningOptions[0]&&vm.property.diningOptions[0].photos?vm.property.diningOptions[0].photos.length:0,$scope.image.url=getPhotoUrl("listing-page",$scope.image.googleUrl,1600,!1),$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image=vm.property.diningOptions[0].photos[$scope.image.index-1],$scope.image.index=tmpIndex-1):($scope.image=vm.property.diningOptions[0].photos[vm.property.diningOptions[0].photos.length-1],$scope.image.index=vm.property.diningOptions[0].photos.length-1),$scope.image.title=$filter("capitalize")($filter("camelCaseToHuman")($scope.image.title)),$scope.image.title=$scope.image.title.replace("Photo Urls",""),$scope.image.url=getPhotoUrl("listing-page",$scope.image.googleUrl,1600,!1)}}})}var vm=this,_destinations=Settings.get("nearby_resorts")||[];if(vm.user=Settings.get("user")||{},vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.mapOptions={attributionControl:!1,dragging:!0,boxZoom:!0,doubleClickZoom:!0,tap:!1,keyboard:!1,scrollWheelZoom:!1,zoomControl:!0,tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},vm.photoPop=photoPop,$stateParams.slug){var regions=_destinations,found=!1;vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){if(hotel.slug==$stateParams.slug.toLowerCase())if(found=!0,Settings.set("currentHotel",hotel),$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode),hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,vm.pageTitle="Dining near "+hotel.name,Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),Settings.get("has_portal_property_details_"+hotel.id)){var _property=Settings.get("portal_property_details_"+hotel.id);_property.diningOptions&&_property.diningOptions.length&&(_property.diningOptions=_property.diningOptions.map(function(option){return option.mapMarker={center:{lat:parseFloat(option.lat),lng:parseFloat(option.lng),focus:!0,draggable:!0,zoom:5},markers:{marker:{lat:parseFloat(option.lat),lng:parseFloat(option.lng),message:(option.image?"":"")+option.name+'
'+option.addressLocality+", "+option.addressRegion+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+option.addressLocality+", "+option.addressRegion,icon:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]}}}},option})),vm.property=_property}else Places.get("PortalPropertyDetails",hotel.id).then(function(response){if("ok"==response.data.status){var _property=response.data.details;_property.diningOptions&&_property.diningOptions.length&&(_property.diningOptions=_property.diningOptions.map(function(option){return option.mapMarker={center:{lat:parseFloat(option.lat),lng:parseFloat(option.lng),focus:!0,draggable:!0,zoom:5},markers:{marker:{lat:parseFloat(option.lat),lng:parseFloat(option.lng),message:(option.image?"":"")+option.name+'
'+option.addressLocality+", "+option.addressRegion+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+option.addressLocality+", "+option.addressRegion,icon:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]}}}},option})),vm.property=_property,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)}})})}),found||$state.go("404")}vm.currentIndex=0,vm.setCurrentSlideIndex=function(index){$analytics.eventTrack("webapp",{category:"page interaction",label:"View Dining Image "+(index+1)}),vm.currentIndex=index},vm.isCurrentSlideIndex=function(index){return vm.currentIndex===index},vm.prevSlide=function(){$analytics.eventTrack("webapp",{category:"page interaction",label:"Prev Dining Image "+(vm.currentIndex+1)}),vm.currentIndex=vm.currentIndex>0?--vm.currentIndex:vm.property.diningOptions[0].photos.length-1},vm.nextSlide=function(){$analytics.eventTrack("webapp",{category:"page interaction",label:"Next Dining Image "+(vm.currentIndex+1)}),vm.currentIndex=vm.currentIndex=12&&(ampm="pm",tmpHour-=12),formattedHour=tmpHour+":"+tmpMin+ampm,"0:00pm"==formattedHour?"Noon":formattedHour}}angular.module("explorer.app").controller("DiningCtrl",["$scope","$state","$stateParams","$window","$filter","$mdDialog","Places","Settings","appConfig",DiningCtrl])}(),function(){"use strict";function EventCtrl($scope,$state,$stateParams,$location,$filter,Places,Settings){function getPropertyEventDetails(){Places.get("PropertyNearbyEvents",vm.property.id).then(function(response){response&&response.data&&(events=response.data.events,angular.forEach(events,function(event){$stateParams.slug==$filter("toSlug")(event.name)&&(moment().diff(moment(event.end_time),"days")>=0&&$state.go("events"),event.start_time&&(start_time=moment(event.start_time),event.start_time=new Date(start_time.format())),event.end_time&&(end_time=moment(event.end_time),event.end_time=new Date(end_time.format())),vm.event=event,vm.h2=event.name,eventFound=!0)})),eventFound||$state.go(events.length>0?"hotelEvents":"hotel",{cityState:vm.property.cityState,slug:vm.property.slug})})}var events,start_time,end_time,vm=this,eventFound=!1;if(vm.headerImage=$state.current.data.headerImage,vm.bodyContent=$state.current.data.bodyContent,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,$stateParams.hotel){var regions=Settings.get("nearby_resorts")||[],hotelFound=!1;vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.hotel.toLowerCase()&&(hotelFound=!0,$stateParams.cityState&&$stateParams.hotel&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelEvent",{cityState:hotel.cityState,hotel:hotel.slug,slug:$stateParams.slug},{reload:"hotel"})),Settings.set("currentHotel",hotel),vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,vm.pageTitle="Offers at "+hotel.name,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),getPropertyEventDetails(),$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0),getPropertyEventDetails(),$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode))}),Settings.set("currentHotel",hotel))})}),hotelFound||$state.go("404")}}angular.module("explorer.app").controller("EventCtrl",["$scope","$state","$stateParams","$location","$filter","Places","Settings",EventCtrl])}(),function(){"use strict";function EventsCtrl($scope,$state,$stateParams,$location,$filter,$timeout,Places,Settings){function getHotelEvents(selectedResort){vm.isLoading=!0,angular.forEach(_destinations,function(destination){angular.forEach(destination.hotels,function(hotel){hotel.hotelCode==selectedResort&&(_currentHotel=hotel,vm.pageTitle=hotel.name,hotel.photos&&hotel.photos[2]?vm.headerImage=hotel.photos[2].url:vm.headerImage=$state.current.data.headerImage,Places.get("PropertyNearbyEvents",hotel.address.addressLocality+","+hotel.address.addressRegion+","+hotel.geo.latitude+","+hotel.geo.longitude).then(function(response){_eventCategories=[],"ok"==response.data.status&&(vm.property=_currentHotel,_currentEvents=response.data.events.filter(function(event){return moment().diff(moment(event.end_time),"days")<0}),vm.property.events=_currentEvents,angular.forEach(_currentEvents,function(event){event.category&&_eventCategories.indexOf(event.category)<0&&_eventCategories.push(event.category)}),vm.isLoading=!1,vm.eventCategories=_eventCategories)}))})})}var _eventCategories,_currentEvents,_currentHotel,start_time,end_time,vm=this,_destinations=Settings.get("nearby_resorts")||[];if(vm.user=Settings.get("user")||{},vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.getHotelEvents=getHotelEvents,$stateParams.slug){var regions=_destinations,found=!1;vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.slug.toLowerCase()&&(found=!0,$stateParams.cityState&&$stateParams.slug&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelEvents",{cityState:hotel.cityState,slug:hotel.slug},{reload:"hotelEvent"})),Settings.set("currentHotel",hotel),hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,vm.pageTitle="Events near "+hotel.name,Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),Places.get("PropertyNearbyEvents",hotel.address.addressLocality+","+hotel.address.addressRegion+","+hotel.geo.latitude+","+hotel.geo.longitude,hotel.id).then(function(response){_eventCategories=[],"ok"==response.data.status&&($scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode),_currentEvents=response.data.events.filter(function(event){return moment().diff(moment(event.end_time),"days")<0}),vm.property.events=_currentEvents,angular.forEach(_currentEvents,function(event){event.category&&_eventCategories.indexOf(event.category)<0&&_eventCategories.push(event.category),event.slug=$filter("toSlug")(event.name),event.start_time&&(start_time=moment(event.start_time),event.start_time=new Date(start_time.format())),event.end_time&&(end_time=moment(event.end_time),event.end_time=new Date(end_time.format()))}),vm.eventCategories=_eventCategories)})):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0),Places.get("PropertyNearbyEvents",hotel.address.addressLocality+","+hotel.address.addressRegion+","+hotel.geo.latitude+","+hotel.geo.longitude,hotel.id).then(function(response){_eventCategories=[],"ok"==response.data.status&&($scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode),_currentEvents=response.data.events.filter(function(event){return moment().diff(moment(event.end_time),"days")<0}),vm.property.events=_currentEvents,angular.forEach(_currentEvents,function(event){event.category&&_eventCategories.indexOf(event.category)<0&&_eventCategories.push(event.category),event.slug=$filter("toSlug")(event.name),event.start_time&&(start_time=moment(event.start_time),event.start_time=new Date(start_time.format())),event.end_time&&(end_time=moment(event.end_time),event.end_time=new Date(end_time.format()))}),vm.eventCategories=_eventCategories)}))}))})}),found||$state.go("404")}else vm.isProperty=!1,vm.hotels=[],angular.forEach(_destinations,function(destination){angular.forEach(destination.hotels,function(hotel){vm.hotels.push(hotel)})}),vm.selectedResort=Settings.get("selectedResort")||vm.hotels[0].hotelCode,getHotelEvents(vm.selectedResort)}angular.module("explorer.app").controller("EventsCtrl",["$scope","$state","$stateParams","$location","$filter","$timeout","Places","Settings",EventsCtrl])}(),function(){"use strict";function HomeCtrl($scope,$state,$timeout,$window,$filter,$mdMedia,$analytics,Places,Settings,leafletData,appConfig){function _setupRegions(_regions){var _hotels=[],_markers=[],counter=1;vm.mapCenter=appConfig.mapCenter||(vm.centerLat?{lat:parseFloat(vm.centerLat),lng:parseFloat(vm.centerLng),focus:!0,draggable:!0,zoom:L.Browser.mobile?2:4}:{}),vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,dragging:!L.Browser.mobile,tap:!L.Browser.mobile,zoomControlPosition:"topleft",tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"},vm.mapLayers={baselayers:{osm:{name:"Our Properties",type:"xyz",url:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"}},overlays:{locations:{name:"All Locations",type:"markercluster",visible:!0,layerOptions:{maxClusterRadius:appConfig.maxClusterRadius||80,disableClusteringAtZoom:appConfig.disableClusteringAtZoom||!1,spiderfyDistanceMultiplier:appConfig.spiderfyDistanceMultiplier||1}}}},vm.mapEvents={map:{enable:["click","zoomstart","moveend","popupopen"],logic:"emit"},marker:{enable:["click"],logic:"emit"}},angular.forEach(_regions,function(region){angular.forEach(region.hotels,function(hotel){_hotels.push(hotel);try{var hotelHref;hotelHref=hotel.brand&&$window.LOGO_MAP_MARKER?$state.href("hotel",{brand:hotel.brand.slug,city:hotel.cityState.substring(0,hotel.cityState.lastIndexOf("-")),state:hotel.state,slug:hotel.slug}):$state.href("hotel",{cityState:hotel.cityState,slug:hotel.slug}),vm.skipHotels&&vm.skipHotels.indexOf(hotel.hotelCode)>-1||_markers.push({lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),layer:"locations",message:"
'+hotel.name+''+hotel.name+'
'+hotel.address.addressLocality+(hotel.address.addressRegion?", "+hotel.address.addressRegion:"")+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+hotel.address.addressLocality+(hotel.address.addressRegion?", "+hotel.address.addressRegion:""),icon:$window.LOGO_MAP_MARKER?{iconUrl:hotel.brand&&hotel.brand.slug?"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/clientmedia/brands/portal/"+hotel.brand.slug+"-map-marker.png":hotel.logo,iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-60],className:"map-tip-popup"}:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-60],className:"map-tip-popup"}})}catch(e){console.log(hotel,e)}counter++})}),vm.regions=_regions,vm.allHotels=_hotels,vm.mapMarkers=_markers,$window.HIDE_HOTEL_CATEGORIES||getCategories(),getNotices(),$timeout(function(){$scope.$on("leafletDirectiveMap.popupopen",function(event){$analytics.eventTrack("Click Map Marker",{category:"Home Map Interaction",label:document.querySelector(".map-tip-firstline").innerText})}),$scope.$on("leafletDirectiveMap.zoomstart",function(event){$analytics.eventTrack("Zoom In/Out",{category:"Home Map Interaction"})}),$scope.$on("leafletDirectiveMap.click",function(event){$analytics.eventTrack("Click Map",{category:"Home Map Interaction"})}),$scope.$on("leafletDirectiveMap.moveend",function(event){$analytics.eventTrack("Move Map",{category:"Home Map Interaction"})}),vm.zoomToMarkers&&leafletData.getMap("home-map").then(function(map){_markers&&(map.invalidateSize(),map.fitBounds(_markers,!0))})},1e3)}function calculatePercentDifference(oldPrice,newPrice){var oldPriceNumeric=parseInt(oldPrice.replace(/\D/g,""),10),newPriceNumeric=parseInt(newPrice.replace(/\D/g,""),10);if(isNaN(oldPriceNumeric)||isNaN(newPriceNumeric))return!1;var difference=oldPriceNumeric-newPriceNumeric;return Math.abs(difference/newPriceNumeric*100).toFixed(0)+"%"}function showMarkerWindow(evt,id,markerId){vm.currentHotel=vm.allHotels[id],markerId?vm.map.showInfoWindow("marker-window",markerId):vm.map.showInfoWindow("marker-window",this)}function getCategories(){Places.get("RegionCategories").then(function(response){var _categories;"ok"==response.data.status&&(_categories=response.data.categories,angular.forEach(_categories,function(category,index){category.hotels=[],angular.forEach(vm.allHotels,function(hotel){hotel.cid.indexOf(category.id.toString())>-1&&category.hotels.push(hotel)}),angular.forEach(category.offers,function(offer){$window.CJEVENT&&-1==offer.cta.indexOf("cjevent")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&cjevent="+$window.CJEVENT:offer.cta=offer.cta+"?cjevent="+$window.CJEVENT),offer.price&&offer.oldPrice&&(offer.percentDifference=calculatePercentDifference(offer.oldPrice,offer.price)),$window.ROKTID&&-1==offer.cta.indexOf("rtid")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&rtid="+$window.ROKTID:offer.cta=offer.cta+"?rtid="+$window.ROKTID),offer.hotels=[],angular.forEach(vm.allHotels,function(hotel){hotel.id==offer.pid&&offer.hotels.push(hotel)})})})),vm.categories=_categories})}function getNotices(){Places.get("PortalNoticesData").then(function(response){"ok"==response.data.status&&(vm.portalNotices=response.data.content)})}$window.MarkerClusterer&&(MarkerClusterer.prototype.MARKER_CLUSTER_IMAGE_PATH_="https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/clientmedia/0001-b8bde0ae-56af9275-cd0f-7fe91758/wyndham-extra-holidays/map-marker-dot");var vm=this,regionsLoaded=!1;vm.regionName=$window.PROPERTY_CITY+", "+$window.PROPERTY_STATE,vm.data=$state.current.data,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.pageTitle=$state.current.data.pageTitle,vm.bodyContent=$state.current.data.bodyContent,vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.heroVideo=$state.current.data.heroVideo,vm.heroVideoUrl=$state.current.data.heroVideoUrl,vm.featuredImage=$state.current.data.featuredImage,vm.featuredImageURL=$state.current.data.featuredImageURL,vm.primaryOfferCategoryId=$state.current.data.primaryOfferCategoryId,vm.secondaryOfferCategoryId=$state.current.data.secondaryOfferCategoryId,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.notices=$state.current.data.notices,$state.current.data.homeLocation?vm.homeLocation=$state.current.data.homeLocation:vm.homeLocation={},$state.current.data.homeSpecials?vm.homeSpecials=$state.current.data.homeSpecials:vm.homeSpecials={},$state.current.data.uspBanner&&(vm.uspBanner=$state.current.data.uspBanner),$state.current.data.promoBanner&&(vm.promoBanner=$state.current.data.promoBanner),vm.user=Settings.get("user")||{},vm.query=Settings.get("query")||"",vm.contentFrame={},vm.type={items:[]},vm.showMarkerWindow=showMarkerWindow,vm.calculatePercentDifference=calculatePercentDifference,$window.isLightHouse||-1!=navigator.userAgent.toLowerCase().indexOf("chrome-lighthouse")||(vm.photoSliderImages=$window.REGION_SLIDER_IMAGES.filter(function(image){var pass=!0;return"1"==image.seasonal&&(image.starts||image.ends)&&(image.starts&&!moment().isAfter(moment(image.starts))&&(pass=!1),image.ends&&!moment().isBefore(moment(image.ends))&&(pass=!1)),pass&&"0"!=image.isActive})||[],vm.hideHomePageMap?$window.HIDE_HOTEL_CATEGORIES||(getCategories(),getNotices()):(Settings.get("nearby_resorts")&&(regionsLoaded||(regionsLoaded=!0,_setupRegions(Settings.get("nearby_resorts")))),$scope.$on("triggerRegionsLoaded",function(){regionsLoaded||(regionsLoaded=!0,_setupRegions(Settings.get("nearby_resorts")))}),$timeout(function(){regionsLoaded||Places.getNearbyResorts().then(function(response){response&&response.data&&"ok"==response.data.status&&_setupRegions(response.data.regions)})},2500)))}angular.module("explorer.app").controller("HomeCtrl",["$scope","$state","$timeout","$window","$filter","$mdMedia","$analytics","Places","Settings","leafletData","appConfig",HomeCtrl])}(),function(){"use strict";function HotelCtrl($rootScope,$scope,$state,$stateParams,$window,$filter,$timeout,$location,$http,$analytics,$mdDialog,Places,Alert,Settings,appConfig){function dateRangeHasWeekend(dateRange){for(var startDate=dateRange.start,endDate=dateRange.end,start=new Date(startDate),end=new Date(endDate),currentDate=start;currentDate<=end;currentDate.setDate(currentDate.getDate()+1)){var dayOfWeek=currentDate.getDay();if(5===dayOfWeek||6===dayOfWeek)return!0}return!1}function updateRates(data){if(data&&data.roomStays&&data.roomStays[0]&&vm.property.hasOfferCatalog&&vm.property.hasOfferCatalog.itemListElement.length){dateRangeHasWeekend(data.roomStays[0].timeSpan);angular.forEach(vm.property.hasOfferCatalog.itemListElement,function(offer){var minPrice,specialRateFound=!1,lowestRate=!1,currentRate=0;angular.forEach(data.roomStays[0].allRoomTypes,function(room){offer.itemOffered.name==room.roomTypeName&&(angular.forEach(room.averageRates,function(rate){"Promotional"==rate.ratePlanCategory&&rate.available&&(currentRate=rate.rate-(rate.discount||0),(!lowestRate||lowestRate.rate-lowestRate.discount>currentRate)&&(lowestRate=rate,specialRateFound=!0))}),lowestRate?room.averageRates[0]=lowestRate:angular.forEach(room.averageRates,function(rate){specialRateFound||"Rack"!=rate.ratePlanCategory||(room.averageRates[0]=rate,specialRateFound=!0)}),offer.roomTypeId=room.roomTypeCode,offer.priceCurrency=data.currencyCode,offer.available=room.available,minPrice=room.averageRates[0].rate-room.averageRates[0].discount,offer.price=minPrice)})})}else angular.forEach(vm.property.hasOfferCatalog.itemListElement,function(offer){offer.available=!1,offer.price=!1})}function getYextIframeSrc(storeCode){return"/api/yext-reviews?storeCode="+storeCode}function photoPop(index,image){image.title&&(image.title=$filter("capitalize")($filter("camelCaseToHuman")(image.title)),image.title=image.title.replace("Photo Urls","")),image.index=index,$mdDialog.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"app/cards/photo-gallery.html",controller:function($scope,$filter,$mdDialog){var tmpIndex;$scope.image=image,$scope.totalImages=vm.property.photos.length,$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image=vm.property.photos[$scope.image.index-1],$scope.image.index=tmpIndex-1):($scope.image=vm.property.photos[vm.property.photos.length-1],$scope.image.index=vm.property.photos.length-1),$scope.image.title=$filter("capitalize")($filter("camelCaseToHuman")($scope.image.title)),$scope.image.title=$scope.image.title.replace("Photo Urls","")}}})}var vm=this,found=!1;if(vm.hotelSlug=$stateParams.slug.toLowerCase(),vm.featuredImage=$state.current.data.featuredImage,vm.featuredImageURL=$state.current.data.featuredImageURL,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.currentUrl=$location.path(),vm.photoPop=photoPop,vm.hotelAmenitiesList=[],vm.getYextIframeSrc=getYextIframeSrc,vm.isLightHouse=$window.isLightHouse,$location.search().utm_campaign&&$location.search().utm_campaign.indexOf("7daysale")>-1&&$scope.$emit("triggerUpdatePromoCode","7DAYSALE"),vm.hotelSlug){var regions=Settings.get("nearby_resorts")||[];vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){if(hotel.slug==vm.hotelSlug){$stateParams.cityState&&vm.hotelSlug&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotel",{cityState:hotel.cityState,slug:hotel.slug},{reload:"hotel"}));var markerIcon={};vm.amenityFeatures=hotel.amenityFeature,markerIcon=hotel.brand&&hotel.brand.slug?{ iconUrl:hotel.brand&&hotel.brand.slug?"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/clientmedia/brands/portal/"+hotel.brand.slug+"-map-marker.png":hotel.logo,iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]}:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-60]},Settings.set("currentHotel",hotel),$scope.$emit("triggerUpdateHeaderLogo",hotel.logo),vm.headerImage=hotel.headerImage||hotel.image,vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,hotel.hints&&(vm.hints=hotel.hints),$rootScope.header&&$rootScope.header.backState&&$rootScope.header.backState.length>1&&$analytics.eventTrack(hotel.hotelCode,{category:"resort",label:hotel.name}),vm.isLightHouse||-1!=navigator.userAgent.toLowerCase().indexOf("chrome-lighthouse")?(vm.property=hotel,vm.property.bodyContent=vm.property.description):hotel.geo&&hotel.address&&(vm.mapCenter={lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),focus:!0,draggable:!0,zoom:16},vm.mapMarkers={marker:{lat:vm.mapCenter.lat,lng:vm.mapCenter.lng,message:'
'+hotel.name+'
'+hotel.address.addressLocality+(hotel.address.addressRegion?", "+hotel.address.addressRegion:"")+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+hotel.address.addressLocality+(hotel.address.addressRegion?", "+hotel.address.addressRegion:""),icon:markerIcon}},vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,zoomControlPosition:"topright",dragging:!L.Browser.mobile,tap:!L.Browser.mobile,tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"},Places.get("PortalPropertyDetails",hotel.id).then(function(response){if("ok"==response.data.status){$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500);var details=response.data.details;details.hasOfferCatalog&&details.hasOfferCatalog.itemListElement&&angular.forEach(details.hasOfferCatalog.itemListElement,function(offer){"ja"==$window.DEFAULT_LANG?offer.itemOffered.slug=$filter("toSlug")(offer.itemOffered.name,!0):offer.itemOffered.slug=$filter("toSlug")(offer.itemOffered.name)}),details.bodyContent||details.dynamicContent||details.headerImage?(vm.property=details,vm.headerImage=details.headerImage||hotel.image,"function"==typeof Settings.setMetaTitle&&"function"==typeof Settings.setMetaDescription&&(Settings.setMetaTitle(details.pageTitle?details.pageTitle:hotel.name),Settings.setMetaDescription(details.metaDescription?details.metaDescription:hotel.description))):vm.property=hotel||Settings.get("currentHotel"),1==$window.SHOW_LEAD_RATES&&$timeout(function(){$scope.$on("triggerUpdateBookingDates",function(ev,data){updateRates(data)})},50)}},function(error){vm.property=hotel||Settings.get("currentHotel")}),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)})),found=!0}})}),found||$state.go($window.APP_CONFIG.menu.Destinations?"destinations":"hotels")}}angular.module("explorer.app").controller("HotelCtrl",["$rootScope","$scope","$state","$stateParams","$window","$filter","$timeout","$location","$http","$analytics","$mdDialog","Places","Alert","Settings","appConfig",HotelCtrl])}(),function(){"use strict";function HotelsCtrl($scope,$state,$stateParams,$mdDialog,$window,$filter,$timeout,$analytics,Places,Alert,Settings,leafletData,appConfig){function _setupMapMarkers(){(vm.pagedResults||vm.allHotels)&&(_mapMarkers=[],angular.forEach(vm.pagedResults||vm.allHotels,function(hotel){if(hotel.geo&&hotel.address){hotel.cityState||(hotel.cityState="");var hotelHref;hotelHref=hotel.brand&&$window.LOGO_MAP_MARKER?$state.href("hotel",{brand:hotel.brand.slug,city:hotel.cityState.substring(0,hotel.cityState.lastIndexOf("-")),state:hotel.state,slug:hotel.slug}):$state.href("hotel",{cityState:hotel.cityState,slug:hotel.slug}),_mapMarkers.push({lat:parseFloat(hotel.geo.latitude),lng:parseFloat(hotel.geo.longitude),layer:"locations",message:"
\t\t '+hotel.name+''+hotel.name+'
'+hotel.address.addressLocality+(hotel.address.addressRegion?", "+hotel.address.addressRegion:"")+"
",focus:!1,alt:"Map marker for "+hotel.name+", located in "+(hotel.address?hotel.address.addressLocality:"")+", "+(hotel.address?hotel.address.addressRegion:""),icon:$window.LOGO_MAP_MARKER?{iconUrl:hotel.brand&&hotel.brand.slug?"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/clientmedia/brands/portal/"+hotel.brand.slug+"-map-marker.png":hotel.logo,iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]}:appConfig.mapMarkerIcon||{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-emerald.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-72]}})}else console.log(hotel),hotel.geo={},hotel.address={}}),vm.mapMarkers=_mapMarkers,$timeout(function(){$scope.$on("leafletDirectiveMap.popupopen",function(event,args){console.log(event,args),$analytics.eventTrack("Click Map Marker Popup Open",{category:"Destinations Map Interaction",label:document.querySelector(".map-tip-firstline").innerText})}),$scope.$on("leafletDirectiveMap.zoomstart",function(event){$analytics.eventTrack("Zoom In/Out",{category:"Destinations Map Interaction"})}),$scope.$on("leafletDirectiveMap.click",function(event){$analytics.eventTrack("Click Map",{category:"Destinations Map Interaction"})}),$scope.$on("leafletDirectiveMarker.click",function(event,args){console.log(event,args),$analytics.eventTrack("Click Map Marker",{category:"Destinations Map Interaction"}),console.log(event)}),$scope.$on("leafletDirectiveMap.moveend",function(event){$analytics.eventTrack("Move Map",{category:"Destinations Map Interaction"})}),vm.zoomToMarkers&&leafletData.getMap("hotels-map").then(function(map){_mapMarkers.length&&(map.invalidateSize(),map.fitBounds(_mapMarkers,!0))})},1e3))}function filterByBrands(hotel){return!vm.searchFilters.brand||""==vm.searchFilters.brand||0==hotel.name.indexOf(vm.searchFilters.brand)}function orderByFeatureCount(amenity){return vm.amenityFeatureSetCounts[amenity.name]}function showExpandedFeaturesList(ev){$mdDialog.show({controller:ExpandedFeaturesController,templateUrl:"app/cards/eh-expanded-features-list.html",parent:angular.element(document.body),targetEvent:ev,clickOutsideToClose:!0}).then(function(answer){$scope.status='You said the information was "'+answer+'".'},function(){$scope.status="You cancelled the dialog."})}function updateSearchResults(){timer&&$timeout.cancel(timer),timer=$timeout(function(){vm.pagedResults=filteredResults(),vm.currentMarker&&(vm.currentMarker=null)},10)}function filteredResults(){var passExperienceCheck=!0,passDestinationCheck=!0,queryFilter=function(query,hotel){var lowercaseQuery=angular.lowercase(query);return lowercaseQuery=lowercaseQuery.replace(/[^a-zA-Z0-9 ]/g,""),hotel.value.indexOf(lowercaseQuery)>-1},experienceFilter=function(experiences,hotel){var passCounter=0,verifyTotal=0;return angular.forEach(experiences,function(verify,experience){verify&&(verifyTotal++,angular.forEach(_categories,function(category){category.title==experience&&angular.forEach(category.offers,function(offer){offer.pid==hotel.id&&passCounter++})}))}),passCounter>0||!verifyTotal},destinationFilter=function(destination,hotel){return"All"==destination||_allRegions[destination].hotels.indexOf(hotel.id)>-1},destinationListFilter=function(destinationList,hotel){var found=!1,hasSelection=!1;return angular.forEach(destinationList,function(verify,destination){1==verify&&(hasSelection=!0,_allRegions[destination].hotels.indexOf(hotel.id)>-1&&(found=!0))}),!hasSelection||found};return _allHotels.filter(function(hotel){var pass=!0;return vm.searchWords&&(pass=queryFilter(vm.searchWords,hotel),$analytics.eventTrack(vm.searchWords,{category:"search",label:"hotel search"})),!!pass&&(angular.forEach(vm.searchFilters,function(filters,filterType){switch(filterType){case"experiences":passExperienceCheck=experienceFilter(filters,hotel);break;case"destination":passDestinationCheck=destinationFilter(filters,hotel);break;case"destinationList":passDestinationCheck=destinationListFilter(filters,hotel)}}),passDestinationCheck&&passExperienceCheck)})}function resetFilters(type,skip){vm.searchWords="",vm.searchFilters={},vm.updateSearchResults()}function showMarkerWindow(evt,id,markerId){}function ExpandedFeaturesController($scope,$mdDialog){$scope.featuresList=vm.amenityFeatureSet,$scope.featureSetCounts=vm.amenityFeatureSetCounts,$scope.hide=function(){$mdDialog.hide()},$scope.cancel=function(){$mdDialog.cancel()},$scope.answer=function(answer){$mdDialog.hide(answer)}}var timer,_categories,_mapMarkers,vm=this,_allHotels=[],_amenityFeatureSet=[],_amenityTotalCounts=[],_allRegions=[];if(vm.centerLat?vm.mapCenter={lat:parseFloat(vm.centerLat),lng:parseFloat(vm.centerLng),focus:!0,draggable:!0,zoom:5}:appConfig.mapCenter&&(vm.mapCenter=appConfig.mapCenter),vm.headerImage=$state.current.data.headerImage,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.mapConfig={searchMode:"map",center:{lat:39.707186,lng:-101.351624},zoom:6},vm.searchFilters={},vm.categories=[],vm.regions={},vm.showMarkerWindow=showMarkerWindow,vm.updateSearchResults=updateSearchResults,vm.showExpandedFeaturesList=showExpandedFeaturesList,vm.orderByFeatureCount=orderByFeatureCount,vm.filterByBrands=filterByBrands,vm.resetFilters=resetFilters,vm.mapOptions={attributionControl:!1,scrollWheelZoom:!1,dragging:!L.Browser.mobile,tap:!L.Browser.mobile,zoomControlPosition:"topright",boxZoom:!0,doubleClickZoom:!0,zoomControl:!0,tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"},vm.mapLayers={baselayers:{osm:{name:"Our Locations",type:"xyz",url:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"}},overlays:{locations:{name:"Locations",type:"markercluster",visible:!0,layerOptions:{maxClusterRadius:appConfig.maxClusterRadius||80,disableClusteringAtZoom:appConfig.disableClusteringAtZoom||!1,spiderfyDistanceMultiplier:appConfig.spiderfyDistanceMultiplier||1}}}},vm.mapEvents={map:{enable:["click","zoomstart","moveend","popupopen"],logic:"emit"},marker:{enable:["click"],logic:"emit"}},vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),$scope.$on("updateSearchQuery",function(ev,query){vm.searchWords=query,updateSearchResults()}),$scope.$watch("vm.pagedResults",function(newValue,oldValue){newValue&&oldValue&&!angular.equals(newValue,oldValue)&&(_setupMapMarkers(),vm.mapCenter={lat:parseFloat(newValue[0].geo.latitude),lng:parseFloat(newValue[0].geo.longitude),focus:!0,draggable:!0,zoom:5})}),Settings.get("has_nearby_resorts")){var _regions=Settings.get("nearby_resorts");vm.allHotels=[],angular.forEach(_regions,function(region){angular.forEach(region.hotels,function(hotel){vm.allHotels.push(hotel)})}),vm.regions=_regions,_setupMapMarkers()}vm.amenityFeatureSet=[],vm.dataLoaded=!1,$window.HIDE_HOTEL_CATEGORIES||function(){Places.get("RegionCategories").then(function(response){"ok"==response.data.status&&(_categories=response.data.categories,angular.forEach(vm.regions,function(region,regionName){var currentHotels=[];angular.forEach(region.hotels,function(hotel){currentHotels.push(hotel.id),hotel.geo&&hotel.geo.latitude&&hotel.geo.longitude&&(hotel.description=hotel.description||hotel.bodyContent,hotel.address?hotel.value=hotel.name.toLowerCase()+" "+(hotel.address.streetAddress?hotel.address.streetAddress.toLowerCase():"")+" "+(hotel.address.addressLocality?hotel.address.addressLocality.toLowerCase():"")+" "+(hotel.address.addressRegion?hotel.address.addressRegion.toLowerCase():"")+" "+(hotel.stateName?hotel.stateName.toLowerCase():"")+" "+(hotel.cityName?hotel.cityName.toLowerCase():"")+" "+(hotel.address.addressCountry?hotel.address.addressCountry.toLowerCase():"")+" "+hotel.telephone+" "+hotel.address.postalCode:hote.value=hotel.name.toLowerCase(),hotel.additionalProperty&&angular.forEach(hotel.additionalProperty,function(property){switch(property.name){case"Additional Locations":hotel.value+=" "+property.value.toLowerCase()}}),hotel.alternateName&&(hotel.value+=" "+hotel.alternateName.join(" ")),hotel.value=hotel.value.replace(/[^a-zA-Z0-9 ]/g,"").toLowerCase(),_allHotels.push(hotel),hotel.hasOfferCatalog&&hotel.hasOfferCatalog.itemListElement&&angular.forEach(hotel.hasOfferCatalog.itemListElement,function(offer){angular.forEach(offer.itemOffered.amenityFeature,function(feature){-1==_amenityFeatureSet.indexOf(feature.name)?(_amenityFeatureSet.push(feature.name),_amenityTotalCounts[feature.name]=1,vm.amenityFeatureSet.push(feature)):_amenityTotalCounts[feature.name]=_amenityTotalCounts[feature.name]+1})}),angular.forEach(_categories,function(category,index){category.hotels=[],hotel.cid.indexOf(category.id.toString())>-1&&category.hotels.push(hotel.id)}))}),_allRegions[regionName]={hotels:currentHotels}}),vm.amenityFeatureSetCounts=_amenityTotalCounts,vm.pagedResults=_allHotels,vm.dataLoaded=!0,vm.categories=_categories,Settings.get("topSearchQuery")?(vm.searchWords=Settings.get("topSearchQuery"),updateSearchResults(),Settings.set("topSearchQuery",null)):$stateParams.q&&(vm.searchWords=$stateParams.q,updateSearchResults(),Settings.set("topSearchQuery",null)))})}()}angular.module("explorer.app").controller("HotelsCtrl",["$scope","$state","$stateParams","$mdDialog","$window","$filter","$timeout","$analytics","Places","Alert","Settings","leafletData","appConfig",HotelsCtrl])}(),function(){"use strict";function LandingPageCtrl($scope,$state,$stateParams,$analytics,$window,$timeout,$location,$mdDialog,Person,Places,Settings,Alert){function setupDestinations(destinations){var _cityStates=[];vm.destinations=[],vm.hotels=[],angular.forEach(destinations,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){if(_cityStates.indexOf(hotel.cityState)<0){_cityStates.push(hotel.cityState);var hotels=[];angular.forEach(destination.hotels,function(compare){hotel.cityState==compare.cityState&&hotels.push(compare)}),vm.destinations.push({name:hotel.cityName+", "+hotel.stateName,slug:hotel.cityState,hotels:hotels})}hotel.destinationName=hotel.cityState+", "+hotel.stateName,vm.hotels.push(hotel)})})}function loadHubspotScript(noRetry){$timeout(function(){var hubspotForm=document.querySelector("[id='hubspot-form']");hubspotForm&&$window.hbspt&&hubspotForm.dataset.formId&&hubspotForm.dataset.portalId?hbspt.forms.create({portalId:hubspotForm.dataset.portalId,formId:hubspotForm.dataset.formId,target:"#hubspot-form"}):noRetry||$timeout(function(){loadHubspotScript(!0)},1e4)},500)}var rfpForm,vm=this;vm.landingPage=$state.current.data||Settings.get("currentLandingPage"),vm.headerPhone=vm.landingPage.headerPhone,vm.headerImage=vm.landingPage.headerImage,vm.headerImageURL=vm.landingPage.headerImageURL,vm.headerImageAlt=vm.landingPage.headerImageAlt,vm.mobileHeaderImage=vm.landingPage.mobileHeaderImage,vm.hasFixedWidthHero="1"==vm.landingPage.hasFixedWidthHero,vm.featuredImage=vm.landingPage.featuredImage,vm.featuredImageURL=vm.landingPage.featuredImageURL,vm.featuredImageCaption=vm.landingPage.featuredImageCaption,vm.featuredImagePosition=vm.landingPage.featuredImagePosition||"rightSidebar",vm.pageTitle=vm.landingPage.pageTitle,vm.h1=vm.landingPage.h1,vm.h2=vm.landingPage.h2,vm.hasFullWidthContent=vm.landingPage.hasFullWidthContent,vm.hasFullWidthSecondaryContent=vm.landingPage.hasFullWidthSecondaryContent,vm.hasRFP=vm.landingPage.hasRFP&&1==vm.landingPage.RFPID.toString().length||!1,vm.RFPID=vm.landingPage.RFPID||"1",vm.RFPPosition=vm.landingPage.RFPPosition,vm.hideBookingBarNumber=vm.landingPage.hideBookingBarNumber||!1,vm.promoCode=vm.landingPage.promoCode||null,vm.productId=vm.landingPage.productId||null,vm.gaEvent=vm.landingPage.gaEvent||null,vm.headerImagePositionY=vm.landingPage.headerImagePositionY||null,vm.callTel=$window.APP_CLIENT_PHONE,vm.contactEmail=$window.APP_CLIENT_EMAIL,vm.currentPageClass=vm.landingPage.slug?vm.landingPage.slug.replace("/","-"):"",vm.thankYouPage=vm.landingPage.thankYouPage,vm.formSubmitEvent=vm.landingPage.formSubmitEvent,vm.campaignName=vm.landingPage.campaignName,vm.customBookNow=vm.landingPage.customBookNow||null,"1"==vm.landingPage.requiresLogin?Settings.get("memberProfile")?vm.isLoggedIn=!0:(Settings.set("redirectAfterLogin",vm.landingPage.id),$state.go("memberLogin")):"1"==vm.landingPage.requiresPassword&&(vm.requiresPassword=!0,Settings.get("isAuthenticated")&&(vm.isAuthenticated=!0)),vm.headerPhone&&Settings.setHeaderPhone(vm.headerPhone),vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),vm.landingPage&&vm.landingPage.id?Places.get("LandingPageDetails",vm.landingPage.id).then(function(response){"ok"==response.data.status&&(Settings.set("currentLandingPage",response.data.page),vm.bodyContent=response.data.page.bodyContent,vm.secondaryBodyContent=response.data.page.secondaryBodyContent,vm.hasGallery="1"==vm.landingPage.hasGallery&&vm.landingPage.galleries.toString().length>1||!1,vm.galleries=vm.landingPage.galleries||null)}):(vm.bodyContent=vm.landingPage.bodyContent,vm.secondaryBodyContent=vm.landingPage.secondaryBodyContent),Settings.get("has_nearby_resorts")?setupDestinations(Settings.get("nearby_resorts")):Places.getNearbyResorts().then(function(response){response.data&&"ok"==response.data.status&&setupDestinations(response.data.regions)}),vm.customBookNow&&$scope.$emit("triggerCustomBookNow",vm.customBookNow),$scope.$on("triggerUpdateH1",function(event,title){vm.h1=''+title+""}),vm.RFPID.toString().length>1?(vm.hasCustomRFP=!0,Person.get("FormDetails",vm.RFPID).then(function(response){"ok"==response.data.status&&(rfpForm=response.data.form,vm.customForm=response.data.form)})):vm.hasCustomRFP=!1,vm.submitCustomRFP=function(ev){vm.customForm?Person.submitForm("CustomRFP",vm.customForm).then(function(response){response&&response.data&&"ok"==response.data.status?($analytics.eventTrack(vm.customForm.heading,{category:"Custom Forms",label:vm.customForm.submitText}),Alert.fire({ev:ev,title:vm.customForm.submissionMessageHeading||"Attention",message:vm.customForm.submissionMessageText||"Thank you. We will reach out to you shortly!"}),$state.reload()):($analytics.eventTrack(vm.customForm.heading,{category:"Custom Forms",label:"Server Error"}),Alert.fire({ev:ev,message:"There was an error, please try again later!"}),$state.reload())}):($analytics.eventTrack(vm.customForm.heading,{category:"Custom Forms",label:"Missing Fields"}),Alert.fire({ev:ev,message:"Error, try again later"}))},vm.popUp=function(popup){$mdDialog.show($mdDialog.alert({title:popup.title,htmlContent:popup.content,ok:"Close",clickOutsideToClose:!0}))},vm.checkPassword=function(ev){Person.checkPassword("landingPage",vm.landingPage.id,vm.password).then(function(response){"ok"==response.data.status?(vm.isAuthenticated=!0,Settings.set("isAuthenticated",!0)):Alert.fire({ev:ev,message:"There was a problem with your password."})})},$timeout(function(){vm.hasMktForm&&loadHubspotScript(),vm.landingPagePromoCode&&$scope.$emit("triggerUpdatePromoCode",vm.landingPagePromoCode)},1e3)}angular.module("explorer.app").controller("LandingPageCtrl",["$scope","$state","$stateParams","$analytics","$window","$timeout","$location","$mdDialog","Person","Places","Settings","Alert",LandingPageCtrl])}(),function(){"use strict";function MeetingsCtrl($scope,$state,$stateParams,$analytics,Person,Places,Alert,Settings){function submitMeetingRFP(){var pass=!0;if(!vm.resortIsRequired||vm.meetingForm.resort&&vm.meetingForm.resort.length||(pass=!1),pass&&(vm.meetingForm.name||vm.meetingForm.firstname&&vm.meetingForm.lastname)&&vm.meetingForm.email&&vm.meetingForm.phone){if(vm.customHotelEmails){var hotelAdminEmails=[];angular.forEach(vm.meetingForm.resort,function(hotelName){angular.forEach(vm.customHotelEmails,function(hotel){if(hotel.name==hotelName){var _hotelEmails=hotel.email.split(";");angular.forEach(_hotelEmails,function(email){hotelAdminEmails.push(email)})}})}),hotelAdminEmails.length&&(vm.meetingForm.adminEmails=hotelAdminEmails)}Person.submitForm("MeetingRFP",vm.meetingForm).then(function(response){response&&response.data&&"ok"==response.data.status?(vm.meetingForm={},$analytics.eventTrack("Meetings Form",{category:"Meetings",label:"Submit"}),Alert.fire({message:"Thank you. We will reach out to you shortly!"})):($analytics.eventTrack("Meetings Form",{category:"Meetings",label:"Server Error"}),Alert.fire({message:"There was an error, please try again later!"}))})}else $analytics.eventTrack("Meetings Form",{category:"Meetings",label:"Missing Fields"}),Alert.fire({message:"Please fill in all the required fields."})}function setupPropertySelect(){if(angular.forEach(vm.regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){vm.hotels.push(hotel)})}),Settings.get("selectedResort")){var _resort=Settings.get("currentHotel");vm.meetingForm.resort=[],vm.meetingForm.resort.push(_resort.name)}}var vm=this,_destinations=Settings.get("nearby_resorts")||[];if(vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.mobileHeaderImage=$state.current.data.mobileHeaderImage,vm.featuredImage=$state.current.data.featuredImage,vm.RFPID=$state.current.data.RFPID||1,vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.property=Settings.get("currentListing"),vm.meetingForm={},vm.hotels=[],vm.submitMeetingRFP=submitMeetingRFP,vm.checkinMinDate=new Date(moment()),vm.checkoutMinDate=new Date(moment().add(1,"days")),$stateParams.slug){var regions=_destinations;vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.slug.toLowerCase()&&($scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode),hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,vm.destination=destination,vm.destinationName=destinationName,vm.property=hotel,vm.meetingForm.resort=[hotel.name],vm.pageTitle="Meetings at "+hotel.name,Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),vm.bodyContent=vm.property.meetingsContent||vm.property.bodyContent):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0),vm.bodyContent=vm.property.meetingsContent||vm.property.bodyContent)}))})})}Settings.get("has_nearby_resorts")?(vm.regions=Settings.get("nearby_resorts"),setupPropertySelect()):Places.getNearbyResorts().then(function(response){response.data&&"ok"==response.data.status&&(vm.regions=response.data.regions),setupPropertySelect()}),vm.RFPID.toString().length>1?(vm.hasCustomRFP=!0,Person.get("FormDetails",vm.RFPID).then(function(response){"ok"==response.data.status&&(vm.customForm=response.data.form)})):vm.hasCustomRFP=!1,vm.submitCustomRFP=function(ev){vm.customForm?Person.submitForm("CustomRFP",vm.customForm).then(function(response){response&&response.data&&"ok"==response.data.status?($analytics.eventTrack(vm.customForm.heading,{category:"Custom Forms",label:vm.customForm.submitText}),Alert.fire({ev:ev,title:vm.customForm.submissionMessageHeading||"Attention",message:vm.customForm.submissionMessageText||"Thank you. We will reach out to you shortly!"}),$state.reload()):($analytics.eventTrack(vm.customForm.heading,{category:"Custom Forms",label:"Server Error"}),Alert.fire({ev:ev,message:"There was an error, please try again later!"}),$state.reload())}):($analytics.eventTrack(vm.customForm.heading,{category:"Custom Forms",label:"Missing Fields"}),Alert.fire({ev:ev,message:"Error, try again later"}))}}angular.module("explorer.app").controller("MeetingsCtrl",["$scope","$state","$stateParams","$analytics","Person","Places","Alert","Settings",MeetingsCtrl])}(),function(){function NearbyCtrl($scope,$state,$stateParams,$window,$filter,$mdToast,$timeout,$analytics,leafletData,Places,Person,Settings,appConfig){function fetchNearbyResults(hotelId){Places.get("NearbyCategories",hotelId).then(function(response){if(response.data&&"ok"==response.data.status&&window.L){var nids=[];vm.mapCenter={lat:parseFloat(vm.property.geo.latitude),lng:parseFloat(vm.property.geo.longitude),focus:!1,draggable:!1,zoom:14},vm.mapOptions={attributionControl:!1,dragging:!1,boxZoom:!1,doubleClickZoom:!1,tap:!1,keyboard:!1,scrollWheelZoom:!1,zoomControl:!1,tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},angular.forEach(response.data.categories,function(category){angular.forEach(category.items,function(item){nids.push(item.nid),item.centerMarker={lat:parseFloat(item.lat),lng:parseFloat(item.lng),focus:!1,draggable:!1,zoom:14},item.markers={hotel:{lat:vm.mapCenter.lat,lng:vm.mapCenter.lng,focus:!1,alt:"Map marker for "+vm.property.name+", located in "+vm.property.address.addressLocality+", "+vm.property.address.addressRegion,icon:{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-"+($window.APP_THEME||"emerald")+".png",iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}},location:{lat:parseFloat(item.lat),lng:parseFloat(item.lng),focus:!0,alt:"Map marker for "+item.name+", located in "+item.addressLocality+", "+item.addressRegion,icon:{iconUrl:"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-"+($window.APP_THEME||"nearby")+".png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-60]},riseOnHover:!0}}})}),vm.categories=response.data.categories,$timeout(function(){angular.forEach(nids,function(nid){leafletData.getMap("map-"+nid).then(function(map){map.invalidateSize()})})},800)}}),Places.nearby({category:"play",listingId:hotelId},function(data){data.places.length?vm.types[0].items=data.places:vm.types[0].noItems=!0,vm.contentFrame={},$timeout(function(){Places.nearby({category:"shop",listingId:hotelId},function(data){data.places.length?vm.types[1].items=data.places:vm.types[1].noItems=!0}),Places.nearby({category:"eat",listingId:hotelId},function(data){data.places.length?vm.types[2].items=data.places:vm.types[2].noItems=!0})},100)});var breakLoop=!1;breakLoop||$window.PORTAL_DESTINATIONS.states.indexOf($stateParams.slug)>-1&&(vm.isState=!0,vm.destinationName=$filter("properCaps")($stateParams.slug),breakLoop=!0),breakLoop||$window.PORTAL_DESTINATIONS.cityStates.indexOf($stateParams.slug)>-1&&(vm.isCityState=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.cityState==$stateParams.slug&&(breakLoop||(vm.destinationName=hotel.cityName+", "+hotel.stateName,breakLoop=!0))})}))}function getToastPosition(){return Object.keys(vm.toastPosition).filter(function(pos){return vm.toastPosition[pos]}).join(" ")}function viewListing(flipped,category,id){flipped&&Places.markView("NearbyListing",id).then(function(data){console.log(data)})}var vm=this;if(vm.isSignedIn=Settings.get("token"),vm.isProperty=!1,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,$stateParams.cityState&&$stateParams.slug?vm.isProperty=!0:vm.h1="Things to do near "+$filter("properCaps")($stateParams.slug),vm.search="",vm.destinationSlug=$stateParams.slug,vm.types=[{type:"play",name:"Play"},{type:"shop",name:"Shop"},{type:"eat",name:"Eat"}],vm.bodyContent=$state.current.data.bodyContent,vm.listingId=$stateParams.listingId||"",vm.slug=$stateParams.slug||"",$stateParams.slug){var regions=Settings.get("nearby_resorts")||[],found=!1;angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){found||hotel.cityState!=$stateParams.slug.toLowerCase()&&hotel.state!=$stateParams.slug.toLowerCase()||(vm.isProperty&&(Settings.set("currentHotel",hotel),vm.headerProperty=hotel),vm.destination=destination,vm.destinationName=destinationName,Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),fetchNearbyResults(hotel.id),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)):vm.property=hotel,fetchNearbyResults(hotel.id),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}),vm.pageTitle=vm.h1,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,found=!0)})}),found||$state.go("404")}else vm.isProperty=!1,vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.h1=$state.current.data.h1,vm.h1=$state.current.data.h1,vm.h2=$state.current.data.h2,fetchNearbyResults();vm.getToastPosition=getToastPosition,vm.viewListing=viewListing,vm.toastPosition={bottom:!1,top:!0,left:!1,right:!0}}function NearbyHotelCtrl($scope,$state,$stateParams,$window,$mdToast,$timeout,$location,$analytics,leafletData,Places,Person,Settings){function fetchNearbyResults(hotelId){Places.get("NearbyCategories",hotelId).then(function(response){if(response.data&&"ok"==response.data.status&&window.L){var nids=[];vm.mapCenter={lat:parseFloat(vm.property.geo.latitude),lng:parseFloat(vm.property.geo.longitude),focus:!1,draggable:!1,zoom:14},vm.mapOptions={attributionControl:!1,dragging:!1,boxZoom:!1,doubleClickZoom:!1,tap:!1,keyboard:!1,scrollWheelZoom:!1,zoomControl:!1,tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},angular.forEach(response.data.categories,function(category){angular.forEach(category.items,function(item){nids.push(item.nid),item.centerMarker={lat:parseFloat(item.lat),lng:parseFloat(item.lng),focus:!1,draggable:!1,zoom:14},item.markers={hotel:{lat:vm.mapCenter.lat,lng:vm.mapCenter.lng,focus:!1, alt:"Map marker for "+vm.property.name+", located in "+vm.property.address.addressLocality+", "+vm.property.address.addressRegion,icon:{iconUrl:vm.mapMarkerIcon||"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-nearby.png",iconSize:[36,36],iconAnchor:[18,36],popupAnchor:[0,-36]}},location:{lat:parseFloat(item.lat),lng:parseFloat(item.lng),focus:!0,alt:"Map marker for "+item.name+", located in "+item.addressLocality+", "+item.addressRegion,icon:{iconUrl:"https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/map-marker-nearby.png",iconSize:[72,60],iconAnchor:[36,60],popupAnchor:[0,-60]},riseOnHover:!0}}})}),vm.categories=response.data.categories,$timeout(function(){angular.forEach(nids,function(nid){leafletData.getMap("map-"+nid).then(function(map){map.invalidateSize()})})},800)}})}function getToastPosition(){return Object.keys(vm.toastPosition).filter(function(pos){return vm.toastPosition[pos]}).join(" ")}function viewListing(flipped,category,slug){flipped&&Places.markView("NearbyListing",slug).then(function(data){console.log(data)})}function getDistanceFromHotel(item){var radlat1=Math.PI*parseFloat(vm.property.geo.latitude)/180,radlat2=Math.PI*parseFloat(item.lat)/180,theta=parseFloat(vm.property.geo.longitude)-parseFloat(item.lng),radtheta=Math.PI*theta/180,dist=Math.sin(radlat1)*Math.sin(radlat2)+Math.cos(radlat1)*Math.cos(radlat2)*Math.cos(radtheta);return dist>1&&(dist=1),dist=Math.acos(dist),dist=180*dist/Math.PI,dist=60*dist*1.1515}var vm=this;if(vm.isSignedIn=Settings.get("token"),vm.search="",vm.types=[{type:"play",name:"Play"},{type:"shop",name:"Shop"},{type:"eat",name:"Eat"}],vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.listingId=$stateParams.listingId||"",vm.slug=$stateParams.slug||"",vm.getToastPosition=getToastPosition,vm.viewListing=viewListing,vm.getDistanceFromHotel=getDistanceFromHotel,vm.toastPosition={bottom:!1,top:!0,left:!1,right:!0},$stateParams.slug){var regions=Settings.get("nearby_resorts")||[],found=!1;vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.slug&&(found=!0,$stateParams.cityState&&$stateParams.slug&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelNearby",{cityState:hotel.cityState,slug:hotel.slug},{reload:"hotelNearby"})),Settings.set("currentHotel",hotel),vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,hotel.nearbyContent&&(vm.bodyContent=hotel.nearbyContent),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),vm.pageTitle="Things to do near "+hotel.name,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,fetchNearbyResults(hotel.id),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)):vm.property=hotel,vm.pageTitle="Things to do near "+hotel.name,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,fetchNearbyResults(hotel.id),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}))})}),found||$state.go("404")}}function NearbyListingCtrl($scope,$state,$stateParams,$window,$mdToast,Places,Person,Settings){function fetchNearbyDetails(){Places.getNearbyListing(vm.property.id,vm.slug).then(function(response){var data=response.data;vm.item=data.place,vm.mapCenter={lat:parseFloat(vm.item.lat),lng:parseFloat(vm.item.lng),focus:!1,draggable:!1,zoom:14},vm.mapOptions={attributionControl:!1,dragging:!1,boxZoom:!1,doubleClickZoom:!1,tap:!1,keyboard:!1,scrollWheelZoom:!1,zoomControl:!1,tileLayer:"https://b.tile.openstreetmap.org/{z}/{x}/{y}.png"},vm.mapEvents={map:{enable:["moveend","popupopen"],logic:"emit"},marker:{enable:[],logic:"emit"}},vm.mapMarkers={marker:{lat:vm.mapCenter.lat,lng:vm.mapCenter.lng,message:"
"+vm.item.name+'
'+vm.item.addressLocality+", "+vm.item.addressRegion+"
",focus:!1,alt:"Map marker for "+vm.item.name+", located in "+vm.item.addressLocality+", "+vm.item.addressRegion,icon:vm.mapMarkerIcon}},vm.gallery=vm.item.photos,vm.currentIndex=0,vm.setCurrentSlideIndex=function(index){vm.currentIndex=index},vm.isCurrentSlideIndex=function(index){return vm.currentIndex===index},vm.prevSlide=function(){vm.currentIndex=vm.currentIndex>0?--vm.currentIndex:vm.gallery.length-1},vm.nextSlide=function(){vm.currentIndex=vm.currentIndex1&&(dist=1),dist=Math.acos(dist),dist=180*dist/Math.PI,dist=60*dist*1.1515}return""}var vm=this;if(vm.slug=$stateParams.slug,vm.category=$stateParams.category,vm.getDistanceFromHotel=getDistanceFromHotel,$stateParams.hotel&&$stateParams.slug){var regions=Settings.get("nearby_resorts")||[];vm.isProperty=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.hotel&&(Settings.set("currentHotel",hotel),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode),vm.destination=destination,vm.destinationName=destinationName,Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),vm.pageTitle="Things to do near "+hotel.name,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,fetchNearbyDetails()):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0),vm.pageTitle="Things to do near "+hotel.name,hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,fetchNearbyDetails())}))})})}else $state.go("home");vm.frame={},vm.frame.height=window.innerHeight,vm.frame.width=window.innerWidth,vm.frame.halfwidth=Math.ceil(window.innerWidth/2),vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.getToastPosition=getToastPosition,vm.toastPosition={bottom:!1,top:!0,left:!1,right:!0}}angular.module("explorer.app").controller("NearbyCtrl",["$scope","$state","$stateParams","$window","$filter","$mdToast","$timeout","$analytics","leafletData","Places","Person","Settings",NearbyCtrl]).controller("NearbyHotelCtrl",["$scope","$state","$stateParams","$window","$mdToast","$timeout","$location","$analytics","leafletData","Places","Person","Settings",NearbyHotelCtrl]).controller("NearbyListingCtrl",["$scope","$state","$stateParams","$window","$mdToast","Places","Person","Settings",NearbyListingCtrl])}(),function(){"use strict";function OfferCategoryCtrl($scope,$state,$stateParams,$timeout,$filter,$window,$location,$http,$mdDialog,$mdpDatePicker,Settings,Places,Alert){function scrollBy(last,inview){last&&inview&&(vm.offersLimit+=9)}function checkinDatePicker(ev){$mdpDatePicker(vm.checkinDate,{minDate:today,targetEvent:ev,dateLabel:"Check-In"}).then(function(selectedDate){vm.checkinDate=selectedDate,moment(selectedDate).diff(moment(vm.checkoutDate))>=-86400001&&(vm.checkoutDate=new Date(moment(vm.checkinDate).add(2,"days"))),checkoutDatePicker(ev)})}function checkoutDatePicker(ev){$mdpDatePicker(vm.checkoutDate,{minDate:new Date(moment(vm.checkinDate).add(2,"days")),targetEvent:ev,dateLabel:"Check-Out"}).then(function(selectedDate){vm.checkoutDate=selectedDate,moment(selectedDate).diff(moment(vm.checkinDate))<=86400001&&(vm.checkinDate=new Date(moment(vm.checkoutDate).subtract(2,"days")))})}function calculatePercentDifference(oldPrice,newPrice){var oldPriceNumeric=parseInt(oldPrice.replace(/\D/g,""),10),newPriceNumeric=parseInt(newPrice.replace(/\D/g,""),10);if(isNaN(oldPriceNumeric)||isNaN(newPriceNumeric))return!1;var difference=oldPriceNumeric-newPriceNumeric;return Math.abs(difference/newPriceNumeric*100).toFixed(0)+"%"}function isDateGreater(dateInput1,dateInput2){return"string"==typeof dateInput1&&(dateInput1=new Date(dateInput1)),"string"==typeof dateInput2&&(dateInput2=new Date(dateInput2)),dateInput1>dateInput2}function isDateSame(dateInput1,dateInput2){return"string"==typeof dateInput1&&(dateInput1=new Date(new Date(dateInput1).setHours(0,0,0,0))),"string"==typeof dateInput2&&(dateInput2=new Date(new Date(dateInput2).setHours(0,0,0,0))),dateInput1==dateInput2}function isDisabledDate(d){return d0&&("stacked"==vm.currentCategory.featuredOffersLayout&&1!=vm.currentCategory.featuredOffers||(featuredOfferDefaultFlex=Math.floor(100/vm.currentCategory.featuredOffers),vm.stackableFlex=1==vm.currentCategory.featuredOffers?100:featuredOfferDefaultFlex,vm.stackableFlexSm=1==vm.currentCategory.featuredOffers?100:50,vm.stackRemainderFlexSm=100,vm.stackRemainderFlex=featuredOfferDefaultFlex),"stacked"==vm.currentCategory.featuredOffersLayout&&vm.currentCategory.featuredOffers>1&&(vm.stackRemainderFlex=100,vm.stackRemainderFlexSm=100,vm.stackableFlex=50,vm.stackableFlexSm=1==vm.currentCategory.featuredOffers?100:50)),angular.forEach(data.offers,function(offer){if(offer.categoryId==vm.currentCategory.id){if($window.CJEVENT&&-1==offer.cta.indexOf("cjevent")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&cjevent="+$window.CJEVENT:offer.cta=offer.cta+"?cjevent="+$window.CJEVENT),$window.ROKTID&&-1==offer.cta.indexOf("rtid")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&rtid="+$window.ROKTID:offer.cta=offer.cta+"?rtid="+$window.ROKTID),offer.price&&offer.oldPrice&&(offer.percentDifference=calculatePercentDifference(offer.oldPrice,offer.price)),offer.image.indexOf("[")>-1)try{offer.image=JSON.parse(offer.image)}catch(e){console.log(e)}offer.isMultiImage=!!(offer.image&&"object"==typeof offer.image&&offer.image.length>1),_tmpState=offer.hotelCityStateText.split(", "),_tmpState=_tmpState.length>2?_tmpState[2].trim():_tmpState[1].trim(),_states.indexOf(_tmpState)<0&&(_states.push(_tmpState),vm.states.push({name:_tmpState,country:_countryStates[_tmpState]||"",slug:_tmpState.toLowerCase()})),angular.forEach(vm.countries,function(country){country.name==_countryStates[_tmpState]&&(country.count++,offer.country=country.name)}),offer.country=offer.country||"USA",offer.state=_tmpState,_hotels.indexOf(offer.hotelCode)<0&&(_hotels.push(offer.hotelCode),vm.hotels.push({name:offer.hotelName,id:offer.hotelCode,country:offer.country,state:_tmpState,cityState:offer.hotelCityStateText,image:offer.image,url:offer.cta,hotelCityState:offer.hotelCityState,hotelSlug:offer.hotelSlug})),_regions.indexOf(offer.hotelCityState)<0&&(_regions.push(offer.hotelCityState),vm.destinations.push({name:offer.hotelCityStateText,slug:offer.hotelCityState,country:offer.country})),offer.propertyIds&&offer.propertyIds.length&&(offer._hotels=[],offer._destinations=[],angular.forEach(_allHotels,function(hotel){-1==_hotels.indexOf(hotel.hotelCode)&&offer.propertyIds.indexOf(hotel.id)>-1&&(_hotels.push(hotel.hotelCode),offer._hotels.push(hotel.hotelCode),vm.hotels.push({name:hotel.name,id:hotel.hotelCode,country:hotel.address.addressCountry||"USA",state:_tmpState,cityState:hotel.cityName+", "+hotel.stateName,image:offer.image,url:offer.cta,hotelCityState:hotel.cityState,hotelSlug:hotel.slug}),-1==_regions.indexOf(hotel.cityState)&&(_regions.push(hotel.cityState),offer._destinations.push(hotel.cityName+", "+hotel.stateName),vm.destinations.push({name:hotel.cityName+", "+hotel.stateName,slug:hotel.cityState,country:offer.country})))})),vm.offers.push(offer)}}),$location.search().country?($location.search().state&&($location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase()===$location.search().city.toLowerCase()+", "+$location.search().state.toLowerCase()&&$timeout(function(){vm.selectedDestination=destination.name},100)}),angular.forEach(vm.states,function(state){state.name.toLowerCase()===$location.search().state.toLowerCase()&&$timeout(function(){vm.selectedState=state.name},100)})),angular.forEach(vm.countries,function(country){country.name.toLowerCase()===$location.search().country.toLowerCase()&&$timeout(function(){vm.selectedCountry=country.name},100)})):$location.search().state?($location.search().city&&angular.forEach(vm.destinations,function(destination){console.log(destination.name.toLowerCase(),$location.search().city.toLowerCase()+", "+$location.search().state.toLowerCase()),destination.name.toLowerCase()===$location.search().city.toLowerCase()+", "+$location.search().state.toLowerCase()&&$timeout(function(){vm.selectedDestination=destination.name},100)}),angular.forEach(vm.states,function(state){state.name.toLowerCase()===$location.search().state.toLowerCase()&&$timeout(function(){vm.selectedState=state.name},100)})):$location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase().indexOf($location.search().city.toLowerCase())>-1&&$timeout(function(){vm.selectedDestination=destination.name},100)})),category.hexColor&&(category.hexColor.page||category.hexColor.content||category.hexColor.accent||category.hexColor.cta)&&$scope.$emit("triggerUpdateDecoration",category.hexColor),"1"==category.hideBookingBar&&($scope.$emit("triggerHideBookingBar",!0),$scope.$on("$destroy",function(){$scope.$emit("triggerHideBookingBar",!1)})),Places.get("RegionOfferCategoryChildren",category.id).then(function(response){response&&response.data&&($stateParams.child?angular.forEach(response.data.categories,function(category){vm.categories.push(category),$stateParams.child==category.slug&&(vm.currentCategory=category,vm.currentCategory.isFeatured=vm.isFeatured,vm.bodyContent=category.description||($state.current.data?$state.current.data.bodyContent:""),vm.h1=$state.name||($state.current.data?$state.current.data.h1:""),vm.h2=$state.subtitle||($state.current.data?$state.current.data.h2:""),angular.forEach(data.offers,function(offer){offer.categoryId==vm.currentCategory.id&&(offer.cta&&(offer.cta=offer.cta+(offer.cta.indexOf("?")>-1?"&":"?")+"landing_site="+$window.APP_DOMAIN),vm.offers.push(offer),_hotels.indexOf(offer.hotelCode)<0&&(_hotels.push(offer.hotelCode),vm.hotels.push({name:offer.hotelName,id:offer.hotelCode,cityState:offer.hotelCityStateText})),_regions.indexOf(offer.hotelCityState)<0&&(_regions.push(offer.hotelCityState),vm.destinations.push({name:offer.hotelCityStateText,slug:offer.hotelCityState})))}))}):angular.forEach(response.data.categories,function(category){category.offers||(category.offers=[]),angular.forEach(data.offers,function(offer){offer.categoryId==category.id&&(offer.cta&&(offer.cta=offer.cta+(offer.cta.indexOf("?")>-1?"&":"?")+"landing_site="+$window.APP_DOMAIN),category.offers.push(offer),_hotels.indexOf(offer.hotelCode)<0&&(_hotels.push(offer.hotelCode),vm.hotels.push({name:offer.hotelName,id:offer.hotelCode,cityState:offer.hotelCityStateText})),_regions.indexOf(offer.hotelCityState)<0&&(_regions.push(offer.hotelCityState),vm.destinations.push({name:offer.hotelCityStateText,slug:offer.hotelCityState})))}),vm.categories.push(category)}))}))}),data.offers.length&&categoryFound||$state.go("offers"))}function loadMore(){currentPage++;var newItems=Places.getPlaces();vm.pagedItems.length>=newItems.length&&(vm.hideLoadMore=!0),offset=currentPage*itemsPerPage,newItems=newItems.slice(offset,offset+itemsPerPage),vm.pagedItems=vm.pagedItems.concat(newItems)}function nextPageDisabledClass(){return currentPage===vm.pageCount()-1?"disabled":""}function pageCount(){return Math.ceil(vm.total/itemsPerPage)}function viewProperty(hotelCode){var _regions=Settings.get("nearby_resorts")||[];angular.forEach(_regions,function(region){angular.forEach(region.hotels,function(hotel){if(hotel.hotelCode==hotelCode)return $state.go("hotel",{slug:hotel.slug,cityState:hotel.cityState})})})}function popPhotos(ev,imageSet,imgIndex){$mdDialog.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,targetEvent:ev,templateUrl:"app/cards/photo-gallery.html",controller:function($scope,$filter,$mdDialog){var tmpIndex=imgIndex||0;$scope.image={url:imageSet[tmpIndex],index:tmpIndex},$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image={url:imageSet[$scope.image.index-1]},$scope.image.index=tmpIndex-1):($scope.image={url:imageSet[$scope.image.index-1]},$scope.image.index=imageSet.length-1)}}})}function dynamicSearch(ev,selectedState,selectedDestination,selectedResort,startDate,endDate){if(vm.isSearch=!0,selectedResort){var cta,offers={length:0};vm.offers=offers,angular.forEach(vm.hotels,function(hotel){hotel.id==selectedResort&&(cta=hotel.url.split("="),vm.ratePlan=cta[1].replace("&landing_site",""))}),$http({url:"https://api.travelclick.com/ibe/v1/hotel/"+selectedResort+"/avail?lang=EN_US&adults=2&infants=0¤cy=USD&rooms=1&dateIn="+moment(startDate).format("YYYY-MM-DD")+"&dateOut="+moment(endDate).format("YYYY-MM-DD")+"&ratePlanCode="+vm.ratePlan,method:"GET",dataType:"json"}).success(function(data,status,headers,config){200==status&&(angular.forEach(vm.hotels,function(hotel){hotel.id==selectedResort&&(offers[selectedResort]=hotel)}),vm.isSearching=!1,angular.forEach(data.roomStays[0].ratePlans,function(plan){plan.leadRate&&plan.ratePlanCode==vm.ratePlan&&(offers[selectedResort].ratePlan=plan,offers[selectedResort].roomTypes=data.roomStays[0].allRoomTypes,offers.length++)}),vm.offers=offers)}).error(function(data,status,headers,config){vm.isSearching=!1})}else if(selectedDestination||selectedState){var cta,searchQuery=(selectedDestination||selectedState).toLowerCase(),results=vm.hotels.filter(function(hotel){return hotel.cityState.toLowerCase().indexOf(searchQuery)>-1});vm.isSearching=!0,vm.offers={length:0},results.length&&angular.forEach(results,function(result){cta=result.url.split("="),cta=cta[1].replace("&landing_site",""),result.cta=cta,result.ratePlan=result.ratePlan||{},result.ratePlan.leadRate="",vm.offers[result.id]=result,$http({url:"https://api.travelclick.com/ibe/v1/hotel/"+result.id+"/avail?lang=EN_US&adults=2&infants=0¤cy=USD&rooms=1&dateIn="+moment(startDate).format("YYYY-MM-DD")+"&dateOut="+moment(endDate).format("YYYY-MM-DD")+"&ratePlanCode="+cta,method:"GET",dataType:"json"}).success(function(data,status,headers,config){200==status&&(vm.isSearching=!1,angular.forEach(data.roomStays[0].ratePlans,function(plan){angular.forEach(vm.offers,function(offer){plan.leadRate&&offer.cta==plan.ratePlanCode&&(offer.currencyCode=data.roomStays[0].currencyCode,offer.ratePlan=plan,offer.roomTypes=data.roomStays[0].allRoomTypes,vm.offers.length++)})}))}).error(function(data,status,headers,config){vm.isSearching=!1})})}else Alert.fire({message:"Please select a state/destination or resort",ev:ev})}var prevDiff,featuredOfferDefaultFlex,vm=this,offset=0,itemsPerPage=18,currentPage=0,categoryFound=!1,today=$location.search().date?new Date($location.search().date):new Date;vm.currentSlug=$stateParams.slug||vm.currentSlug||null,vm.categories=[],vm.isCategoryPage=!!vm.currentSlug,vm.isPreview=!!$location.search().isPreview,vm.searchQuery=Settings.get("searchQuery")||"",vm.showMore=!0,vm.dynamicSearch=dynamicSearch,vm.checkinDate=new Date(moment().add(1,"days")),vm.checkoutDate=new Date(moment().add(3,"days")),vm.isSeaching=!1,vm.checkinDatePicker=checkinDatePicker,vm.checkoutDatePicker=checkoutDatePicker,vm.offerUrl="",vm.getBookingUrl=getBookingUrl,vm.isDisabledDate=isDisabledDate,vm.isDateGreater=isDateGreater,vm.isDateSame=isDateSame,vm.loadMore=loadMore,vm.nextPageDisabledClass=nextPageDisabledClass,vm.pageCount=pageCount,vm.viewProperty=viewProperty,vm.scrollBy=scrollBy,vm.popPhotos=popPhotos,vm.calculatePercentDifference=calculatePercentDifference,vm.currentUrl=$location.path(),vm.search="",vm.offers=[],vm.hotels=[],vm.destinations=[],vm.states=[],vm.countries=[],vm.currentYear=(new Date).getFullYear(),vm.currentESTDay=new Date(today.getTime()+-144e5),vm.currentPSTDay=new Date(today.getTime()+-252e5),vm.tomorrowPSTDay=new Date(today.getTime()+-144e5),vm.tomorrowPSTDay.setDate(vm.tomorrowPSTDay.getDate()+1),$scope.$watch("vm.checkinDate",function(oldDate,newDate){moment(vm.checkinDate).diff(moment(vm.checkoutDate))>=-86400001&&(prevDiff=moment(vm.checkinDate).diff(moment(vm.checkoutDate)))}),$scope.$watch("vm.checkoutDate",function(oldDate,newDate){moment(vm.checkoutDate).diff(moment(vm.checkinDate))!=prevDiff&&(vm.showDatePicker=!1)}),$stateParams.Identifier&&$scope.$emit("updatePromoCode",$stateParams.Identifier),$state.current.data&&$state.current.data.promoId,Places.get("RegionOffersDetails",$window.RID,$location.search().isPreview||null).then(function(response){response&&response.data&&handleOffersResponse(response.data)}),vm.popUp=function(popup){$mdDialog.show($mdDialog.alert({title:popup.title,htmlContent:popup.content,ok:"Close",clickOutsideToClose:!0}))}}angular.module("explorer.app").controller("OfferCategoryCtrl",["$scope","$state","$stateParams","$timeout","$filter","$window","$location","$http","$mdDialog","$mdpDatePicker","Settings","Places","Alert",OfferCategoryCtrl])}(),function(){"use strict";function OfferCtrl($scope,$state,$stateParams,$window,$location,$timeout,$filter,Places,Settings){function getOffers(){if($stateParams.hotel){vm.isProperty=!0;var found=!1;angular.forEach(_destinations,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.hotel.toLowerCase()&&(found=!0,$stateParams.cityState&&$stateParams.hotel&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelSpecial",{cityState:hotel.cityState,hotel:hotel.slug,slug:$stateParams.slug},{reload:"hotelSpecial"})),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),Settings.set("currentHotel",hotel),hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,vm.headerProperty=hotel,Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),getPropertyOffers(),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)):vm.property=hotel,getPropertyOffers(),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}),vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,vm.pageTitle="Offers at "+hotel.name)})}),found||$state.go("404"),vm.selectedResort=Settings.get("selectedResort")}else vm.headerImage=$state.current.data.headerImage,vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle="Offers at "+$window.APP_CLIENT,vm.isProperty=!1,vm.hotels=[],vm.destinations=[],angular.forEach(_destinations,function(destination,destinationName){vm.destinations.push({name:destinationName,hotels:destination.hotels}),angular.forEach(destination.hotels,function(hotel){vm.hotels.push(hotel)})}),getRegionOffers()}function getRegionOffers(){Places.get("RegionOffersDetails",$window.RID).then(function(response){response&&response.data&&handleOffersResponse(response.data)})}function getPropertyOffers(propertyId){propertyId=propertyId||vm.property.id,$location.search().lid||$location.search().LID||$location.search().Lid?($window.LID=$location.search().lid||$location.search().LID||$location.search().Lid,Places.get("SiteDynamicPhone",$window.LID).then(function(response){"ok"==response.data.status&&response.data.phone&&Settings.setHeaderPhone(response.data.phone),Places.get("PropertyOffersDetails",propertyId).then(function(response){response&&response.data&&handleOffersResponse(response.data)})})):Places.get("PropertyOffersDetails",propertyId).then(function(response){response&&response.data&&handleOffersResponse(response.data)})}function handleOffersResponse(data){data=data||{},angular.forEach(data.offers,function(offer){if($stateParams.slug==offer.slug){if(found=!0,!angular.isObject(offer.cta)&&0==offer.cta.indexOf("{"))try{offer.cta=JSON.parse(offer.cta),offer.cta=offer.cta[vm.property.id]}catch(e){}if(offer.propertyIds&&offer.propertyIds.length){var activePropertyIds=vm.hotels.map(function(hotel){return hotel.id});offer.propertyIds=offer.propertyIds.filter(function(propertyId){return activePropertyIds.indexOf(propertyId)>-1})}offer.headerPhone=Settings.getHeaderPhone(),$window.CJEVENT&&-1==offer.cta.indexOf("cjevent")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&cjevent="+$window.CJEVENT:offer.cta=offer.cta+"?cjevent="+$window.CJEVENT),$window.ROKTID&&-1==offer.cta.indexOf("rtid")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&rtid="+$window.ROKTID:offer.cta=offer.cta+"?rtid="+$window.ROKTID),vm.offer=offer,vm.headerImage=offer.image,vm.h2=offer.title;var foundCategory=!1;$scope.$broadcast("triggerUpdateUrl",offer.cta),$scope.$emit("triggerUpdateUrl",offer.cta),("1"==offer.hideBookingBar||vm.hideBookingBar)&&($scope.$emit("triggerHideBookingBar",!0),$scope.$on("$destroy",function(){$scope.$emit("triggerHideBookingBar",!1)})),offer.categoryName?(foundCategory=!0,vm.category={name:offer.categoryName,slug:offer.categorySlug}):angular.forEach(data.categories,function(category){foundCategory||category.id!=offer.categoryId||(vm.category=category,foundCategory=!0)}),vm.hasMktForm&&$timeout(function(){var mktForm=document.querySelector("[id^='marketoForm_']"),hubspotForm=document.querySelector("[id='hubspot-form']");if(mktForm){mktForm=mktForm.id.replace("marketoForm_","").split("_"),vm.mktFormId=mktForm[1];vm.mktFormId,$window.location.hostname.replace("www.","");window.MktoForms2&&mktForm[0]?MktoForms2.loadForm("https://app-ab19.marketo.com",mktForm[0],vm.mktFormId):$timeout(function(){window.MktoForms2&&mktForm[0]&&MktoForms2.loadForm("https://app-ab19.marketo.com",mktForm[0],vm.mktFormId)},1e3)}else hubspotForm&&$window.hbspt&&hbspt.forms.create({portalId:hubspotForm.dataset.portalId,formId:hubspotForm.dataset.formId,target:"#hubspot-form"})},100)}}),found||(vm.isProperty?$state.go("hotelSpecials",{cityState:vm.property.cityState,slug:vm.property.slug}):$state.go("offers"))}var vm=this,found=!1,_destinations=Settings.get("nearby_resorts")||[];vm.bodyContent=$state.current.data.bodyContent,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.currentDate=new Date,vm.isObject=angular.isObject,_destinations&&_destinations.length?getOffers():$timeout(function(){Places.getNearbyResorts().then(function(response){response.data&&"ok"==response.data.status&&(_destinations=response.data.regions,getOffers())})},100)}angular.module("explorer.app").controller("OfferCtrl",["$scope","$state","$stateParams","$window","$location","$timeout","$filter","Places","Settings",OfferCtrl])}(),function(){"use strict";function OffersCtrl($scope,$state,$stateParams,$window,$filter,$location,$timeout,Places,Settings){function viewPropertyOffers(propertyId){angular.forEach(vm.hotels,function(hotel){if(hotel.id==propertyId)return void $state.go("hotelSpecials",{cityState:hotel.cityState,slug:hotel.slug})})}function getPropertyOffers(propertyId){ propertyId?Places.get("PropertyOffersDetails",propertyId).then(function(response){"ok"==response.data.status&&handlePropertyOffersResponse(response.data)}):vm.offers=vm.allOffers}function getDestinationOffers(destinationName){Settings.get("nearby_resorts");vm.offers=destinationName?[]:vm.allOffers,angular.forEach(vm.destinations,function(destination){destinationName==destination.name&&(vm.offers=vm.allOffers.filter(function(offer){var found=!1;return angular.forEach(destination.hotels,function(hotel){found||hotel.hotelCode!=offer.hotelCode||(found=!0)}),found}))})}function getRegionOffers(){Places.get("RegionOffersDetails",$window.RID).then(function(response){response&&response.data&&handleOffersResponse(response.data)})}function handlePropertyOffersResponse(data){angular.forEach(data.offers,function(offer){if(0==offer.cta.indexOf("{"))try{offer.cta=JSON.parse(offer.cta),offer.cta=offer.cta[vm.property.id]}catch(e){}offer.headerPhone=Settings.getHeaderPhone(),$window.CJEVENT&&-1==offer.cta.indexOf("cjevent")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&cjevent="+$window.CJEVENT:offer.cta=offer.cta+"?cjevent="+$window.CJEVENT),$window.ROKTID&&-1==offer.cta.indexOf("rtid")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&rtid="+$window.ROKTID:offer.cta=offer.cta+"?rtid="+$window.ROKTID)}),vm.offers=data.offers,vm.categories=data.categories}function handleOffersResponse(data){angular.forEach(data.offers,function(offer){offer.headerPhone=Settings.getHeaderPhone(),$window.CJEVENT&&-1==offer.cta.indexOf("cjevent")&&(offer.cta.indexOf("?")>0?offer.cta=offer.cta+"&cjevent="+$window.CJEVENT:offer.cta=offer.cta+"?cjevent="+$window.CJEVENT)}),vm.allOffers=data.offers,vm.offers=data.offers,vm.categories=data.categories,vm.hotels=vm.hotels.filter(function(hotel){var pass=!1;return angular.forEach(vm.offers,function(offer){(hotel.hotelCode==offer.hotelCode&&!offer.hideLocal||offer.propertyIds&&offer.propertyIds.length&&offer.propertyIds.indexOf(hotel.id)>-1)&&(pass=!0)}),pass})}var _promoId,vm=this,_destinations=Settings.get("nearby_resorts")||[];if(vm.currentDate=new Date,vm.property=Settings.get("currentListing")||{},vm.getPropertyOffers=getPropertyOffers,vm.getRegionOffers=getRegionOffers,vm.getDestinationOffers=getDestinationOffers,vm.viewPropertyOffers=viewPropertyOffers,vm.destinations=[],vm.isProperty=!1,vm.hotels=[],_promoId=$state.current.data?$state.current.data.promoId:"",_promoId&&$scope.$emit("updatePromoCode",_promoId),$stateParams.slug&&"destinationSpecials"==$state.current.name){var regions=Settings.get("nearby_resorts")||[];angular.forEach(regions,function(destination,destinationName){$filter("toSlug")(destinationName)==$stateParams.slug&&(vm.destination=destination,vm.destinationName=destinationName,vm.pageTitle="Special Offers and Deals by near "+destinationName,Places.get("RegionOffersDetails",$window.RID).then(function(response){response&&response.data&&(vm.offers=response.data.offers.filter(function(offer){var found=!1;return angular.forEach(destination.hotels,function(hotel){found||hotel.hotelCode!=offer.hotelCode||(found=!0)}),found}).map(function(offer){return offer.headerPhone=Settings.getHeaderPhone(),offer}))}),angular.forEach(destination.hotels,function(hotel){vm.hotels.push(hotel),vm.headerImage||(vm.headerImage=hotel.headerImage),vm.headerImage||(vm.headerImage=hotel.image)}),vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null))})}else if($stateParams.slug){var regions=Settings.get("nearby_resorts")||[],found=!1;angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.slug.toLowerCase()&&(found=!0,$stateParams.cityState&&$stateParams.slug&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelSpecials",{cityState:hotel.cityState,slug:hotel.slug},{reload:"hotelSpecials"})),vm.isProperty=!0,Settings.set("currentHotel",hotel),hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),vm.destination=destination,vm.destinationName=destinationName,vm.headerProperty=hotel,Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),getPropertyOffers(vm.property.id),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(vm.property=response.data.details,vm.headerImage=vm.property.offersHeaderImage?vm.property.offersHeaderImage:vm.headerImage,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)):vm.property=hotel,getPropertyOffers(vm.property.id),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}),vm.pageTitle="Offers at "+hotel.name,Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}))})}),found||$state.go("404")}else vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.bodyContent=$state.current.data.bodyContent,vm.secondaryBodyContent=$state.current.data.secondaryBodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,angular.forEach(_destinations,function(destination,destinationName){vm.destinations.push({name:destinationName,hotels:destination.hotels}),angular.forEach(destination.hotels,function(hotel){vm.hotels.push(hotel)})}),vm.selectedResort=Settings.get("selectedResort")||vm.hotels[0]&&vm.hotels[0].hotelCode,getRegionOffers()}angular.module("explorer.app").controller("OffersCtrl",["$scope","$state","$stateParams","$window","$filter","$location","$timeout","Places","Settings",OffersCtrl])}(),function(){"use strict";function PhotosCtrl($scope,$state,$stateParams,$window,$filter,$timeout,$location,$mdDialog,Person,Places,Alert,Settings){function updateDestinations(){vm.selectedHotel&&angular.forEach(vm.destinations,function(destination){angular.forEach(destination.hotels,function(hotel){hotel.hotelCode==vm.selectedHotel&&(vm.selectedDestination=destination.name)})})}function updateResorts(){vm.selectedDestination&&angular.forEach(vm.destinations,function(destination){destination.name==vm.selectedDestination&&(vm.selectedHotel=destination.hotels[0].hotelCode)})}function scrollBy(last,inview){last&&inview&&(vm.hotelsLimit+=20)}function photoPop(index,image){image.title&&(image.title=$filter("capitalize")($filter("camelCaseToHuman")(image.title)),image.title=image.title.replace("Photo Urls","")),image.index=index,$mdDialog.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"app/cards/photo-gallery.html",controller:function($scope,$filter,$mdDialog){var tmpIndex,currentImageSet=vm.useTagAsCategory&&vm.currentPhotoTag?vm.property.photos.filter(vm.photoTagFilter):vm.property.photos;$scope.image=image,$scope.totalImages=currentImageSet.length,$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image=currentImageSet[$scope.image.index-1],$scope.image.index=tmpIndex-1):($scope.image=currentImageSet[currentImageSet.length-1],$scope.image.index=currentImageSet.length-1),$scope.image.title=$filter("capitalize")($filter("camelCaseToHuman")($scope.image.title)),$scope.image.title=$scope.image.title.replace("Photo Urls","")}}})}function photoTagFilter(photo){if(photo&&photo.tags&&vm.currentPhotoTag){var tags=angular.isArray(photo.tags)?photo.tags:photo.tags.split(",");for(var i in tags)if(tags[i]==vm.currentPhotoTag)return!0;return!1}return!vm.currentPhotoTag}function viewHotel(listingId){$state.go("explore",{listingId:listingId})}var _property,vm=this,regions=Settings.get("nearby_resorts")||[],_countries=[],_states=[],_destinations=[];if(vm.user=Settings.get("user")||{},vm.query=Settings.get("query")||"",vm.viewHotel=viewHotel,vm.updateResorts=updateResorts,vm.updateDestinations=updateDestinations,vm.photoPop=photoPop,vm.photoTagFilter=photoTagFilter,vm.scrollBy=scrollBy,$stateParams.slug){var found=!1;if(angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.slug.toLowerCase()&&($stateParams.cityState&&$stateParams.slug&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelPhotos",{cityState:hotel.cityState,slug:hotel.slug},{reload:"hotelPhotos"})),found=!0,vm.isProperty=!0,vm.headerProperty=hotel,Settings.set("currentHotel",hotel),vm.destination=destination,vm.destinationName=destinationName,$scope.$broadcast("triggerResortSelect",hotel.hotelCode),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),vm.bodyContent=vm.property.photosContent,$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(_property=response.data.details,vm.useTagAsCategory="1"==response.data.details.useTagAsCategory):_property=hotel,_property.photoTags=[],_property.photos.map(function(photo){if(photo.thumb||(photo.thumb=photo.url),photo.tags){var tags=angular.isArray(photo.tags)?photo.tags:photo.tags.split(",");angular.forEach(tags,function(tag){-1==_property.photoTags.indexOf(tag)&&_property.photoTags.push(tag)})}}),vm.property=_property,Settings.set("portal_property_details_"+hotel.id,_property),Settings.set("has_portal_property_details_"+hotel.id,!0),vm.bodyContent=vm.property.photosContent,$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}),vm.pageTitle=hotel.name+" Photo Gallery",hotel.headerImage?vm.headerImage=hotel.headerImage:vm.headerImage=hotel.image,vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null))})}),!vm.isProperty){vm.hotels=[],vm.destinations=[],vm.states=[],vm.countries=[],vm.isProperty=!1,vm.headerImage=$state.current.data.headerImage,vm.destinationSlug=$stateParams.slug,vm.isDestination=!0,vm.pageTitle=$filter("properCaps")($stateParams.slug)+" Photo Gallery",vm.h1=vm.pageTitle,vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.state!=$stateParams.slug&&hotel.cityState!=$stateParams.slug||(hotel.destinationName=destinationName,hotel.destinationSlug=$filter("toSlug")(destinationName),vm.selectedDestination=destinationName,vm.hotels.push(hotel),-1==_countries.indexOf(hotel.address.addressCountry)&&(_countries.push(hotel.address.addressCountry),vm.countries.push({name:hotel.address.addressCountry,slug:hotel.address.addressCountry.toLowerCase(),count:0})),_states.indexOf(hotel.stateName)<0&&(_states.push(hotel.stateName),vm.states.push({name:hotel.stateName,country:hotel.address.addressCountry||"",slug:hotel.stateName.toLowerCase()})),_destinations.indexOf(hotel.cityState)<0&&(_destinations.push(hotel.cityState),vm.destinations.push({name:hotel.cityName+", "+hotel.stateName,slug:hotel.cityState,country:hotel.address.addressCountry,state:hotel.stateName,city:hotel.address.addressLocality,hotels:destination.hotels})))})});var breakLoop=!1;breakLoop||$window.PORTAL_DESTINATIONS.states.indexOf($stateParams.slug)>-1&&(vm.isState=!0,vm.destinationName=$filter("properCaps")($stateParams.slug),breakLoop=!0),breakLoop||$window.PORTAL_DESTINATIONS.cityStates.indexOf($stateParams.slug)>-1&&(vm.isCityState=!0,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.cityState==$stateParams.slug&&(breakLoop||(vm.destinationName=hotel.cityName+", "+hotel.stateName,breakLoop=!0))})})),found||breakLoop||vm.hotels.length||$state.go("404")}}else vm.hotels=[],vm.destinations=[],vm.states=[],vm.countries=[],vm.isProperty=!1,vm.headerImage=$state.current.data.headerImage,vm.headerImagePositionY=$state.current.data.headerImagePositionY||null,vm.featuredImage=$state.current.data.featuredImage,vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.h1=$state.current.data.h1,vm.h1=$state.current.data.h1,vm.selectedDestination="",vm.selectedState="",vm.selectedCountry="",vm.selectedResort="",vm.h2=$state.current.data.h2,angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.destinationName=destinationName,hotel.destinationSlug=$filter("toSlug")(destinationName),vm.hotels.push(hotel),-1==_countries.indexOf(hotel.address.addressCountry)&&(_countries.push(hotel.address.addressCountry),vm.countries.push({name:hotel.address.addressCountry,slug:hotel.address.addressCountry.toLowerCase(),count:0})),_states.indexOf(hotel.stateName)<0&&(_states.push(hotel.stateName),vm.states.push({name:hotel.stateName,country:hotel.address.addressCountry||"",slug:hotel.stateName.toLowerCase()})),_destinations.indexOf(hotel.cityState)<0&&(_destinations.push(hotel.cityState),vm.destinations.push({name:hotel.cityName+", "+hotel.stateName,slug:hotel.cityState,country:hotel.address.addressCountry,state:hotel.stateName,city:hotel.address.addressLocality,hotels:destination.hotels}))})}),vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),$location.search().country?($location.search().state&&($location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase()===$location.search().city.toLowerCase()+", "+$location.search().state.toLowerCase()&&(console.log(vm.selectedDestination,destination),vm.selectedDestination=destination.city)}),angular.forEach(vm.states,function(state){state.name.toLowerCase()===$location.search().state.toLowerCase()&&(vm.selectedState=state.name)})),angular.forEach(vm.countries,function(country){country.name.toLowerCase()===$location.search().country.toLowerCase()&&(vm.selectedCountry=country.name)})):$location.search().state?($location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase()===$location.search().city.toLowerCase()+", "+$location.search().state.toLowerCase()&&(vm.selectedDestination=destination.city)}),angular.forEach(vm.states,function(state){state.name.toLowerCase()===$location.search().state.toLowerCase()&&(vm.selectedState=state.name)})):$location.search().city&&angular.forEach(vm.destinations,function(destination){destination.name.toLowerCase().indexOf($location.search().city.toLowerCase())>-1&&(vm.selectedDestination=destination.city)});vm.currentIndex=0,vm.setCurrentSlideIndex=function(index){$analytics.eventTrack("webapp",{category:"page interaction",label:"View Image "+(index+1)}),vm.currentIndex=index},vm.isCurrentSlideIndex=function(index){return vm.currentIndex===index},vm.prevSlide=function(){$analytics.eventTrack("webapp",{category:"page interaction",label:"Prev Slide Image "+(vm.currentIndex+1)}),vm.currentIndex=vm.currentIndex>0?--vm.currentIndex:vm.images.length-1},vm.nextSlide=function(){$analytics.eventTrack("webapp",{category:"page interaction",label:"Next Slide Image "+(vm.currentIndex+1)}),vm.currentIndex=vm.currentIndex-1?imageSet=imageSet.split(",").map(function(image){return{url:image}}):"h"==imageSet[0]&&(imageSet=[{url:imageSet}]);else if("object"==typeof imageSet&&"string"==typeof imageSet[0]){var tmpImageSet=[];for(var i in imageSet)tmpImageSet.push({url:imageSet[i]});imageSet=tmpImageSet}$scope.totalImages=imageSet.length,"string"==typeof imageSet[0]?$scope.image={index:0,url:imageSet[0]}:$scope.image={index:0,url:imageSet[0].url,alt:imageSet[0].alt,title:imageSet[0].title},$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image={url:imageSet[$scope.image.index-1].url,alt:imageSet[$scope.image.index-1].alt,title:imageSet[$scope.image.index-1].title},$scope.image.index=tmpIndex-1):($scope.image={url:imageSet[$scope.image.index-1].url,alt:imageSet[$scope.image.index-1].alt,title:imageSet[$scope.image.index-1].title},$scope.image.index=imageSet.length-1)}}})}var vm=this,_roomBedsIndex=[];if(vm.roomBeds=[],vm.popPhotos=popPhotos,vm.currentIndex=1,Settings.get("property_details_"+$stateParams.hotel))vm.property=Settings.get("property_details_"+$stateParams.hotel),$stateParams.cityState&&$stateParams.hotel&&$stateParams.cityState!=vm.property.cityState&&$state.go("hotelRoom",{cityState:vm.property.cityState,hotel:vm.property.slug,slug:$stateParams.slug},{reload:"hotelRoom"}),vm.property.headerImage?vm.headerImage=vm.property.headerImage:vm.headerImage=vm.property.image,Settings.set("currentHotel",vm.property),$scope.$broadcast("triggerResortSelect",vm.property.hotelCode),$scope.$emit("triggerResortSelect",vm.property.hotelCode),vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null);else if($stateParams.hotel){vm.isProperty=!0;var regions=Settings.get("nearby_resorts"),found=!1;angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.hotel.toLowerCase()&&(found=!0,$stateParams.cityState&&$stateParams.hotel&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelRoom",{cityState:hotel.cityState,hotel:hotel.slug,slug:$stateParams.slug},{reload:"hotelRoom"})),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}),vm.destination=destination,vm.destinationName=destinationName,vm.headerImage=hotel.headerImage||hotel.image,vm.headerProperty=hotel,Settings.set("currentHotel",hotel),$scope.$broadcast("triggerResortSelect",hotel.hotelCode),Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),setupRooms(),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)):vm.property=hotel,setupRooms(),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}))})}),found||$state.go("404")}}angular.module("explorer.app").controller("RoomCtrl",["$scope","$state","$stateParams","$window","$filter","$timeout","$location","$http","$mdDialog","Places","Settings",RoomCtrl])}(),function(){"use strict";function RoomsCtrl($scope,$state,$stateParams,$window,$filter,$timeout,$location,$http,$mdDialog,Places,Settings){function setupRooms(){vm.property.hasOfferCatalog&&vm.property.hasOfferCatalog.itemListElement&&(angular.forEach(vm.property.hasOfferCatalog.itemListElement,function(element){"ja"==$window.DEFAULT_LANG?element.itemOffered.slug=$filter("toSlug")(element.itemOffered.name,!0):element.itemOffered.slug=$filter("toSlug")(element.itemOffered.name)}),1==$window.SHOW_LEAD_RATES&&$timeout(function(){$scope.$on("triggerUpdateBookingDates",function(ev,data){updateRates(data)})},50))}function dateRangeHasWeekend(dateRange){for(var startDate=dateRange.start,endDate=dateRange.end,start=new Date(startDate),end=new Date(endDate),currentDate=start;currentDate<=end;currentDate.setDate(currentDate.getDate()+1)){var dayOfWeek=currentDate.getDay();if(5===dayOfWeek||6===dayOfWeek)return!0}return!1}function updateRates(data){if(data&&data.roomStays&&data.roomStays[0]&&vm.property.hasOfferCatalog&&vm.property.hasOfferCatalog.itemListElement.length){dateRangeHasWeekend(data.roomStays[0].timeSpan);angular.forEach(vm.property.hasOfferCatalog.itemListElement,function(offer){var minPrice,specialRateFound=!1,lowestRate=!1,currentRate=0;angular.forEach(data.roomStays[0].allRoomTypes,function(room){offer.itemOffered.name==room.roomTypeName&&(angular.forEach(room.averageRates,function(rate){"Promotional"==rate.ratePlanCategory&&rate.available&&(currentRate=rate.rate-(rate.discount||0),(!lowestRate||lowestRate.rate-lowestRate.discount>currentRate)&&(lowestRate=rate,specialRateFound=!0))}),lowestRate?room.averageRates[0]=lowestRate:angular.forEach(room.averageRates,function(rate){specialRateFound||"Rack"!=rate.ratePlanCategory||(room.averageRates[0]=rate,specialRateFound=!0)}),offer.roomTypeId=room.roomTypeCode,offer.priceCurrency=data.currencyCode,offer.available=room.available,minPrice=room.averageRates[0].rate-room.averageRates[0].discount,offer.price=minPrice)})})}else angular.forEach(vm.property.hasOfferCatalog.itemListElement,function(offer){offer.available=!1,offer.price=!1})}function getRoomImage(image){return angular.isArray(image)?image[0]:image}function photoPop(index,image){angular.isArray(image)||(image=[image]),$mdDialog.show({parent:angular.element(document.body),clickOutsideToClose:!0,escapeToClose:!0,templateUrl:"app/cards/photo-gallery.html",controller:function($scope,$filter,$mdDialog){function getPhotoUrl(target,url,size,crop){if(url&&"string"==typeof url){if(target&&""!=target)var result=document.getElementsByClassName(target);if("auto"===(size=size||"200")&&target){return size=angular.element(result)[0].clientWidth,url.replace("=s0","=s"+size+(crop?"-c":""))}return url.replace("=s0","=s"+size+(crop?"-c":""))}}var tmpIndex;$scope.image={url:image[0]},$scope.image.url=getPhotoUrl("listing-page",$scope.image.url,800,!1),$scope.closeDialog=function(){$mdDialog.hide()},$scope.nextImage=function(){tmpIndex=$scope.image.index,$scope.image.index+1=0?($scope.image.url=image[$scope.image.index-1],$scope.image.index=tmpIndex-1):($scope.image.url=image[vm.property.photos.length-1],$scope.image.index=vm.property.photos.length-1),$scope.image.title=$filter("capitalize")($filter("camelCaseToHuman")($scope.image.title)),$scope.image.title=$scope.image.title.replace("Photo Urls",""),$scope.image.url=getPhotoUrl("listing-page",$scope.image.url,800,!1)}}})}var vm=this,regions=Settings.get("nearby_resorts")||[];if(vm.currentIndex=1,vm.photoPop=photoPop,vm.getRoomImage=getRoomImage,$stateParams.slug){vm.isProperty=!0;var found=!1;angular.forEach(regions,function(destination,destinationName){angular.forEach(destination.hotels,function(hotel){hotel.slug==$stateParams.slug.toLowerCase()&&(found=!0,$stateParams.cityState&&$stateParams.slug&&$stateParams.cityState!=hotel.cityState&&(Object.keys($location.search()).length>0&&Settings.set("locationSearchUrlParams",$location.search()),$state.go("hotelRooms",{cityState:hotel.cityState,slug:hotel.slug},{reload:"hotelRooms"})),Settings.set("currentHotel",hotel),vm.headerProperty=hotel,vm.headerImage=hotel.headerImage||hotel.image,vm.headerImage?Settings.setHeaderImage(vm.headerImage):Settings.setHeaderImage(null),vm.destination=destination,vm.destinationName=destinationName,vm.pageTitle=hotel.name+" Rooms at "+hotel.name,$scope.$broadcast("triggerResortSelect",hotel.hotelCode),Settings.get("has_portal_property_details_"+hotel.id)?(vm.property=Settings.get("portal_property_details_"+hotel.id),setupRooms(),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)):Places.get("PortalPropertyDetails",hotel.id).then(function(response){"ok"==response.data.status&&response.data.details.id?(vm.property=response.data.details,Settings.set("portal_property_details_"+hotel.id,response.data.details),Settings.set("has_portal_property_details_"+hotel.id,!0)):vm.property=hotel,setupRooms(),$timeout(function(){$scope.$broadcast("triggerResortSelect",hotel.hotelCode),$scope.$emit("triggerResortSelect",hotel.hotelCode)},500)}),Places.get("PortalPropertyNoticesData",hotel.id).then(function(response){"ok"==response.data.status&&(vm.priorityNotices=response.data.content.priorityNotices,vm.notices=response.data.content.notices,vm.hints=response.data.content.hints)}))})}),found||$state.go("404")}vm.currentIndex=0,vm.setCurrentSlideIndex=function(index){$analytics.eventTrack("webapp",{category:"page interaction",label:"View Room Image "+(index+1)}),vm.currentIndex=index},vm.isCurrentSlideIndex=function(index){return vm.currentIndex===index},vm.prevSlide=function(){$analytics.eventTrack("webapp",{category:"page interaction",label:"Prev Room Image "+(vm.currentIndex-1)}),vm.currentIndex=vm.currentIndex>0?--vm.currentIndex:vm.images.length-1},vm.nextSlide=function(){$analytics.eventTrack("webapp",{category:"page interaction",label:"Next Room Image "+(vm.currentIndex+1)}),vm.currentIndex=vm.currentIndex","load-external-script>"),vm.story=page,vm.currentUrl=$window.location.href,$timeout(function(){vm.hasHubspotForm&&document.querySelector("[id='hubspot-form']")&&loadHubspotScript()},10)):$state.go("stories")}var page,vm=this,found=!1;vm.siteName=$window.APP_CLIENT,vm.parent=$stateParams.parent,Stories.get("StoryDetailsBySlug",$stateParams.slug).then(function(response){if("ok"==response.data.status)page=response.data.story,setupPage();else try{if($stateParams.parent)return void $location.path("/"+$stateParams.parent);$state.go("stories")}catch(e){console.log(e)}}),Settings.get("propertySiteStoryCategories")?vm.categories=Settings.get("propertySiteStoryCategories"):Stories.get("PropertySiteStories").then(function(response){"ok"==response.data.status&&(vm.categories=response.data.categories,Settings.set("propertySiteStories",response.data.stories),Settings.set("propertySiteStoryCategories",response.data.categories),Settings.set("hasPropertySiteStories",!0))})}angular.module("explorer.app").controller("StoryCtrl",["$scope","$state","$stateParams","$window","$location","$timeout","Stories","Settings","Alert",StoryCtrl])}(),function(){"use strict";function SearchCtrl($scope,$state,$stateParams,$location,$localStorage,$mdDialog,$window,$filter,$timeout,$http,$analytics,$q,Places,Destinations,Alert,Settings,leafletData,appConfig){function getVirtualPagedResults(){var result=vm.pagedResults?$filter("limitTo")($filter("orderBy")(vm.pagedResults.filter(function(item){if(vm.selectedItem&&vm.selectedItem.latlng&&item.distance>=100)return!1;if(vm.searchFilters.tripType&&vm.searchFilters.tripType.length){var pass=!1;if(angular.forEach(vm.searchFilters.tripType,function(searchType){angular.forEach(tripTypes[searchType],function(tripType){angular.forEach(item.amenityFeature,function(amenity){("ski"!=tripType&&amenity.name.toLowerCase().indexOf(tripType)>-1||"ski"==tripType&&amenity.name.toLowerCase().indexOf(tripType)>-1&&-1==amenity.name.toLowerCase().indexOf("waterskiing")&&-1==amenity.name.toLowerCase().indexOf("cross-country skiing"))&&(pass=!0)})})}),!pass)return!1}return(!vm.searchFilters.destination||"All Destinations"==vm.searchFilters.destination||(item.destinationId==vm.searchFilters.destination||!!item.destinationIds&&item.destinationIds.indexOf(vm.searchFilters.destination)>-1))&&(!vm.searchFilters.brand||!vm.searchFilters.brand.length||vm.searchFilters.brand.indexOf(item.brand)>-1)&&(!vm.showOnlyAvailableProperties||item.available)&&(!(parseInt(vm.searchFilters.price)>0)||!!item.price&&parseInt(vm.searchFilters.price)>=parseInt(item.price||0))&&(!(parseInt(vm.searchFilters.distance)>0)||!!item.distance&&parseInt(vm.searchFilters.distance)>=parseInt(item.distance||0))}),vm.searchFilters.ordering),vm.searchFilters.ordering.indexOf("price")>-1?96:vm.searchLimit):[];return $filter("orderBy")(result,vm.firstLoad?"name":"!available")}function updatePromoCode(){$window.PROMOID=vm.promoCode,$scope.$broadcast("updatePromoCode",vm.promoCode),$scope.$broadcast("triggerUpdateBookingDates")}function priceFilter(){return function(hotel){return!(parseInt(vm.searchFilters.price)>0)||!!hotel.price&&parseInt(vm.searchFilters.price)>=parseInt(hotel.price||0)}}function distanceFilter(){return function(hotel){return!(parseInt(vm.searchFilters.distance)>0)||!!hotel.distance&&parseInt(vm.searchFilters.distance)>=parseInt(hotel.distance||0)}}function isDisabledDate(d){return d=72?0:9,vm.virtualPagedResults=getVirtualPagedResults()),vm.isLoading=!1,loadingTimer=null},2500)}function filterByBrands(hotel){return!vm.searchFilters.brand||""==vm.searchFilters.brand||0==hotel.name.indexOf(vm.searchFilters.brand)}function filterByTripTypes(hotel){return!vm.searchFilters.tripType||""==vm.searchFilters.tripType||0==hotel.name.indexOf(vm.searchFilters.tripType)}function orderByFeatureCount(amenity){return vm.amenityFeatureSetCounts[amenity.name]}function updateTextSearchResults(){if(vm.predictionResults=[],!vm.searchWords.length)return vm.predictionResults;if($window.dataLayer.push({event:"areaSearch.searchQueryUpdate",eventCategory:"Area Search",eventLabel:vm.searchWords.trim()}),Settings.get("destinationsTree")&&(vm.predictionResults=vm.predictionResults.concat(Settings.get("destinationsTree").filter(function(destination){return"15218"!=destination.parentId&&destination.name.toLowerCase().indexOf(vm.searchWords.trim().toLowerCase())>-1}))),vm.predictionResults.length)vm.predictionResults=vm.predictionResults.concat(vm.allHotels.filter(function(hotel){return hotel.value.indexOf(vm.searchWords.trim().toLowerCase())>-1}));else{!elasticSearch&&window.elasticlunr&&(elasticSearch=elasticlunr(function(){this.addField("name"),this.addField("value"),this.setRef("id")}),Settings.get("destinationsTree").map(function(destination){destination.id=destination.destinationId,destination.value=destination.tree.toString(),"15218"!=destination.parentId&&elasticSearch.addDoc(destination)}),vm.allHotels.map(function(hotel){elasticSearch.addDoc(hotel)}));var elasticSearchResults=elasticSearch.search(vm.searchWords.trim(),{fields:{name:{boost:2},value:{boost:1}},expand:!0});vm.predictionResults=elasticSearchResults.map(function(result){return result.doc})}return vm.predictionResults}function updateSearchResults(options,filterChange){options=options||vm.selectedItem,vm.searchWords.length&&!options&&(options=updateTextSearchResults(),options.length&&(options=options[0],vm.selectedItem=options)),filterChange=filterChange||!1,timer&&$timeout.cancel(timer),vm.pagedResults=[],vm.virtualPagedResults=[],vm.isLoading=!0,vm.allHotels=vm.allHotels.map(function(hotel){return delete hotel.distance,hotel}),timer=$timeout(function(){!options&&filterChange||(vm.searchLimit=vm.searchLimit<=9?9:18),vm.firstLoad&&vm.selectedItem?vm.firstLoad=!1:vm.firstLoad=!0,vm.pagedResults=options?options.latlng?geoFilteredResults(options,filterChange):filteredResults(options):vm.allHotels,vm.virtualPagedResults=getVirtualPagedResults(),$scope.$broadcast("triggerUpdateSearchFilters"),vm.currentMarker&&(vm.currentMarker=null),vm.isLoading=!1},10),$timeout(function(){vm.setupFilters||($scope.$watch("vm.searchFilters['ordering']",function(newVal,oldVal){oldVal!=newVal&&(updateSearchResults(null,!0),$window.dataLayer.push({event:"areaSearch.sortOrderUpdate",eventCategory:"Area Search",eventLabel:newVal.toString()}))}),$scope.$watch("vm.searchFilters['brand']",function(newVal,oldVal){oldVal!=newVal&&(updateSearchResults(),$window.dataLayer.push({event:"areaSearch.brandFilterUpdate",eventCategory:"Area Search",eventLabel:newVal.toString()}))}),$scope.$watch("vm.searchFilters['tripType']",function(newVal,oldVal){oldVal!=newVal&&(updateSearchResults(),$window.dataLayer.push({event:"areaSearch.tripTypeFilterUpdate",eventCategory:"Area Search",eventLabel:newVal.toString()}))}),vm.setupFilters=!0),vm.virtualPagedResults=getVirtualPagedResults(),vm.searchFilters.ordering.indexOf("price")>-1&&(vm.virtualPagedResults=vm.virtualPagedResults.length==vm.virtualPagedResults.filter(function(result){return!result.available}).length?[]:vm.virtualPagedResults)},2e3)}function geoFilteredResults(options,filterChange){return angular.forEach(vm.allHotels,function(hotel){var lat1=hotel.geo.latitude,lon1=hotel.geo.longitude,lat2=options.latlng.lat,lon2=options.latlng.lng;if(lat1==lat2&&lon1==lon2)hotel.distance=0;else{var radlat1=Math.PI*lat1/180,radlat2=Math.PI*lat2/180,theta=lon1-lon2,radtheta=Math.PI*theta/180,dist=Math.sin(radlat1)*Math.sin(radlat2)+Math.cos(radlat1)*Math.cos(radlat2)*Math.cos(radtheta);dist>1&&(dist=1),dist=Math.acos(dist),dist=180*dist/Math.PI,dist=60*dist*1.1515,dist*=.8684,hotel.distance=dist}}),vm.allHotels}function filteredResults(options){if(options.hotelCode)return vm.allHotels.filter(function(hotel){return hotel.id==options.id});if(options.destinationId){var results=[],usedHotels=[];return angular.forEach(destinationProperties,function(destinationProperty){-1==usedHotels.indexOf(destinationProperty.pid)&&(destinationProperty.destinationId==options.destinationId||destinationProperty.destinationIds&&destinationProperty.destinationIds.indexOf(options.destinationId)>-1)&&angular.forEach(vm.allHotels,function(hotel){hotel.id==destinationProperty.pid&&(hotel.ordering=destinationProperty.ordering,results.push(hotel),usedHotels.push(hotel.id))})}),results.length?"distance"==vm.searchFilters.ordering?vm.searchFilters.ordering="recommended":"ordering"!=vm.searchFilters.ordering||vm.searchFilters.ordering:("recommended"!=vm.searchFilters.ordering||vm.searchFilters.ordering,angular.forEach(destinationProperties,function(destinationProperty){-1==usedHotels.indexOf(destinationProperty.pid)&&destinationProperty.tree.indexOf(options.tree[options.tree.length-1])>-1&&angular.forEach(vm.allHotels,function(hotel){hotel.id==destinationProperty.pid&&(hotel.ordering=destinationProperty.ordering,results.push(hotel),usedHotels.push(hotel.id))})})),results}}function resetFilters(type,skip){vm.searchWords="",vm.searchFilters={},vm.updateSearchResults()}$window.dataLayer=$window.dataLayer||[];var timer,loadingTimer,prevDiff,vm=this,_allHotels=[],_orderedHotels=[],_amenityFeatureSet=[],_amenityTotalCounts=[],_allRegions=[],today=new Date,yesterday=new Date,_regions={},destinationProperties=[],elasticSearch=null,tripTypes={Beaches:["beach"],Golfing:["golf","putt"],Family:["child","playground","picnic","pool","bbq","game","restaurant","bowling","wedding","kid","activities","river","mall"],Fun:["fish","lake","hot","night","tennis","basketball","volleyball","horse","hiking","bar","heli","plane","dance","cook","tub","massage","mall"],Ski:["ski"]};yesterday.setDate(today.getDate()-1),vm.centerLat?vm.mapCenter={lat:parseFloat(vm.centerLat),lng:parseFloat(vm.centerLng),focus:!0,draggable:!0,zoom:5}:appConfig.mapCenter&&(vm.mapCenter=appConfig.mapCenter),vm.defaultOrdering="brand",vm.orderByBrand=["Club Wyndham","WorldMark","Margaritaville Vacation Club","Shell","RCI","APAC"],Settings.set("checkinDate",moment().diff(moment($localStorage.checkinDate))>0?moment().add(2,"days"):$localStorage.checkinDate),Settings.set("checkoutDate",moment().diff(moment($localStorage.checkoutDate))>0?moment().add(4,"days"):$localStorage.checkoutDate),vm.headerImage=$state.current.data.headerImage,vm.mapMarkerIcon=$window.APP_CONFIG.core.themes?$window.APP_CONFIG.core.themes.mapMarkerIcon:null,vm.bodyContent=$state.current.data.bodyContent,vm.pageTitle=$state.current.data.pageTitle,vm.h1=$state.current.data.h1,vm.hideH1=$state.current.data.hideH1,vm.h2=$state.current.data.h2,vm.hideH2=$state.current.data.hideH2,vm.sidebarPromo=$state.current.data.sidebarPromo,vm.mapConfig={searchMode:"list",center:{lat:39.707186,lng:-101.351624},zoom:6},vm.searchFilters={ordering:"recommended"},vm.categories=[],vm.regions={},vm.updateSearchResults=updateSearchResults,vm.updateTextSearchResults=updateTextSearchResults,vm.updatePromoCode=updatePromoCode,vm.orderByFeatureCount=orderByFeatureCount,vm.filterByBrands=filterByBrands,vm.filterByTripTypes=filterByTripTypes,vm.resetFilters=resetFilters,vm.searchLimit=9,vm.scrollByProperties=scrollByProperties,vm.currentWindow={height:$window.innerHeight,width:$window.innerWidth},vm.isDisabledDate=isDisabledDate,vm.priceFilter=priceFilter,vm.distanceFilter=distanceFilter,vm.isLoading=!1,vm.firstLoad=!0;if(Settings.get("has_nearby_resorts")){_regions=Settings.get("nearby_resorts"),destinationProperties=Settings.get("destinationProperties"),vm.destinations=Settings.get("destinationsTree"),vm.amenityFeatureSet=[],vm.dataLoaded=!1,angular.forEach(_regions,function(region,regionName){var currentHotels=[];angular.forEach(region.hotels,function(hotel){currentHotels.push(hotel.id),hotel.geo&&hotel.geo.latitude&&hotel.geo.longitude&&(hotel.imageIndex=0,hotel.address?hotel.value=hotel.name.toLowerCase()+" "+(hotel.address.streetAddress?hotel.address.streetAddress.toLowerCase():"")+" "+(hotel.address.addressLocality?hotel.address.addressLocality.toLowerCase():"")+" "+(hotel.address.addressRegion?hotel.address.addressRegion.toLowerCase():"")+" "+(hotel.stateName?hotel.stateName.toLowerCase():"")+" "+(hotel.cityName?hotel.cityName.toLowerCase():"")+" "+(hotel.address.addressCountry?hotel.address.addressCountry.toLowerCase():"")+" "+hotel.telephone+" "+hotel.address.postalCode:hote.value=hotel.name.toLowerCase(),hotel.additionalProperty&&angular.forEach(hotel.additionalProperty,function(property){switch(property.name){case"Additional Locations":hotel.value+=" "+property.value.toLowerCase()}}),angular.forEach(destinationProperties,function(property){property.pid==hotel.id&&(hotel.destinationId=property.destinationId,hotel.destinationIds=hotel.destinationIds||[],hotel.destinationIds.push(property.destinationId))}),hotel.alternateName&&(hotel.value+=" "+hotel.alternateName.join(" ")),hotel.value=hotel.value.replace(/[^a-zA-Z0-9- ]/g,"").toLowerCase(),hotel.amenityFeature&&hotel.amenityFeature.length&&angular.forEach(hotel.amenityFeature,function(feature){hotel.value+=" "+feature.value.toLowerCase(),-1==_amenityFeatureSet.indexOf(feature.name)?(_amenityFeatureSet.push(feature.name),_amenityTotalCounts[feature.name]=1,vm.amenityFeatureSet.push(feature)):_amenityTotalCounts[feature.name]=_amenityTotalCounts[feature.name]+1}),_allHotels.push(hotel))}),_allRegions[regionName]={hotels:currentHotels}}),vm.amenityFeatureSet=_amenityFeatureSet,vm.amenityFeatureSetCounts=_amenityTotalCounts,vm.dataLoaded=!0,_allHotels=$filter("orderBy")(_allHotels,"name");var usedHotels=[];"brand"==vm.defaultOrdering&&(angular.forEach(vm.orderByBrand,function(brand){angular.forEach(_allHotels,function(hotel){-1==usedHotels.indexOf(hotel.id)&&hotel.brand==brand&&(usedHotels.push(hotel.id),hotel.recommended=usedHotels.length,_orderedHotels.push(hotel))})}),angular.forEach(_allHotels,function(hotel){-1==usedHotels.indexOf(hotel.id)&&(usedHotels.push(hotel.id),hotel.recommended=usedHotels.length,_orderedHotels.push(hotel))}),_allHotels=_orderedHotels),vm.regions=_regions,vm.allHotels=_allHotels}$timeout(function(){if(vm.checkinDate=new Date(Settings.get("checkinDate")?moment(Settings.get("checkinDate")):moment().add(2,"days")),vm.checkoutDate=new Date(Settings.get("checkoutDate")?moment(Settings.get("checkoutDate")):moment().add(4,"days")),$scope.$watch("vm.checkinDate",function(oldDate,newDate){moment(vm.checkinDate).diff(moment(vm.checkoutDate))>=-86400001?prevDiff=moment(vm.checkinDate).diff(moment(vm.checkoutDate)):$scope.$broadcast("triggerUpdateBookingDates"),Settings.set("checkinDate",vm.checkinDate),$localStorage.checkinDate=vm.checkinDate}),$scope.$watch("vm.checkoutDate",function(oldDate,newDate){Settings.set("checkoutDate",vm.checkoutDate),$localStorage.checkoutDate=vm.checkoutDate,moment(vm.checkinDate).diff(moment(vm.checkoutDate))!=prevDiff&&(vm.showDatePicker=!1,$scope.$broadcast("triggerUpdateBookingDates"),$window.dataLayer.push({event:"areaSearch.dateSelectionUpdate",eventCategory:"Area Search",eventLabel:moment(Settings.get("checkinDate")).format("YYYY-MM-DD")+" - "+moment(Settings.get("checkoutDate")).format("YYYY-MM-DD")}))}),$scope.$on("triggerRatesLookupComplete",function(){vm.virtualPagedResults=getVirtualPagedResults()}),vm.promoCode=$window.PROMOID||null,vm.searchWords=$location.search().q||"",vm.searchWords)updateTextSearchResults(),vm.predictionResults.length?updateSearchResults():(vm.isLoading=!0,$http.get(encodeURI("/prediction/v1/search?q="+vm.searchWords.toLowerCase())).then(function(response){if(response.data&&response.data.results&&response.data.results.length){var result=response.data.results[0];result.latlng={lat:result.place.geometry.coordinates[1],lng:result.place.geometry.coordinates[0]},updateSearchResults(result)}else updateSearchResults()},function(error){console.log(error),updateSearchResults()}));else{if($location.search().destinationId){var searchDestination=vm.destinations.filter(function(destination){return destination.destinationId==$location.search().destinationId});searchDestination.length&&(vm.selectedItem=searchDestination[0],Settings.setMetaTitle(Settings.getMetaTitle().replace("Search Resorts",vm.selectedItem.city+", "+vm.selectedItem.state+" Resorts")))}updateSearchResults()}},100)}angular.module("explorer.app").controller("SearchCtrl",["$scope","$state","$stateParams","$location","$localStorage","$mdDialog","$window","$filter","$timeout","$http","$analytics","$q","Places","Destinations","Alert","Settings","leafletData","appConfig",SearchCtrl])}(),function(){"use strict";angular.module("explorer.config",["ui.router"]).config(function($sceDelegateProvider,$locationProvider,$logProvider,$urlRouterProvider,$mdThemingProvider,$mdIconProvider,$analyticsProvider){function setupGA(available){try{ga(function(){var trackers=ga.getAll(),usedTrackingIds=[];trackers.map(function(tracker){-1==usedTrackingIds.indexOf(tracker.get("trackingId"))&&(usedTrackingIds.push(tracker.get("trackingId")),$analyticsProvider.settings.ga.additionalAccountNames.push(tracker.get("name")),window.trackerName=tracker.get("name"))})})}catch(e){available&&setTimeout(function(){setupGA(!1)},200)}}$sceDelegateProvider.resourceUrlWhitelist(["self","https://storage.googleapis.com/**","http://www.cfmedia.vfmleonardo.com/**","https://wyndham-extra-holidays.leonardocontentcloud.com/**","https://reservations.travelclick.com/**","https://api.trustyou.com/**","http://**.keen.io/**","http://**.triptease.io/**","https://**.keen.io/**","https://**.triptease.io/**","https://googleads.g.doubleclick.net/**","https://www.facebook.com/**","https://player.vimeo.com/**","https://*.*.doubleclick.net/**","https://api.stathat.com/**","https://www.googletagmanager.com/**","https://www.opentable.com/**","https://**.getchute.com/**","https://**.amazonaws.com/**","https://www.youtube.com/**"]), $mdIconProvider.icon("w","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/wyndham-w-logo.svg",24).icon("home","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_home_24px.svg",24).icon("hotel","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_location_city_24px.svg",24).icon("trip","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_language_24px.svg",24).icon("stay","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_hotel_24px.svg",24).icon("camera","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_photo_camera_24px.svg",24).icon("key","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_vpn_key_24px.svg",24).icon("deals","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_local_play_24px.svg",24).icon("specials","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_local_offer_24px.svg",24).icon("reviews","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_rate_review_24px.svg",24).icon("search","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_search_24px.svg",24).icon("message","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_message_24px.svg",24).icon("checkin","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_person_pin_24px.svg",24).icon("checkout","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_assistant_24px.svg",24).icon("plus","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_add_circle_outline_24px.svg",24).icon("info","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_info_24px.svg",24).icon("privacy","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_lock_24px.svg",24).icon("terms","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_description_24px.svg",24).icon("external","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_launch_24px.svg",24).icon("label","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_label_24px.svg",24).icon("heart","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_favorite_24px.svg",24).icon("emptyheart","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_favorite_border_24px.svg",24).icon("star","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_star_24px.svg",24).icon("gstar","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/g-star.svg",24).icon("gstarhalf","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/g-star-half.svg",24).icon("gstarempty","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/g-star-outline.svg",24).icon("person","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_person_24px.svg",24).icon("people","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_group_24px.svg",24).icon("id","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_perm_device_information_24px.svg",24).icon("personadd","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_person_add_24px.svg",24).icon("accountround","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_account_circle_24px.svg",24).icon("accountsquare","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_account_box_24px.svg",24).icon("website","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_web_24px.svg",24).icon("mail","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_email_24px.svg",24).icon("gender","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_wc_24px.svg",24).icon("occupation","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_accessibility_24px.svg",24).icon("jobtitle","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_airline_seat_recline_normal_24px.svg",24).icon("google","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/google.svg",24).icon("googleplus","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/google-plus.svg",24).icon("work","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_business_24px.svg",24).icon("ribbon","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_ribbon_24px.svg",24).icon("check","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_check_24px.svg",24).icon("checkcircle","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_check_circle_24px.svg",24).icon("create","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_create_24px.svg",24).icon("location","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_location_on_24px.svg",24).icon("map","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_map_24px.svg",24).icon("dashboard","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_dashboard_24px.svg",24).icon("people","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_people_24px.svg",24).icon("reports","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_assignment_turned_in_24px.svg",24).icon("subject","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_textsms_24px.svg",24).icon("menu","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_menu_24px.svg",24).icon("share","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/share.svg",24).icon("google_plus","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/google_plus.svg",512).icon("hangouts","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/hangouts.svg",512).icon("twitter","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/twitter.svg",512).icon("previous","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_navigate_before_24px.svg",24).icon("next","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_navigate_next_24px.svg",24).icon("skipfirst","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_skip_previous_24px.svg",24).icon("skiplast","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_skip_next_24px.svg",24).icon("uparrow","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_arrow_drop_down_24px.svg",24).icon("downarrow","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_arrow_drop_up_24px.svg",24).icon("downwardarrow","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_arrow_downward_24px.svg",24).icon("upwardarrow","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_arrow_upward_24px.svg",24).icon("leftwardarrow","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_arrow_back_24px.svg",24).icon("rightwardarrow","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_arrow_forward_24px.svg",24).icon("downchevron","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_keyboard_arrow_down_24px.svg",24).icon("upchevron","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_keyboard_arrow_up_24px.svg",24).icon("rightchevron","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_chevron_right_24px.svg",24).icon("settings","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_settings_24px.svg",24).icon("moresettings","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_more_vert_24px.svg",24).icon("time","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_access_time_24px.svg",24).icon("timer","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_timelapse_24px.svg",24).icon("open","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_open_in_browser_24px.svg",24).icon("delete","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_delete_24px.svg",24).icon("mailopen","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_drafts_24px.svg",24).icon("close","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_close_24px.svg",24).icon("cancel","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_cancel_24px.svg",24).icon("no","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_do_not_disturb_24px.svg",24).icon("explore","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_explore_24px.svg",24).icon("undo","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_undo_24px.svg",24).icon("redo","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_redo_24px.svg",24).icon("remove","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_remove_circle_24px.svg",24).icon("address","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_location_on_24px.svg",24).icon("phone","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_phone_24px.svg",24).icon("phonegroup","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_settings_phone_24px.svg",24).icon("room","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_hotel_24px.svg",24).icon("tag","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_local_offer_24px.svg",24).icon("child","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_face_24px.svg",24).icon("infant","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_tag_faces_24px.svg",24).icon("date","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_event_24px.svg",24).icon("datecheck","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_event_available_24px.svg",24).icon("datex","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_event_busy_24px.svg",24).icon("dateline","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_event_note_24px.svg",24).icon("directions","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_directions_24px.svg",24).icon("personfolder","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_folder_shared_24px.svg",24).icon("specialfolder","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_folder_shared_24px.svg",24).icon("web","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_web_24px.svg",24).icon("creditcard","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_credit_card_24px.svg",24).icon("noteadd","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_folder_special_24px.svg",24).icon("book","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_book_24px.svg",24).icon("money","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_attach_money_24px.svg",24).icon("earth","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_earth_24px.svg",24).icon("wallet","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_account_balance_wallet_24px.svg",24).icon("cta","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_perm_phone_msg_24px.svg",24).icon("spa","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_spa_24px.svg",24).icon("golf","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_golf_course_24px.svg",24).icon("gym","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_fitness_center_24px.svg",24).icon("beach","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_beach_access_24px.svg",24).icon("bizcenter","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_business_center_24px.svg",24).icon("hottub","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_hot_tub_24px.svg",24).icon("service","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_room_service_24px.svg",24).icon("help","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_help_24px.svg",24).icon("logout","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_power_settings_new_24px.svg",24).icon("wifi","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_wifi_24px.svg",24).icon("pool","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/swim.svg",24).icon("rss","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_rss_feed_24px.svg",24).icon("stories","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/ic_import_contacts_24px.svg",24).icon("soctripadvisor","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_tripadvisor_24.svg",24).icon("soctwitter","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_twitter_24.svg?v2",24).icon("socyoutube","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_youtube_24.svg",24).icon("socfacebook","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_facebook_24.svg",24).icon("socfoursquare","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_foursquare_24.svg",24).icon("socgoogle","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_google_24.svg",24).icon("socinstagram","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_instagram_24.svg",24).icon("socyelp","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_yelp_24.svg",24).icon("socpinterest","https://storage.googleapis.com/brewer-vacations-frontend.appspot.com/content/img/icons/social_pinterest_24.svg",24);var brandOrangeMap=$mdThemingProvider.extendPalette("pink",{A100:"DE2B52",A200:"DE2B52",A400:"DE2B52",A700:"DE2B52",contrastDefaultColor:"light",contrastDarkColors:["A100"],contrastLightColors:void 0}),brandBlueMap=$mdThemingProvider.extendPalette("teal",{300:"30beb4",500:"30beb4",800:"00828d",A100:"3bbeb4"});$mdThemingProvider.definePalette("brandOrange",brandOrangeMap),$mdThemingProvider.definePalette("brandBlue",brandBlueMap),$mdThemingProvider.theme("default").primaryPalette("brandBlue").accentPalette("brandOrange"),$mdThemingProvider.theme("contrast","default").primaryPalette("brandBlue"),"wave.webaim.org"!==window.location.hostname&&$locationProvider.html5Mode(!0),$logProvider.debugEnabled(!1),$analyticsProvider.virtualPageviews(!1),$analyticsProvider.settings.ga.additionalAccountNames=[],setTimeout(function(){setupGA(!0)},window.ga?100:200),$analyticsProvider.virtualPageviews(!1)})}(),angular.module("brewervacations-app").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("app/cards/booking-bar-dialog.html",'

Reserve Now

{{dialogCheckinDate | date : \'d\'}}
{{dialogCheckinDate | date : \'MMM yyyy\'}}
{{dialogCheckinDate | date : \'EEEE\'}}
{{dialogCheckoutDate | date : \'d\'}}
{{dialogCheckoutDate | date : \'MMM yyyy\'}}
{{dialogCheckoutDate | date : \'EEEE\'}}
12345678
01234567
'),$templateCache.put("app/cards/booking-bar.html",'
Reservations: {{phoneReservations}}
Reservations: {{phoneReservations}}
{{checkinDate | date : \'d\'}}
{{checkinDate | date : \'MMM yyyy\'}}
{{checkinDate | date : \'EEEE\'}}
{{checkoutDate | date : \'d\'}}
{{checkoutDate | date : \'MMM yyyy\'}}
{{checkoutDate | date : \'EEEE\'}}
12345678
01234567
1234
From
{{(!priceCurrency || priceCurrency == \'USD\') ? \'$\' : \'\'}}{{leadRate | number:0}}
{{priceCurrency || \'USD\'}}/Night
From {{(!priceCurrency || priceCurrency == \'USD\') ? \'$\' : \'\'}}{{leadRate | number:0}} {{priceCurrency || \'USD\'}}/Night
Check Rates
'),$templateCache.put("app/cards/cobalt-footer.html",'
{{clientBrand || clientName}} © {{currentYear}}
'), $templateCache.put("app/cards/eh-booking-bar.html",'
Destination
All{{destination.name}}
Destination
{{selectedDestinationName || \'Search Destinations\'}}
Resort
Check In
{{checkinDate | date : "EEE\',\' M/d/yy"}}
Check Out
{{checkoutDate | date : "EEE\',\' M/d/yy"}}
Promo
Check Rates
'),$templateCache.put("app/cards/eh-breadcrumb.html",''),$templateCache.put("app/cards/eh-campaign-footer.html",''),$templateCache.put("app/cards/eh-category-offer-card.html",'
Click to Explore {{vm.isProperty ? \'Offer\' : \'Resort\'}}{{offer.price}}{{offer.title || offer.hotelName}} {{offer.price}} {{offer.title}}
View Photos{{offer.price}}
View Photos

{{offer.title}}{{property.name}}

{{offer.hotelCityStateText}} | Resort Overview

Available at Multiple Resorts

{{offer.categoryName}}

View ResortOffer Details
{{offer.cta_label || \'Check Rates\'}}View Offer Resorts
'),$templateCache.put("app/cards/eh-default-rfp.html",'

Plan Your Event in Extraordinary Destinations

Submit Request for Proposal

This is required.
This is required.
This is required.
This is required.
{{hotel.name}} - {{hotel.address.addressLocality}}, {{hotel.address.addressRegion}}

Flexible Dates:YesNo

Will you need meeting space?YesNo

Will you need food & beverage ?YesNo

Room Set Up?

{{type.name}}
Send Request
"), $templateCache.put("app/cards/eh-footer.html",''),$templateCache.put("app/cards/eh-hotel-hero-photos.html",'
{{::property.name}}

, ,

  ({{::property.aggregateRating.ratingCount}})  
• {{property.priceRange ? property.priceRange : \'\'}}
'),$templateCache.put("app/cards/eh-hotel-nav.html",""),$templateCache.put("app/cards/eh-resort-card.html",'
{{property.name}}

, ,
{{property.aggregateRating.ratingValue}}     ({{property.aggregateRating.ratingCount}})   • {{property.priceRange ? property.priceRange : \'~$$$\'}}

{{amenity.name}}

'),$templateCache.put("app/cards/eh-survey-dialog.html",'
Please take this brief survey to help us better serve you in the future.
Take the surveyNo Thanks
'), $templateCache.put("app/cards/eh-sweeps-rfp.html",'

Enter your info below for a chance to win!

This is required.
This is required.
This is required.
This is required.
This is required.
This is required.
Please SelectAfghanistanAlbaniaAlgeriaAmerican SamoaAndorraAngolaAnguillaAntarcticaAntigua and BarbudaArgentinaArmeniaArubaAustraliaAustriaAzerbaijanBahamasBahrainBangladeshBarbadosBelarusBelgiumBelizeBeninBermudaBhutanBoliviaBosnia and HerzegovinaBotswanaBouvet IslandBrazilBritish Indian Ocean TerritoryBrunei DarussalamBulgariaBurkina FasoBurundiCambodiaCameroonCanadaCape VerdeCayman IslandsCentral African RepublicChadChileChinaChristmas IslandCocos (Keeling) IslandsColombiaComorosCongoCook IslandsCosta RicaCroatia (Hrvatska)CubaCyprusCzech RepublicCzechoslovakia (former)DenmarkDjiboutiDominicaDominican RepublicEast TimorEcuadorEgyptEl SalvadorEquatorial GuineaEritreaEstoniaEthiopiaFalkland Islands (Malvinas)Faroe IslandsFijiFinlandFranceFrench GuianaFrench PolynesiaFrench Southern TerritoriesGabonGambiaGeorgiaGermanyGhanaGibraltarGreeceGreenlandGrenadaGuadeloupeGuamGuatemalaGuineaGuinea-BissauGuyanaHaitiHeard and McDonald IslandsHondurasHong KongHungaryIcelandIndiaIndonesiaIranIraqIrelandIsraelItalyJamaicaJapanJordanKazakhstanKenyaKiribatiKorea (North)Korea (South)KuwaitKyrgyzstanLaosLatviaLebanonLesothoLiberiaLibyaLiechtensteinLithuaniaLuxembourgMacauMacedoniaMadagascarMalawiMalaysiaMaldivesMaliMaltaMarshall IslandsMartiniqueMauritaniaMauritiusMayotteMexicoMicronesiaMoldovaMonacoMongoliaMontserratMoroccoMozambiqueMyanmarNamibiaNauruNepalNetherlandsNetherlands AntillesNeutral ZoneNew CaledoniaNew ZealandNicaraguaNigerNigeriaNiueNorfolk IslandNorthern Mariana IslandsNorwayOmanOtherPakistanPalauPanamaPapua New GuineaParaguayPeruPhilippinesPitcairnPolandPortugalPuerto RicoQatarReunionRomaniaRussian FederationRwandaSaint Kitts and NevisSaint LuciaSaint Vincent and the GrenadinSamoaSan MarinoSao Tome and PrincipeSaudi ArabiaSenegalSeychellesSierra LeoneSingaporeSlovak RepublicSloveniaSolomon IslandsSomaliaSouth AfricaSouth Georgia and South SandwiSpainSri LankaSt. HelenaSt. Pierre and MiquelonSudanSurinameSvalbard and Jan Mayen IslandsSwazilandSwedenSwitzerlandSyriaTaiwanTajikistanTanzaniaThailandTogoTokelauTongaTrinidad and TobagoTunisiaTurkeyTurkmenistanTurks and Caicos IslandsTuvaluUgandaUkraineUnited Arab EmirateUnited KingdomUnited StatesUruguayUS Minor Outlying IslandsUSSR (former)UzbekistanVanuatuVatican City State (Holy See)VenezuelaViet NamVirgin Islands (British)Virgin Islands (U.S.)Wallis and Futuna IslandsWestern SaharaYemenYugoslaviaZaireZambiaZimbabwe
This is required.

Travel Interests

{{type.name}}
Enter Sweepstakes
"),$templateCache.put("app/cards/emerald-booking-bar.html",'
{{checkinDate | date : \'d\'}}
{{checkinDate | date : \'MMM yyyy\'}}
{{checkinDate | date : \'EEEE\'}}
{{checkoutDate | date : \'d\'}}
{{checkoutDate | date : \'MMM yyyy\'}}
{{checkoutDate | date : \'EEEE\'}}
12345678
01234567
Discount CodeGroup AttendeePromo/CorporateTravel Agency Code
{{value}}
Check Availability
'),$templateCache.put("app/cards/forms.html",'

'),$templateCache.put("app/cards/galleries.html",''),$templateCache.put("app/cards/garnet-booking-bar.html",'
Reservations
{{checkinDate | date : \'d\'}}
{{checkinDate | date : \'MMM yyyy\'}}
{{checkinDate | date : \'EEEE\'}}
{{checkoutDate | date : \'d\'}}
{{checkoutDate | date : \'MMM yyyy\'}}
{{checkoutDate | date : \'EEEE\'}}
12345678
01234567
Check Rates
'), $templateCache.put("app/cards/garnet-footer.html",'
{{clientName}}
{{clientAddress}}
{{clientBrand}} © {{currentYear}}
'),$templateCache.put("app/cards/icon-square.html",'
{{attrs.label}}
'),$templateCache.put("app/cards/islandhopper-carousel.html",'
'),$templateCache.put("app/cards/item-carousel.html",''),$templateCache.put("app/cards/main-footer.html",''),$templateCache.put("app/cards/marker-info-window.html",''),$templateCache.put("app/cards/offers.html",'
{{::offer.price}}

{{::offer.title}}

Read More
View Details
{{::offer.cta_label || \'Check Rates\'}}
'),$templateCache.put("app/cards/opal-footer.html",'
{{clientName}}
{{clientAddress}}
{{clientBrand}} © {{currentYear}}
{{::subscribeHeading}} {{::clientName}} Specials
Looking for the latest vacation specials, news and updates from {{clientBrand}}? Enter your email below!
Best Western Rewards
Rewards Earned by {{clientName}}
'),$templateCache.put("app/cards/photo-gallery.html",'
{{image.alt || image.title || \'Gallery Photo\'}}
{{defaultLanguage == \'ja\' ? \'閉じる\' : \'Close\'}}
{{image.index + 1}}{{totalImages ? \'/\' + totalImages : \'\'}}
'),$templateCache.put("app/cards/pi-booking-bar.html",'
Hotel
{{resort.name}}
Check In
{{checkinDate | date : "EEE\',\' M/d/yy"}}
Check Out
{{checkoutDate | date : "EEE\',\' M/d/yy"}}
Check Rates
'),$templateCache.put("app/cards/pi-breadcrumb.html",''), $templateCache.put("app/cards/pi-footer.html",'
Phoenix Inn Suites Contrast Logo
Phoenix Inn Suites
Get deals and discounts in your inbox
from Phoenix Inn Suites:
Submit
Phoenix Inn Suites on the App StorePhoenix Inn Suites on the Play Store
'),$templateCache.put("app/cards/pi-hotel-nav.html",''),$templateCache.put("app/cards/pi-resort-card.html",'
{{property.name}}
{{property.address.streetAddress}}
{{property.address.addressLocality}}, {{property.address.addressRegion}} {{property.address.postalCode}} {{property.address.addressCountry}}
{{property.aggregateRating.ratingValue}}     ({{property.aggregateRating.ratingCount}})   • {{property.priceRange ? property.priceRange : \'~$$$\'}}

{{amenity.name}}

'),$templateCache.put("app/cards/placeholder.html",""),$templateCache.put("app/cards/pop-up.html",'
close
No, thanks.  (Don\'t show me this again)No, thanks.
'),$templateCache.put("app/cards/portal-booking-bar.html",'
Reservations: {{phoneReservations}}
Online Reservations
{{resort.name}}
{{checkinDate | date : \'d\'}}
{{checkinDate | date : \'MMM yyyy\'}}
{{checkinDate | date : \'EEEE\'}}
{{checkoutDate | date : \'d\'}}
{{checkoutDate | date : \'MMM yyyy\'}}
{{checkoutDate | date : \'EEEE\'}}
12345678
01234567
From
{{(!selectedResortDestination.priceCurrency || selectedResortDestination.priceCurrency == \'USD\') ? \'$\' : \'\'}}{{selectedResortDestination.leadRate | number:0}}
{{selectedResortDestination.priceCurrency || \'USD\'}}/Night
From {{(!selectedResortDestination.priceCurrency || selectedResortDestination.priceCurrency == \'USD\') ? \'$\' : \'\'}}{{selectedResortDestination.leadRate | number:0}} {{selectedResortDestination.priceCurrency || \'USD\'}}/Night
Check Rates
'), $templateCache.put("app/cards/raphael-footer.html",''),$templateCache.put("app/cards/regional-footer.html",'
{{clientName}}
{{clientAddress}}
{{clientBrand}} © {{currentYear}}
{{clientName}}
{{clientAddress}}
{{clientBrand}} © {{currentYear}}
{{clientName}} Specials
Looking for the latest vacation specials, news and updates from {{clientBrand}}? Click the link below!
'),$templateCache.put("app/cards/regional-property-header.html",''),$templateCache.put("app/cards/reviews.html",'
'),$templateCache.put("app/cards/rfp-contact.html",'
Name is required.
Email is required.
Message is required.
Send Message
'),$templateCache.put("app/cards/rfp-meetings.html",'

Flexible Dates:YesNo

Type of Event/Meeting

{{type.name}}
Send Request
"),$templateCache.put("app/cards/rfp-simple.html",'

Flexible Dates:YesNo

Send Request
'),$templateCache.put("app/cards/rfp-weddings.html",'

Flexible Dates:YesNo

Do you require Ceremony space? (Please select your desired choice)

{{type.name}}

Tell us a little bit about your love story and wedding! Also, any additional information you would like to learn more about.

Send Request
"),$templateCache.put("app/cards/rooms-category-type.html",''),$templateCache.put("app/cards/ruby-booking-bar.html",'
Reservations
{{checkinDate | date : \'d\'}}
{{checkinDate | date : \'MMM yyyy\'}}
{{checkinDate | date : \'EEEE\'}}
{{checkoutDate | date : \'d\'}}
{{checkoutDate | date : \'MMM yyyy\'}}
{{checkoutDate | date : \'EEEE\'}}
12345678
01234567
Check Rates
'), $templateCache.put("app/cards/ruby-footer.html",'
'),$templateCache.put("app/cards/sapphire-footer.html",'
{{clientName}} {{clientAddress}}
{{clientPhone | tel}} Reservations: {{clientReservationsPhone}} {{clientEmail}} {{clientURL}}
Looking for the latest vacation specials, news and updates from {{clientBrand}}? Enter your email below!
{{clientBrand}} © {{currentYear}}
'),$templateCache.put("app/cards/search-bar.html",'

{{title}}

'),$templateCache.put("app/cards/shell-footer.html",'
Extra Holidays HI TAT Broker ID: TA-075-433-7792-01
'),$templateCache.put("app/cards/shilo-booking-bar.html",'
Destination
All{{destination.name}}
Suites & Hotels
{{resort.name}}
Check In
{{checkinDate | date : "EEE\',\' M/d/yy"}}
Check Out
{{checkoutDate | date : "EEE\',\' M/d/yy"}}
Adults
12345
Children
01234
Rate
PreferredAAASeniorVeteransGovernmentBest Rate
Check Rates
'),$templateCache.put("app/cards/shilo-footer.html",'
Shilo Inns Hotels
Shilo Corporate | {{::clientAddress}} | Office: +1 503-641-6565
{{::clientBrand}}
All Rights Reserved © {{::currentYear}}
'), $templateCache.put("app/cards/shilo-hotel-nav.html",''),$templateCache.put("app/cards/shilo-resort-card.html",'
{{property.name}}
{{property.address.streetAddress}} {{property.address.addressLocality}}, {{property.address.addressRegion}} {{property.address.postalCode}} {{property.address.addressCountry}}
{{property.aggregateRating.ratingValue}}     ({{property.aggregateRating.ratingCount}})   • {{property.priceRange ? property.priceRange : \'~$$$\'}}

{{amenity.name}}

'),$templateCache.put("app/cards/si-resort-card.html",'

{{property.address.streetAddress}}
{{property.address.addressLocality}}, {{property.address.addressRegion}} {{property.address.postalCode}} {{property.address.addressCountry}}
{{property.aggregateRating.ratingValue}}     ({{property.aggregateRating.ratingCount || property.aggregateRating.reviewCount}})   •  {{property.priceRange ? property.priceRange : \'~$$$\'}}
{{property.telephone | tel}}

{{amenity.name}}

Check Rates
'),$templateCache.put("app/cards/sitemap-links.html",''),$templateCache.put("app/cards/sitewide-notice.html",''),$templateCache.put("app/cards/social-links.html",''),$templateCache.put("app/cards/social-share.html",''), $templateCache.put("app/cards/translate-popup.html",'

Language Select

close
English - English
English (UK) - English (UK)
Spanish - Español
Chinese (Simplified) - 简体中文
Chinese (Traditional) - 繁體中文
German - Deutsch

Afrikaans
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bengali
Bosnian
Bulgarian
Catalan
Cebuano
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
English (UK)
Esperanto
Estonian
Filipino
Finnish
French
Frisian
Galician
Georgian
German
Greek
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Khmer
Kinyarwanda
Korean
Kurdish (Kurmanji)
Kyrgyz
Lao
Latin
Latvian
Lithuanian
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mongolian
Myanmar (Burmese)
Nepali
Norwegian
Odia (Oriya)
Pashto
Persian
Polish
Portuguese
Punjabi
Romanian
Russian
Samoan
Scots Gaelic
Serbian
Sesotho
Shona
Sindhi
Sinhala
Slovak
Slovenian
Somali
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Turkish
Turkmen
Ukrainian
Urdu
Uyghur
Uzbek
Vietnamese
Welsh
Xhosa
Yiddish
Yoruba
Zulu
No, thanks.
'),$templateCache.put("app/cards/trustyou-property-review.html",'

"{{::reviewData.summary.text}}"

{{::distribution.stars}}
{{::distribution.reviews_count}}

{{::badge.text}} – {{::badge.subtext}}

Good to Know

 {{item.text}}

Traveler Types

powered by TrustYou
'), $templateCache.put("app/cards/vh-booking-bar.html",'
Island
All{{destination.name}}
Resort
Check In
{{checkinDate | date : "EEE\',\' M/d/yy"}}
Check Out
{{checkoutDate | date : "EEE\',\' M/d/yy"}}
Promo
From
{{(!selectedResortDestination.priceCurrency || selectedResortDestination.priceCurrency == \'USD\') ? \'$\' : \'\'}}{{selectedResortDestination.leadRate | number:0}}
{{selectedResortDestination.priceCurrency || \'USD\'}}/Night
From {{(!selectedResortDestination.priceCurrency || selectedResortDestination.priceCurrency == \'USD\') ? \'$\' : \'\'}}{{selectedResortDestination.leadRate | number:0}} {{selectedResortDestination.priceCurrency || \'USD\'}}/Night
Check Rates
'),$templateCache.put("app/cards/vh-breadcrumb.html",''),$templateCache.put("app/cards/vh-footer.html",'
Vacation Hawaii by Extra Holidays
Seller of Travel
Hawaii TAT Broker ID #: TA-075-433-7792-01
©{{::currentYear}} Extra Holidays. All Rights Reserved.
Extra Holidays Inverse Logo
'),$templateCache.put("app/cards/write-review-dialog.html",'

Write a Review

Rating *
CancelSubmit Review
')}]),angular.module("brewervacations-app").run(["$templateCache",function($templateCache){"use strict";$templateCache.put("app/regional/extraholidays/404/view/404.tpl.html",'

Whoops, that page could not be found. Please try one of the links below:

Explore Our Resorts

Wyndham Resorts in {{regionName}}
{{hotel.name}}
{{hotel.address.streetAddress}} {{hotel.address.addressLocality}}, {{hotel.address.addressRegion}} {{::hotel.address.postalCode}} {{hotel.address.addressCountry}}
{{hotel.email}} {{hotel.telephone | tel}}
'),$templateCache.put("app/regional/extraholidays/amenities/view/amenities.tpl.html",'

{{::vm.property.name}} Amenities

Resort Amenities

{{::amenity.name}}

Pets Allowed Service Animals Welcome

100% Smoke-Free Rooms Smoking Rooms Available

Room Amenities

Room Amenity Icon {{::amenity.name}}

'),$templateCache.put("app/regional/extraholidays/cards/view/availability-alert.tpl.html",'

Availability Alert

{{selectedResortDestination.name}}

Our team will reach out if these dates become available.
Number of travelers is required.
Check-in Date preference is required.
Check-out Date preference is required.
Contact Info is required.
Sign up for our exciting email offers with Extra Holidays and receive alerts and discounts across the U.S., Asia Pacific and Canada. As a subscriber to our email list, you\'ll get the scoop on vacation deals to save you money.
Alert Me!
'),$templateCache.put("app/regional/extraholidays/cards/view/breadcrumb.tpl.html",''),$templateCache.put("app/regional/extraholidays/cards/view/countdown-timer.tpl.html",'
0
Days
{{dvm.hours}}
Hours
{{dvm.minutes}}
Minutes
{{dvm.seconds}}
Seconds
'), $templateCache.put("app/regional/extraholidays/cards/view/eh-booking-bar-original.tpl.html","
Destination
location_on
{{item.resortCount ? 'explore' : 'location_city'}}not_listed_location{{item.name | trustAsHTML}} | {{item.name != item.city ? item.city : ''}}{{item.state ? ', ' + item.state : ''}} Whoops, no locations found for that search.
Check In
{{checkinDate | date : \"EEE',' M/d/yy\"}}
Check Out
{{checkoutDate != checkinDate ? (checkoutDate | date : \"EEE',' M/d/yy\") : (checkoutDate | dateAdd: 2 | date : \"EEE',' M/d/yy\")}}
{{checkoutDate}} {{checkinDate}} {{checkoutDate == checkinDate}}
-1) ? 1 : 2\">
Promo
0\" ng-cloak>
From
{{(!selectedResortDestination.priceCurrency || (['USD','CAD','AUD','NZD'].indexOf(selectedResortDestination.priceCurrency) > -1)) ? '$' : ''}}{{['JPY','CNY'].indexOf(selectedResortDestination.priceCurrency) > -1 ? '¥' : ''}}{{['IDR'].indexOf(selectedResortDestination.priceCurrency) > -1 ? 'Rp' : ''}}{{selectedResortDestination.leadRate | number:0}}
{{selectedResortDestination.priceCurrency || 'USD'}}/{{['116083'].indexOf(selectedResortDestination.hotelCode) > -1 ? 'Person' : 'Night'}}
From {{(!selectedResortDestination.priceCurrency || (['USD','CAD','AUD','NZD'].indexOf(selectedResortDestination.priceCurrency) > -1)) ? '$' : ''}}{{['JPY','CNY'].indexOf(selectedResortDestination.priceCurrency) > -1 ? '¥' : ''}}{{['IDR'].indexOf(selectedResortDestination.priceCurrency) > -1 ? 'Rp' : ''}}{{selectedResortDestination.leadRate | number:0}} {{selectedResortDestination.priceCurrency || 'USD'}}/{{['116083'].indexOf(selectedResortDestination.hotelCode) > -1 ? 'Person' : 'Night'}}
Search
"),$templateCache.put("app/regional/extraholidays/cards/view/eh-date-picker.tpl.html",'
Book This Adventure:
Check In/Out
{{checkinDate | date : "EEE\',\' M/d/yy"}} - {{checkoutDate | date : "EEE\',\' M/d/yy"}}
Check Availability
'),$templateCache.put("app/regional/extraholidays/cards/view/eh-expanded-features-list.tpl.html",'

Select Features

{{amenity}} {{featureSetCounts[amenity]}}
'),$templateCache.put("app/regional/extraholidays/cards/view/eh-hotel-hero-photos.tpl.html",'
{{::property.name}}

, ,

  ({{::property.aggregateRating.ratingCount}})  
• {{property.priceRange ? property.priceRange : \'\'}}
'),$templateCache.put("app/regional/extraholidays/cards/view/eh-meetings-rfp.tpl.html",'

Plan Your Event in Extraordinary Destinations

Submit Request for Proposal

This is required.
This is required.
This is required.
This is required.
{{hotel.name}} - {{hotel.address.addressLocality}}, {{hotel.address.addressRegion}}

Flexible Dates:YesNo

Send Request
'),$templateCache.put("app/regional/extraholidays/cards/view/hotel-banner-notice.tpl.html",''),$templateCache.put("app/regional/extraholidays/cards/view/laasie-registration.tpl.html",'
Join Insider Extras Today!
Sign up. Book direct. Get rewards. Earn every time.
visibility{{showPasswordField ? \'_off\' : \'\'}}
visibility{{showConfirmPasswordField ? \'_off\' : \'\'}}
Yes, I am a U.S. resident and 21 years or older.I agree to the Terms of Use and Privacy Notice.Join Now
Already have an account? Sign In
'),$templateCache.put("app/regional/extraholidays/cards/view/offer-resort-card.tpl.html",'
{{property.name}}
{{property.address.streetAddress}} {{property.address.addressLocality}}, {{property.address.addressRegion}} {{property.address.postalCode}} {{property.address.addressCountry}}
'), $templateCache.put("app/regional/extraholidays/cards/view/owner-rental-program-rfp.tpl.html",'
First name is required.
Last name is required.
Email address is required.
Phone number is required. Enter numeric values only.
Resort where your condominium is located*{{property.ResortName}}
Room Type (Select a resort to select room type.)None Specified{{roomType}}Other
Please specify the room type.
Do you currently use a rental service provider?
YesNo
Have you used Extra Holidays Owner Rental Services in the past?
YesNo
When was the condominium last updated/refurbished?
Please use a valid date format. (MM/DD/YYYY)
Submit
*Please complete all required fields above to sign up.
'),$templateCache.put("app/regional/extraholidays/cards/view/resort-card.tpl.html",'

, ,
{{property.aggregateRating.ratingValue}}     ({{property.aggregateRating.ratingCount}})   • {{property.priceRange ? property.priceRange : \'~$$$\'}}

{{amenity.name}}

{{amenity.name}}

{{property.showMoreResortsAmenities ? \'Show Less\' : \'View More\' }}{{property.showMoreResortsAmenities ? \'\' : \'\' }}
'), $templateCache.put("app/regional/extraholidays/cards/view/search-resort-card.tpl.html",'
{{property.name}} Image {{$index}} | {{property.imageIndex}} {{property.name}} Image 1
From
{{[\'USD\',\'CAD\',\'AUD\',\'NZD\'].indexOf(property.priceCurrency) > -1 ? \'$\' : \'\'}}{{[\'JPY\',\'CNY\'].indexOf(property.priceCurrency) > -1 ? \'¥\' : \'\'}}{{[\'EUR\'].indexOf(property.priceCurrency) > -1 ? \'€\' : \'\'}}{{[\'IDR\'].indexOf(property.priceCurrency) > -1 ? \'Rp\' : \'\'}}฿{{property.price | number:0}}
{{property.priceCurrency || \'USD\'}}/{{[\'116083\'].indexOf(property.hotelCode) > -1 ? \'person\' : \'night\'}}

{{property.amenityFeature.length ? \'Amenities:\' : \' \'}} {{amenity.name}},
{{isLoadingRate ? \'Finding room rates...\' : \'Dates Not Available\'}}
From {{[\'USD\',\'CAD\',\'AUD\',\'NZD\'].indexOf(property.priceCurrency) > -1 ? \'$\' : \'\'}}{{[\'JPY\',\'CNY\'].indexOf(property.priceCurrency) > -1 ? \'¥\' : \'\'}}{{[\'EUR\'].indexOf(property.priceCurrency) > -1 ? \'€\' : \'\'}}{{[\'IDR\'].indexOf(property.priceCurrency) > -1 ? \'Rp\' : \'\'}}฿{{property.price | number:0}} {{property.priceCurrency || \'USD\'}}/{{[\'116083\'].indexOf(property.hotelCode) > -1 ? \'person\' : \'night\'}}
Select Room Hide RoomsSee Availability
{{offer.itemOffered.name}}
Occupancy: {{offer.itemOffered.occupancy.maxValue}} People 
Dates Not Available
{{property.name}} Image {{$index}} | {{room.imageIndex}}
From {{[\'USD\',\'CAD\',\'AUD\',\'NZD\'].indexOf(property.priceCurrency) > -1 ? \'$\' : \'\'}}{{[\'JPY\',\'CNY\'].indexOf(property.priceCurrency) > -1 ? \'¥\' : \'\'}}{{[\'EUR\'].indexOf(property.priceCurrency) > -1 ? \'€\' : \'\'}}{{[\'IDR\'].indexOf(property.priceCurrency) > -1 ? \'Rp\' : \'\'}}฿{{room.averageRates[0].rate | number:0}}
{{[\'USD\',\'CAD\',\'AUD\',\'NZD\'].indexOf(property.priceCurrency) > -1 ? \'$\' : \'\'}}{{[\'JPY\',\'CNY\'].indexOf(property.priceCurrency) > -1 ? \'¥\' : \'\'}}{{[\'EUR\'].indexOf(property.priceCurrency) > -1 ? \'€\' : \'\'}}{{[\'IDR\'].indexOf(property.priceCurrency) > -1 ? \'Rp\' : \'\'}}฿{{(room.averageRates[0].rate - room.averageRates[0].discount) | number:0}}
{{property.priceCurrency || \'USD\'}}/{{[\'116083\'].indexOf(property.hotelCode) > -1 ? \'person\' : \'night\'}}
{{room.averageRates[0].promotionPercentageDiscount}}% Off
{{room.roomTypeName}}
{{feature.type}}: {{feature.quantity}} {{feature.amenityName}}{{feature.amenityName != \'People\' && feature.quantity > 1 ? \'s\' : \'\'}},
Dates Not Available
{{room.available ? \'Book Now\' : \'See Availability\'}}
'), $templateCache.put("app/regional/extraholidays/cards/view/vacations-booking-bar.tpl.html",'
{{leavingFromLabel}}
flight_takeoff
flight_takeoff{{item.display}}
{{goingToLabel}}
location_on
flight_land{{item.display}}
Destination
location_on
{{item.resortCount ? \'explore\' : \'location_city\'}}not_listed_location{{item.name | trustAsHTML}} | {{item.name != item.city ? item.city : \'\'}}{{item.state ? \', \' + item.state : \'\'}} Whoops, no locations found for that search.
Check In
Departing
From
Pick-up Date
{{checkinDate | date : "EEE\',\' M/d/yy"}}
Check Out
Returning
To
Drop-off Date
{{checkoutDate | date : "EEE\',\' M/d/yy"}}
Search
'),$templateCache.put("app/regional/extraholidays/categories/view/categories.tpl.html",'

Vacation Experiences from Wyndham® Extra Holidays {{::vm.currentCategory.title}} {{::vm.h1}}

{{::vm.currentCategory.description}}
All Destinations{{destination.name}}—or— All Resorts{{hotel.name}} - {{hotel.cityName}}, {{hotel.stateName}}
Choose a resort for: {{::categoryNav.title}} View All See Offer Details below.
{{::category.title}}
{{::category.title}}

{{::category.title}}

{{::category.excerpt}} Read More...

'),$templateCache.put("app/regional/extraholidays/contact/view/contact.tpl.html",'

Questions? Comments? Let us know!

Questions? Comments? Let us know!

Contact Us {{::vm.h1}}

{{::region.name}}

{{hotel.name}}
{{::hotel.address.streetAddress}} {{::hotel.address.addressLocality}}, {{::hotel.address.postalCode}} {{hotel.address.addressCountry}}
{{::hotel.email}} {{hotel.contactPoint.telephone || hotel.telephone | tel}}
'),$templateCache.put("app/regional/extraholidays/destination/view/destination.tpl.html",'

Explore the best hotels in {{vm.destinationName}}

Explore the best hotels in {{vm.destinationName}}

'),$templateCache.put("app/regional/extraholidays/destination/view/destinations.tpl.html",'

Explore the best hotels in {{vm.destinationName}}

Explore the best hotels in {{vm.destinationName}}

'), $templateCache.put("app/regional/extraholidays/destination/view/new-destination.tpl.html",'

Explore Resorts in {{vm.destination.name}} {{::vm.destination.h2}}

Check back soon for new resorts coming to {{vm.destination.name}} Destinations and Resorts {{vm.destination.h1}}  

Discover the beautiful {{property.name}}, from Extra Holidays.
Explore {{::vm.destination.name}} resorts from Extra Holidays, including  and {{property.name}},.
Explore {{::vm.destination.name}} resorts from Extra Holidays, including  and {{child.name}}, vacation destinations.
View MapList Only
Filter Resorts
Viewing {{vm.globalSearch ? \'All\' : (vm.destination.name.indexOf(\'Resorts\') == -1 ? vm.destination.name + \' Resorts\' : vm.destination.name)}}
Show {{!vm.globalSearch ? \'All\' : (vm.destination.name.indexOf(\'Resorts\') == -1 ? vm.destination.name + \' Resorts\' : vm.destination.name)}}
Find your Stay
{{vm.destination.name}}
All Destinations{{child.name}}
Trip Type
{{type}}
Whoops, no resorts found for that search.
Please broaden your terms and try again, or explore all resorts.
{{vm.pagedResults.length}} Resort{{vm.pagedResults.length > 1 ? \'s\' : \'\'}} Found
Load More Results
All Countries{{country.name}}All States{{state.name}}All Destinations{{destination.name}} All Resorts{{hotel.name}} - {{hotel.cityName}}, {{hotel.stateName}}Clear Filters
{{filteredResults.length}} Resort{{ filteredResults.length > 1 ? \'s\' : \'\'}} Found
'), $templateCache.put("app/regional/extraholidays/destination/view/new-destinations.tpl.html",'
Filter Resorts
Find your Stay
Destinations
All Destinations{{child.name}}
Trip Type
{{type}}
Whoops, no resorts found for that search.
Please broaden your terms and try again, or explore all resorts.
{{vm.pagedResults.length}} Resort{{vm.pagedResults.length > 1 ? \'s\' : \'\'}} Found
Load More Results
'),$templateCache.put("app/regional/extraholidays/dining/view/dining.tpl.html",'

Experience exceptional nearby dining!

Experience exceptional nearby dining!

Enjoy nearby Dining! {{::vm.h1}}

Dining Options Near

{{::option.name}}

Hours

{{period.openDay}}{{vm.formatHours(period.openTime)}} - {{vm.formatHours(period.closeTime)}}

{{::option.name}}

{{::option.streetAddress}}
{{::option.addressLocality}}, {{::option.addressRegion}} {{::option.postalCode}}
Get DirectionsView on YelpView on FacebookView on TripAdvisor{{::menu.name}}

Menu

{{image.alt || image.title || (option.name + \' photo \' + ($index + 1))}}
'),$templateCache.put("app/regional/extraholidays/events/view/event.tpl.html",'
Experience fun nearby events!
Experience fun nearby events!
{{vm.event.name}}

{{vm.event.name}}

{{vm.event.category | properCaps}}

{{vm.event.start_time | date : \'MMM d, y h:mm a\'}} – {{vm.event.end_time | date : \'MMM d, y h:mm a\'}}
Read More
View Event
'),$templateCache.put("app/regional/extraholidays/events/view/events.tpl.html",'

Experience fun nearby events!

Experience fun nearby events!

Enjoy nearby Events! {{::vm.h1}}

Upcoming Events Near

{{hotel.name}}All Categories{{category | properCaps}}
Please check again soon for the latest events from !
{{event.place.location.city}}
{{event.start_time | date : \'MMM d, y h:mm a\'}} – {{event.end_time | date : \'MMM d, y h:mm a\'}}
Read More
View Details
'), $templateCache.put("app/regional/extraholidays/home/view/home.tpl.html",'

{{category.offers[0].title}}

{{::category.offers[0].title}} 

{{::category.offers[0].hotels[0].address.addressLocality}}, {{::category.offers[0].hotels[0].address.addressRegion}} 
{{::category.offers[0].price}}  {{::category.offers[0].cta_label}}
{{category.offers[1].title}}

{{::category.offers[1].title}} 

{{::category.offers[1].hotels[0].address.addressLocality}}, {{::category.offers[1].hotels[0].address.addressRegion}} 
{{::category.offers[1].price}}  {{::category.offers[1].cta_label}}
{{category.offers[2].title}}

{{::category.offers[2].title}} 

{{::category.offers[2].hotels[0].address.addressLocality}}, {{::category.offers[2].hotels[0].address.addressRegion}} 
{{::category.offers[2].price}}  {{::category.offers[2].cta_label}}

Extra Holidays {{::vm.h1}}

View Specials

Our version of couponing.
Except better.

View Current Specials

Explore Destinations

The answer to your vacation bucket list.

Find Resorts

Resort Photo Galleries

If a picture is worth a thousand words, this is our dictionary!

Explore Galleries

There are many benefits of a vacation suite!

'), $templateCache.put("app/regional/extraholidays/hotels/view/hotel.tpl.html",'

Overview

{{::noticeTitle}}

{{::title}}

{{vm.showMoreDescription ? \'Show Less\' : \'Read More\' }}{{vm.showMoreDescription ? \'\' : \'\' }}
Check-In Time
{{vm.property.checkinTime || \'4:00 PM\' | toTime}}
Check-Out Time
{{vm.property.checkoutTime || \'11:00 AM\' | toTime }}

Resort Amenities

  • {{::amenity.name}}
  • {{::amenity.name}}
{{vm.showMoreAmenities ? \'Show Less\' : \'View More\' }}{{vm.showMoreAmenities ? \'\' : \'\' }}
Get DirectionsCheck Rates

Rooms & Suites

Photos shown may vary from the actual unit you receive, but are typical of the room category you booked.
View All Suites

Photos

Click to View Photo Gallery{{::image.title}}
Click to View Photo Gallery{{::image.title}}
View Photo Gallery
{{::image.title}}

Location

{{::vm.property.address.streetAddress}}, {{::vm.property.address.addressLocality}}, {{::vm.property.address.addressRegion}} {{::vm.property.address.postalCode}} {{vm.property.address.addressCountry}}
{{vm.property.telephone | tel}}
Explore NearbyCheck Rates
'),$templateCache.put("app/regional/extraholidays/hotels/view/hotels.tpl.html",'

Extra Holidays Resorts {{vm.h1}}

{{vm.h2}}

MapList
Filter Resorts
Find your Stay
Destinations
All Destinations{{regionName}}
Whoops, no resorts found for that search.
Please broaden your terms and try again.
Load More
'),$templateCache.put("app/regional/extraholidays/landingpage/view/es.tpl.html",'

'),$templateCache.put("app/regional/extraholidays/landingpage/view/flipbook.tpl.html",'

{{vm.h2}}

{{vm.h2}}

{{vm.h1}}

{{::vm.h2}}

'), $templateCache.put("app/regional/extraholidays/landingpage/view/landingpage.tpl.html",'
{{vm.headerImageAlt || vm.h2 || vm.h1 || \'Featured Image\'}} {{vm.headerImageAlt || vm.h2 || vm.h1 || \'Featured Image\'}}

'),$templateCache.put("app/regional/extraholidays/landingpage/view/love-wyndham.tpl.html",'

{{vm.h2}}

Earn Up To 20,000 Bonus Points

{{vm.h1}}

{{::vm.h2}}

'),$templateCache.put("app/regional/extraholidays/landingpage/view/marble-falls-mv-deal.tpl.html","

{{vm.h1}}

{{::vm.h2}}

Provided by Extra Holidays. Please view the Offer Details below.
\\'>

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your getaway:

  • night accommodations in a 1-bedroom at which can sleep up to 2 adults and 2 children (under age 18).
  • As part of your vacation package, you will join us for a WorldMark by Wyndham presentation to learn about great vacation products and tour this beautiful resort.

THE VERIFIABLE RETAIL VALUE OF THIS PACKAGE RANGES FROM .

*Note: The earliest that guests can arrive is 10 days from the date the package was purchased.

Offer Details:

\\'>

You, and your spouse if married, must attend a 120-minute WorldMark by Wyndham timeshare sales presentation. Please read the Terms and Conditions to see if you meet the minimum eligibility requirements. Earliest available check-in is 10 days from the vacation purchase date.

Transportation, gratuities, parking fees, room taxes (), meals not specifically advertised and incidentals are not included. The retail value of this package may depend on room availability, additional feature(s) and travel dates selected. You must complete your stay no later than one year from date of purchase. Package must be purchased by 12/31/2020. For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change. Extra Holidays is the marketing agent for WorldMark by Wyndham, the offering developer. Valid for residents of select states. Void where prohibited by law.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING THE SALE OF TIME-SHARE PROPERTY OR INTERESTS IN TIME-SHARE PROPERTY.

WorldMark by Wyndham | Privacy Policy

WorldMark® is a federally registered service mark of Wyndham Resort Development Corporation. © 2005 - 2020 Wyndham Resort Development Corporation. All rights reserved.

';\">

{{offer.title}}

Resort Overview

Book Now
3-Days/2-Nights
$149
',offer.city).replace('',2).replace('', offer.priceRange).replace('', offer.taxRange).replace('',offer.hotelName).replace('',offer.classes).replace('',offer.classes2)})\" target=_blank>View Details
4-Days/3-Nights
$219
',offer.city).replace('',3).replace('', offer.priceRangeHigh).replace('', offer.taxRange).replace('',offer.hotelName).replace('',offer.classes).replace('',offer.classes2)})\" target=_blank>View Details
OFFER DETAILS:
You, and your spouse if married, must attend a 120-minute WorldMark by Wyndham timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Earliest available check-in is X days from the vacation purchase date.
Transportation, gratuities, parking fees, room taxes ($XX-$XXX), meals not specifically advertised and incidentals are not included. The retail value of this package may depend on room availability, additional feature(s) and travel dates selected. You must complete your stay no later than XX year from date of purchase. Package must be purchased by XX/XX/XXXX. For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change. Extra Holidays is the marketing agent for WorldMark by Wyndham, the offering developer. Valid for residents of select states. Void where prohibited by law.
THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER
THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING THE SALE OF TIME-SHARE PROPERTY OR INTERESTS IN TIME-SHARE PROPERTY.
WorldMark® is a federally registered service mark of Wyndham Resort Development Corporation. © 2005 - 2020 Wyndham Resort Development Corporation. All rights reserved.
"), $templateCache.put("app/regional/extraholidays/landingpage/view/mv-family-vacation-deals.tpl.html","

{{vm.h1}}

{{::vm.h2}}

Provided by Wyndham Vacation Resorts. Please view Offer Details below.

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your Orlando getaway:

    \t
  • 2 night\\'s accommodations in a 1-bedroom at Wyndham Bonnet Creek which can sleep up to 2 adults and 2 children (under age 18).
  • \t
  • You will receive a $100 American Express Reward Card. Terms and conditions apply to American Express ® Reward Cards. SUBJECT TO APPLICABLE LAW, A $3.00 MONTHLY SERVICE FEE WILL BE ASSESSED AGAINST CARD BALANCE STARTING 6 MONTHS AFTER CARD ISSUANCE. There is no monthly service fee on Cards shipped to New York State residents. Additional limitations may apply. See Cardholder Agreement. This Card is provided pursuant to a reward, loyalty or promotional program. Issued by American Express Prepaid Card Management Corporation.

THE RETAIL VALUE OF THIS PACKAGE RANGES FROM $178-$338.

OFFER DETAILS: You (and spouse, if married; or partner, if cohabiting) must attend a 120-minute CLUB WYNDHAM timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Extra Holidays is the marketing agent for this offer. Transportation, airfare, gratuities, parking fees, resort security deposit, meals not specifically advertised and incidentals are not included. The retail value depends on room availability and travel dates selected. You must complete your stay within 12 months from date of purchase.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, UT, VA, VT, WA, WI, WV, WY.

For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

CLUB WYNDHAM is a registered mark licensed to Wyndham Vacation Resorts, the offering developer.

'},\r\n\t\t\t\t\t\t{ title: 'Orlando Vacation Special!', name: 'Orlando Vacation Special!', hotelSlug: 'https://www.extraholidays.com/kissimmee-florida/wyndham-cypress-palms', price: '$179', image: 'https://lh3.googleusercontent.com/X9VTiE-V59cDew_7miA5VAMbnM1gcsFmkQKRA2fSLf_HOwEQJsuBEn4YY5aT9E2eVT5eTLko_1R6GZ553ocVDwLbqAzVDqGqFSty=s0', categoryName: 'Vacation Deals', hotelName: 'Wyndham Cypress Palms', cta: 'https://reservations.travelclick.com/2963?identifier=MVWYN&ProdID=672161', terms:'

Provided by Wyndham Vacation Resorts. Please view Offer Details below.

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your Orlando getaway:

    \t
  • 2 night\\'s accommodations in a 1-bedroom at Wyndham Cypress Palms which can sleep up to 2 adults and 2 children (under age 18).
  • \t
  • You will receive a $100 American Express Reward Card. Terms and conditions apply to American Express ® Reward Cards. SUBJECT TO APPLICABLE LAW, A $3.00 MONTHLY SERVICE FEE WILL BE ASSESSED AGAINST CARD BALANCE STARTING 6 MONTHS AFTER CARD ISSUANCE. There is no monthly service fee on Cards shipped to New York State residents. Additional limitations may apply. See Cardholder Agreement. This Card is provided pursuant to a reward, loyalty or promotional program. Issued by American Express Prepaid Card Management Corporation.

THE RETAIL VALUE OF THIS PACKAGE RANGES FROM $178-$338.

OFFER DETAILS: You (and spouse, if married; or partner, if cohabiting) must attend a 120-minute CLUB WYNDHAM timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Extra Holidays is the marketing agent for this offer. Transportation, airfare, gratuities, parking fees, resort security deposit, meals not specifically advertised and incidentals are not included. The retail value depends on room availability and travel dates selected. You must complete your stay within 12 months from date of purchase.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, UT, VA, VT, WA, WI, WV, WY.

For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

CLUB WYNDHAM is a registered mark licensed to Wyndham Vacation Resorts, the offering developer.

'},\r\n\t\t\t\t\t\t{ title: 'Las Vegas Vacation Special!', name: 'Las Vegas Vacation Special!', hotelSlug: 'https://www.extraholidays.com/las-vegas-nevada/wyndham-grand-desert', price: '$179', image: 'https://lh3.googleusercontent.com/2k2XQFETgbjuNqKK3aAefrrMiq97mx0CN0YDF_XUhr-kE-qQnGHifXR9iMTyn2MspovT5f7UsoppsAqd_EV5_UjjYN7gh1rLQtMqjC8=s0', categoryName: 'Vacation Deals', hotelName: 'Wyndham Grand Desert', cta: 'https://reservations.travelclick.com/2960?identifier=MVWYN&ProdID=676851', terms:'

Provided by Wyndham Vacation Resorts. Please view Offer Details below.

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your Las Vegas getaway:

    \t
  • 2 night\\'s accommodations in a 1-bedroom at Wyndham Grand Desert which can sleep up to 2 adults and 2 children (under age 18).
  • \t
  • You will receive a $100 American Express Reward Card. Terms and conditions apply to American Express ® Reward Cards. SUBJECT TO APPLICABLE LAW, A $3.00 MONTHLY SERVICE FEE WILL BE ASSESSED AGAINST CARD BALANCE STARTING 6 MONTHS AFTER CARD ISSUANCE. There is no monthly service fee on Cards shipped to New York State residents. Additional limitations may apply. See Cardholder Agreement. This Card is provided pursuant to a reward, loyalty or promotional program. Issued by American Express Prepaid Card Management Corporation.

THE RETAIL VALUE OF THIS PACKAGE RANGES FROM $338-$597.

OFFER DETAILS: You (and spouse, if married; or partner, if cohabiting) must attend a 120-minute CLUB WYNDHAM timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Extra Holidays is the marketing agent for this offer. Transportation, airfare, gratuities, parking fees, resort security deposit, meals not specifically advertised and incidentals are not included. The retail value depends on room availability and travel dates selected. You must complete your stay within 12 months from date of purchase.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, UT, VA, VT, WA, WI, WV, WY.

For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

CLUB WYNDHAM is a registered mark licensed to Wyndham Vacation Resorts, the offering developer.

'},\r\n\t\t\t\t\t\t{ title: 'Las Vegas Vacation Special!', name: 'Las Vegas Vacation Special!', hotelSlug: 'https://www.extraholidays.com/las-vegas/wyndham-desert-blue', price: '$179', image: 'https://lh3.googleusercontent.com/LllyT9ji0EaEohldiToA5bytM0Tu6TeaCr5NvoUqhEgD11DaUTr8Up6MMwxARDDxWnE1y5Ls46659XFKLPd87MSeYD0GO_q8tXZ6=s0', categoryName: 'Vacation Deals', hotelName: 'Wyndham Desert Blue', cta: 'https://reservations.travelclick.com/97093?identifier=MVWYN&ProdID=676853', terms:'

Provided by Wyndham Vacation Resorts. Please view Offer Details below.

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your Las Vegas getaway:

    \t
  • 2 night\\'s accommodations in a 1-bedroom at Wyndham Desert Blue which can sleep up to 2 adults and 2 children (under age 18).
  • \t
  • You will receive a $100 American Express Reward Card. Terms and conditions apply to American Express ® Reward Cards. SUBJECT TO APPLICABLE LAW, A $3.00 MONTHLY SERVICE FEE WILL BE ASSESSED AGAINST CARD BALANCE STARTING 6 MONTHS AFTER CARD ISSUANCE. There is no monthly service fee on Cards shipped to New York State residents. Additional limitations may apply. See Cardholder Agreement. This Card is provided pursuant to a reward, loyalty or promotional program. Issued by American Express Prepaid Card Management Corporation.

THE RETAIL VALUE OF THIS PACKAGE RANGES FROM $278-$1,018.

OFFER DETAILS: You (and spouse, if married; or partner, if cohabiting) must attend a 120-minute CLUB WYNDHAM timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Extra Holidays is the marketing agent for this offer. Transportation, airfare, gratuities, parking fees, resort security deposit, meals not specifically advertised and incidentals are not included. The retail value depends on room availability and travel dates selected. You must complete your stay within 12 months from date of purchase.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, UT, VA, VT, WA, WI, WV, WY.

For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

CLUB WYNDHAM is a registered mark licensed to Wyndham Vacation Resorts, the offering developer.

'}\r\n"+'\t\t\t\t\t ]">
Click to Explore {{vm.isProperty ? \'Offer\' : \'Resort\'}}Click to Explore {{offer.hotelName}}

{{offer.title}}{{offer.hotelName}}

{{offer.hotelCityStateText}} | Resort Overview

View DetailsBook Now

Save Up To 10% At Other Great Locations

Save Up To 10% At Other Great Locations
{{hotel.name}}
Check Rates
'), $templateCache.put("app/regional/extraholidays/landingpage/view/mv-getaway-vacation-deals.tpl.html","

{{vm.h1}}

{{::vm.h2}}

Provided by Wyndham Vacation Resorts. Please view the Offer Details below.
\\'>

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your getaway:

  • night\\'s accommodations in a 1-bedroom at which can sleep up to 2 adults and 2 children (under age 18).
  • As part of your vacation package, you will join us for a CLUB WYNDHAM presentation to learn about great vacation products and tour our beautiful resort.

THE VERIFIABLE RETAIL VALUE OF THIS PACKAGE RANGES FROM .

OFFER DETAILS

\\'>

You, and your spouse if married, must attend a 120-minute CLUB WYNDHAM® timeshare sales presentation. You must be at least 28 years of age or older with a min. annual household income of $60,000, or 55 years of age or older, and who have not attended a CLUB WYNDHAM sales presentation in the last 30 days and have not attended a maximum of four tours per household per year. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Earliest available check-in is 8 days from the vacation purchase date.

If you do not attend the presentation, you will be charged $150 per night and will not be refunded your deposit, unless otherwise prohibited by law.

Transportation, airfare, gratuities, nightly room taxes (), parking fees, resort security deposit, meals not specifically advertised and incidentals are not included. Guests are required to redeem 15,000 Wyndham Rewards Points to secure booking. The verifiable retail value of this package may depend on room availability and travel dates selected.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING THE SALE OF TIME-SHARE PROPERTY OR INTERESTS IN TIME-SHARE PROPERTY.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DE, FL, GA, HI, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, VA, VT, WA, DC, WY. For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

WYNDHAM REWARDS® is a registered trademark used under license from Wyndham Rewards, Inc. Wyndham Rewards, Inc. is not the sponsor of this promotion nor the seller of any vacation ownership product.

';\">

{{offer.title}}

3-Days/2-Nights

Resort Overview

Book Now
 
',offer.city).replace('',2).replace('', offer.priceRange).replace('', offer.taxRange).replace('',offer.hotelName).replace('',offer.classes).replace('',offer.classes2)})\" target=_blank>View Details

You, and your spouse if married, must attend a 120-minute Club Wyndham timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Earliest available check-in is 8 days from the vacation purchase date.

Transportation, gratuities, parking fees, room taxes ($10-$260), meals not specifically advertised and incidentals are not included. The retail value of this package may depend on room availability, additional feature(s) and travel dates selected. You must complete your stay no later than one year from date of purchase. Package must be purchased by 11/30/2019. For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change. Extra Holidays is the marketing agent for Wyndham Vacation Resorts. Valid for residents of select states. Void where prohibited by law.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING THE SALE OF TIME-SHARE PROPERTY OR INTERESTS IN TIME-SHARE PROPERTY.

WYNDHAM REWARDS® is a registered trademark used under license from Wyndham Rewards, Inc. Wyndham Rewards, Inc. is not the sponsor of this promotion nor the seller of any vacation ownership product.

Earning and redemption of Wyndham Rewards points expected to be available at La Quinta® and LQ Hotel® properties in 2019.

CLUB WYNDHAM | Privacy Policy

CLUB WYNDHAM is a registered mark licensed to Wyndham Vacation Resorts, the offering developer. ©2005-2019 Wyndham Vacation Resorts. All rights reserved.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER
THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHSARE INTERESTS.
"), $templateCache.put("app/regional/extraholidays/landingpage/view/mvfamilyvacationdeals.tpl.html","

{{vm.h1}}

{{::vm.h2}}

Provided by Wyndham Vacation Resorts. Please view Offer Details below.

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your Orlando getaway:

    \t
  • 2 night\\'s accommodations in a 1-bedroom at Wyndham Bonnet Creek which can sleep up to 2 adults and 2 children (under age 18).
  • \t
  • You will receive a $100 American Express Reward Card. Terms and conditions apply to American Express ® Reward Cards. SUBJECT TO APPLICABLE LAW, A $3.00 MONTHLY SERVICE FEE WILL BE ASSESSED AGAINST CARD BALANCE STARTING 6 MONTHS AFTER CARD ISSUANCE. There is no monthly service fee on Cards shipped to New York State residents. Additional limitations may apply. See Cardholder Agreement. This Card is provided pursuant to a reward, loyalty or promotional program. Issued by American Express Prepaid Card Management Corporation.

THE RETAIL VALUE OF THIS PACKAGE RANGES FROM $178-$338.

OFFER DETAILS: You (and spouse, if married; or partner, if cohabiting) must attend a 120-minute CLUB WYNDHAM timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Extra Holidays is the marketing agent for this offer. Transportation, airfare, gratuities, parking fees, resort security deposit, meals not specifically advertised and incidentals are not included. The retail value depends on room availability and travel dates selected. You must complete your stay within 12 months from date of purchase.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, UT, VA, VT, WA, WI, WV, WY.

For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

CLUB WYNDHAM is a registered mark licensed to Wyndham Vacation Resorts, the offering developer.

'},\r\n\t\t\t\t\t\t{ title: 'Orlando Vacation Special!', name: 'Orlando Vacation Special!', hotelSlug: 'https://www.extraholidays.com/kissimmee-florida/wyndham-cypress-palms', price: '$179', image: 'https://lh3.googleusercontent.com/X9VTiE-V59cDew_7miA5VAMbnM1gcsFmkQKRA2fSLf_HOwEQJsuBEn4YY5aT9E2eVT5eTLko_1R6GZ553ocVDwLbqAzVDqGqFSty=s0', categoryName: 'Vacation Deals', hotelName: 'Wyndham Cypress Palms', cta: 'https://reservations.travelclick.com/2963?identifier=MVWYN&ProdID=672161', terms:'

Provided by Wyndham Vacation Resorts. Please view Offer Details below.

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your Orlando getaway:

    \t
  • 2 night\\'s accommodations in a 1-bedroom at Wyndham Cypress Palms which can sleep up to 2 adults and 2 children (under age 18).
  • \t
  • You will receive a $100 American Express Reward Card. Terms and conditions apply to American Express ® Reward Cards. SUBJECT TO APPLICABLE LAW, A $3.00 MONTHLY SERVICE FEE WILL BE ASSESSED AGAINST CARD BALANCE STARTING 6 MONTHS AFTER CARD ISSUANCE. There is no monthly service fee on Cards shipped to New York State residents. Additional limitations may apply. See Cardholder Agreement. This Card is provided pursuant to a reward, loyalty or promotional program. Issued by American Express Prepaid Card Management Corporation.

THE RETAIL VALUE OF THIS PACKAGE RANGES FROM $178-$338.

OFFER DETAILS: You (and spouse, if married; or partner, if cohabiting) must attend a 120-minute CLUB WYNDHAM timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Extra Holidays is the marketing agent for this offer. Transportation, airfare, gratuities, parking fees, resort security deposit, meals not specifically advertised and incidentals are not included. The retail value depends on room availability and travel dates selected. You must complete your stay within 12 months from date of purchase.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, UT, VA, VT, WA, WI, WV, WY.

For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

CLUB WYNDHAM is a registered mark licensed to Wyndham Vacation Resorts, the offering developer.

'},\r\n\t\t\t\t\t\t{ title: 'Las Vegas Vacation Special!', name: 'Las Vegas Vacation Special!', hotelSlug: 'https://www.extraholidays.com/las-vegas-nevada/wyndham-grand-desert', price: '$179', image: 'https://lh3.googleusercontent.com/2k2XQFETgbjuNqKK3aAefrrMiq97mx0CN0YDF_XUhr-kE-qQnGHifXR9iMTyn2MspovT5f7UsoppsAqd_EV5_UjjYN7gh1rLQtMqjC8=s0', categoryName: 'Vacation Deals', hotelName: 'Wyndham Grand Desert', cta: 'https://reservations.travelclick.com/2960?identifier=MVWYN&ProdID=676851', terms:'

Provided by Wyndham Vacation Resorts. Please view Offer Details below.

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your Las Vegas getaway:

    \t
  • 2 night\\'s accommodations in a 1-bedroom at Wyndham Grand Desert which can sleep up to 2 adults and 2 children (under age 18).
  • \t
  • You will receive a $100 American Express Reward Card. Terms and conditions apply to American Express ® Reward Cards. SUBJECT TO APPLICABLE LAW, A $3.00 MONTHLY SERVICE FEE WILL BE ASSESSED AGAINST CARD BALANCE STARTING 6 MONTHS AFTER CARD ISSUANCE. There is no monthly service fee on Cards shipped to New York State residents. Additional limitations may apply. See Cardholder Agreement. This Card is provided pursuant to a reward, loyalty or promotional program. Issued by American Express Prepaid Card Management Corporation.

THE RETAIL VALUE OF THIS PACKAGE RANGES FROM $338-$597.

OFFER DETAILS: You (and spouse, if married; or partner, if cohabiting) must attend a 120-minute CLUB WYNDHAM timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Extra Holidays is the marketing agent for this offer. Transportation, airfare, gratuities, parking fees, resort security deposit, meals not specifically advertised and incidentals are not included. The retail value depends on room availability and travel dates selected. You must complete your stay within 12 months from date of purchase.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, UT, VA, VT, WA, WI, WV, WY.

For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

CLUB WYNDHAM is a registered mark licensed to Wyndham Vacation Resorts, the offering developer.

'},\r\n\t\t\t\t\t\t{ title: 'Las Vegas Vacation Special!', name: 'Las Vegas Vacation Special!', hotelSlug: 'https://www.extraholidays.com/las-vegas/wyndham-desert-blue', price: '$179', image: 'https://lh3.googleusercontent.com/LllyT9ji0EaEohldiToA5bytM0Tu6TeaCr5NvoUqhEgD11DaUTr8Up6MMwxARDDxWnE1y5Ls46659XFKLPd87MSeYD0GO_q8tXZ6=s0', categoryName: 'Vacation Deals', hotelName: 'Wyndham Desert Blue', cta: 'https://reservations.travelclick.com/97093?identifier=MVWYN&ProdID=676853', terms:'

Provided by Wyndham Vacation Resorts. Please view Offer Details below.

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your Las Vegas getaway:

    \t
  • 2 night\\'s accommodations in a 1-bedroom at Wyndham Desert Blue which can sleep up to 2 adults and 2 children (under age 18).
  • \t
  • You will receive a $100 American Express Reward Card. Terms and conditions apply to American Express ® Reward Cards. SUBJECT TO APPLICABLE LAW, A $3.00 MONTHLY SERVICE FEE WILL BE ASSESSED AGAINST CARD BALANCE STARTING 6 MONTHS AFTER CARD ISSUANCE. There is no monthly service fee on Cards shipped to New York State residents. Additional limitations may apply. See Cardholder Agreement. This Card is provided pursuant to a reward, loyalty or promotional program. Issued by American Express Prepaid Card Management Corporation.

THE RETAIL VALUE OF THIS PACKAGE RANGES FROM $278-$1,018.

OFFER DETAILS: You (and spouse, if married; or partner, if cohabiting) must attend a 120-minute CLUB WYNDHAM timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Extra Holidays is the marketing agent for this offer. Transportation, airfare, gratuities, parking fees, resort security deposit, meals not specifically advertised and incidentals are not included. The retail value depends on room availability and travel dates selected. You must complete your stay within 12 months from date of purchase.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, UT, VA, VT, WA, WI, WV, WY.

For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

CLUB WYNDHAM is a registered mark licensed to Wyndham Vacation Resorts, the offering developer.

'}\r\n"+'\t\t\t\t\t ]">
Click to Explore {{vm.isProperty ? \'Offer\' : \'Resort\'}}Click to Explore {{offer.hotelName}}

{{offer.title}}{{offer.hotelName}}

{{offer.hotelCityStateText}} | Resort Overview

View DetailsBook Now

Save Up To 10% At Other Great Locations

Save Up To 10% At Other Great Locations
{{hotel.name}}
Check Rates
'),$templateCache.put("app/regional/extraholidays/landingpage/view/new.tpl.html",'

'),$templateCache.put("app/regional/extraholidays/landingpage/view/okta-login.tpl.html",''),$templateCache.put("app/regional/extraholidays/landingpage/view/owner-rental-program.tpl.html",'

'), $templateCache.put("app/regional/extraholidays/landingpage/view/paypal.tpl.html","

{{vm.h1}}

{{::vm.h2}}

Provided by Wyndham Vacation Resorts. Please view Offer Details below.

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your Orlando getaway:

    \t
  • 2 night\\'s accommodations in a 1-bedroom at Wyndham Bonnet Creek which can sleep up to 2 adults and 2 children (under age 18).
  • \t
  • You will receive a $100 American Express Reward Card. Terms and conditions apply to American Express ® Reward Cards. SUBJECT TO APPLICABLE LAW, A $3.00 MONTHLY SERVICE FEE WILL BE ASSESSED AGAINST CARD BALANCE STARTING 6 MONTHS AFTER CARD ISSUANCE. There is no monthly service fee on Cards shipped to New York State residents. Additional limitations may apply. See Cardholder Agreement. This Card is provided pursuant to a reward, loyalty or promotional program. Issued by American Express Prepaid Card Management Corporation.

THE RETAIL VALUE OF THIS PACKAGE RANGES FROM $178-$338.

OFFER DETAILS: You (and spouse, if married; or partner, if cohabiting) must attend a 120-minute CLUB WYNDHAM timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Extra Holidays is the marketing agent for this offer. Transportation, airfare, gratuities, parking fees, resort security deposit, meals not specifically advertised and incidentals are not included. The retail value depends on room availability and travel dates selected. You must complete your stay within 12 months from date of purchase.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, UT, VA, VT, WA, WI, WV, WY.

For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

CLUB WYNDHAM is a registered mark licensed to Wyndham Vacation Resorts, the offering developer.

'},\r\n\t\t\t\t\t\t{ title: 'Orlando Vacation Special!', name: 'Orlando Vacation Special!', hotelSlug: 'https://www.extraholidays.com/kissimmee-florida/wyndham-cypress-palms', price: '$179', image: 'https://lh3.googleusercontent.com/X9VTiE-V59cDew_7miA5VAMbnM1gcsFmkQKRA2fSLf_HOwEQJsuBEn4YY5aT9E2eVT5eTLko_1R6GZ553ocVDwLbqAzVDqGqFSty=s0', categoryName: 'Vacation Deals', hotelName: 'Wyndham Cypress Palms', cta: 'https://reservations.travelclick.com/2963?identifier=MVWYNPP&ProdID=672161', terms:'

Provided by Wyndham Vacation Resorts. Please view Offer Details below.

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your Orlando getaway:

    \t
  • 2 night\\'s accommodations in a 1-bedroom at Wyndham Cypress Palms which can sleep up to 2 adults and 2 children (under age 18).
  • \t
  • You will receive a $100 American Express Reward Card. Terms and conditions apply to American Express ® Reward Cards. SUBJECT TO APPLICABLE LAW, A $3.00 MONTHLY SERVICE FEE WILL BE ASSESSED AGAINST CARD BALANCE STARTING 6 MONTHS AFTER CARD ISSUANCE. There is no monthly service fee on Cards shipped to New York State residents. Additional limitations may apply. See Cardholder Agreement. This Card is provided pursuant to a reward, loyalty or promotional program. Issued by American Express Prepaid Card Management Corporation.

THE RETAIL VALUE OF THIS PACKAGE RANGES FROM $178-$338.

OFFER DETAILS: You (and spouse, if married; or partner, if cohabiting) must attend a 120-minute CLUB WYNDHAM timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Extra Holidays is the marketing agent for this offer. Transportation, airfare, gratuities, parking fees, resort security deposit, meals not specifically advertised and incidentals are not included. The retail value depends on room availability and travel dates selected. You must complete your stay within 12 months from date of purchase.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, UT, VA, VT, WA, WI, WV, WY.

For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

CLUB WYNDHAM is a registered mark licensed to Wyndham Vacation Resorts, the offering developer.

'},\r\n\t\t\t\t\t\t{ title: 'Las Vegas Vacation Special!', name: 'Las Vegas Vacation Special!', hotelSlug: 'https://www.extraholidays.com/las-vegas-nevada/wyndham-grand-desert', price: '$179', image: 'https://lh3.googleusercontent.com/2k2XQFETgbjuNqKK3aAefrrMiq97mx0CN0YDF_XUhr-kE-qQnGHifXR9iMTyn2MspovT5f7UsoppsAqd_EV5_UjjYN7gh1rLQtMqjC8=s0', categoryName: 'Vacation Deals', hotelName: 'Wyndham Grand Desert', cta: 'https://reservations.travelclick.com/2960?identifier=MVWYNPP&ProdID=676851', terms:'

Provided by Wyndham Vacation Resorts. Please view Offer Details below.

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your Las Vegas getaway:

    \t
  • 2 night\\'s accommodations in a 1-bedroom at Wyndham Grand Desert which can sleep up to 2 adults and 2 children (under age 18).
  • \t
  • You will receive a $100 American Express Reward Card. Terms and conditions apply to American Express ® Reward Cards. SUBJECT TO APPLICABLE LAW, A $3.00 MONTHLY SERVICE FEE WILL BE ASSESSED AGAINST CARD BALANCE STARTING 6 MONTHS AFTER CARD ISSUANCE. There is no monthly service fee on Cards shipped to New York State residents. Additional limitations may apply. See Cardholder Agreement. This Card is provided pursuant to a reward, loyalty or promotional program. Issued by American Express Prepaid Card Management Corporation.

THE RETAIL VALUE OF THIS PACKAGE RANGES FROM $338-$597.

OFFER DETAILS: You (and spouse, if married; or partner, if cohabiting) must attend a 120-minute CLUB WYNDHAM timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Extra Holidays is the marketing agent for this offer. Transportation, airfare, gratuities, parking fees, resort security deposit, meals not specifically advertised and incidentals are not included. The retail value depends on room availability and travel dates selected. You must complete your stay within 12 months from date of purchase.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, UT, VA, VT, WA, WI, WV, WY.

For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

CLUB WYNDHAM is a registered mark licensed to Wyndham Vacation Resorts, the offering developer.

'},\r\n\t\t\t\t\t\t{ title: 'Las Vegas Vacation Special!', name: 'Las Vegas Vacation Special!', hotelSlug: 'https://www.extraholidays.com/las-vegas/wyndham-desert-blue', price: '$179', image: 'https://lh3.googleusercontent.com/LllyT9ji0EaEohldiToA5bytM0Tu6TeaCr5NvoUqhEgD11DaUTr8Up6MMwxARDDxWnE1y5Ls46659XFKLPd87MSeYD0GO_q8tXZ6=s0', categoryName: 'Vacation Deals', hotelName: 'Wyndham Desert Blue', cta: 'https://reservations.travelclick.com/97093?identifier=MVWYNPP&ProdID=676853', terms:'

Provided by Wyndham Vacation Resorts. Please view Offer Details below.

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your Las Vegas getaway:

    \t
  • 2 night\\'s accommodations in a 1-bedroom at Wyndham Desert Blue which can sleep up to 2 adults and 2 children (under age 18).
  • \t
  • You will receive a $100 American Express Reward Card. Terms and conditions apply to American Express ® Reward Cards. SUBJECT TO APPLICABLE LAW, A $3.00 MONTHLY SERVICE FEE WILL BE ASSESSED AGAINST CARD BALANCE STARTING 6 MONTHS AFTER CARD ISSUANCE. There is no monthly service fee on Cards shipped to New York State residents. Additional limitations may apply. See Cardholder Agreement. This Card is provided pursuant to a reward, loyalty or promotional program. Issued by American Express Prepaid Card Management Corporation.

THE RETAIL VALUE OF THIS PACKAGE RANGES FROM $278-$1,018.

OFFER DETAILS: You (and spouse, if married; or partner, if cohabiting) must attend a 120-minute CLUB WYNDHAM timeshare sales presentation. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Extra Holidays is the marketing agent for this offer. Transportation, airfare, gratuities, parking fees, resort security deposit, meals not specifically advertised and incidentals are not included. The retail value depends on room availability and travel dates selected. You must complete your stay within 12 months from date of purchase.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, UT, VA, VT, WA, WI, WV, WY.

For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

CLUB WYNDHAM is a registered mark licensed to Wyndham Vacation Resorts, the offering developer.

'}\r\n\t\t\t\t\t\t\r\n"+'\t\t\t\t\t ]">
Click to Explore {{vm.isProperty ? \'Offer\' : \'Resort\'}}Click to Explore {{offer.hotelName}}

{{offer.title}}{{offer.hotelName}}

{{offer.hotelCityStateText}} | Resort Overview

View DetailsBook Now

Save Up To 10% At Other Great Locations

Save Up To 10% At Other Great Locations
{{hotel.name}}
Check Rates
'),$templateCache.put("app/regional/extraholidays/landingpage/view/rokt-minivac.tpl.html","
Provided by Wyndham Vacation Resorts. Please view the Offer Details below.

*Note: The earliest that guests can arrive is 8 days from the date the package was purchased.

Here\\'s what\\'s included in your getaway:

  • night\\'s accommodations in a 1-bedroom at which can sleep up to 2 adults and 2 children.
  • You will receive a $100 American Express Reward Card.  Terms and conditions apply to American Express ® Reward Cards.  SUBJECT TO APPLICABLE LAW, A $3.00 MONTHLY SERVICE FEE WILL BE ASSESSED AGAINST CARD BALANCE STARTING 6 MONTHS AFTER CARD ISSUANCE. There is no monthly service fee on Cards shipped to New York State residents.  Additional limitations may apply. See Cardholder Agreement. This Card is provided pursuant to a reward, loyalty or promotional program. Issued by American Express Prepaid Card Management Corporation.
  • As part of your vacation package, you will join us for a Club Wyndham presentation to learn about great vacation products and tour our beautiful resort.

THE VERIFIABLE RETAIL VALUE OF THIS PACKAGE RANGES FROM .

OFFER DETAILS

You must attend a 120-minute Club Wyndham timeshare sales presentation with your partner, if married or cohabitating. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Extra Holidays is the marketing agent for this offer. Transportation, airfare, nightly room taxes (), gratuities, parking fees, resort security deposit, and incidentals are not included. The verifiable retail value depends on room availability and travel dates selected. If your package is purchased between January 1st and May 15th, travel must be completed by December 31st of the current calendar year. If your package is purchased after May 15th, travel must be completed within 12 months of the purchase date. For NY Residents: The price range of interests offered varies from $11,800 - $92,700 and is subject to change without notice.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DC, DE, FL, GA, HI, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, PR, RI, SC, TN, TX, UT, USVI, VA, VT, WA, WI, WV, WY.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING THE SALE OF TIME-SHARE PROPERTY OR INTERESTS IN TIME-SHARE PROPERTY.

';\">

{{offer.title}}

Resort Overview

Book Now
 
3-Days/2-Nights$199
',offer.city).replace('',2).replace('', offer.priceRange).replace('', offer.taxRange).replace('',offer.hotelName)})\" target=_blank>View Details
4-Days/3-Nights$279
',offer.city).replace('',3).replace('', offer.priceRangeHigh).replace('', offer.taxRange).replace('',offer.hotelName)})\" target=_blank>View Details
"), $templateCache.put("app/regional/extraholidays/landingpage/view/vacation-pass.tpl.html","
\"{{vm.headerImageAlt \"{{vm.headerImageAlt

{{adventure.city}}

{{adventure.city}}

'), $templateCache.put("app/regional/extraholidays/landingpage/view/wr-getaways.tpl.html","

{{vm.h1}}

{{::vm.h2}}

OFFER DETAILS

You, and your spouse if married or partner if cohabitating, must attend a 120-minute timeshare sales presentation. Offer expires February 29, 2024. Must complete your stay by May 22, 2024. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Earliest available check-in is 14 days from the vacation purchase date. Verifiable Retail Value $198 - $1,498, depending on destination, room availability and travel dates selected. Reservations are subject to availability. Transportation, airfare, gratuities, nightly room taxes (), parking fees, resort security deposit, meals, and incidentals are not included. Offer brought to you by Wyndham Vacation Resorts and Extra Holidays, 6277 Sea Harbor Drive, Orlando, Florida, 32821.

If you do not attend the presentation, you will forfeit the Wyndham Rewards points you redeem, be charged $150 per night and will not be refunded your deposit, unless otherwise prohibited by law.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, VA, VT, WA, DC, WY. Void where prohibited by law. The price range of interests offered varies from and is subject to change without notice.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

WYNDHAM REWARDS® is a registered trademark used under license from Wyndham Rewards, Inc. Wyndham Rewards, Inc. is not the sponsor of this promotion nor the seller of any vacation ownership product.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

Guests who are holders of the Wyndham Rewards Earner® Card, Wyndham Rewards Earner® Plus Card, Wyndham Rewards Earner® Business Card or Wyndham Rewards Earner® Access Card are required to redeem 6,750 or 13,500 Wyndham Rewards points per bedroom to secure booking; all other eligible points are required to redeem 7,500 or 15,000 Wyndham Rewards points to secure booking. Points will be removed from Wyndham Rewards member account within one week of booking.

\\'>
\\'>
';\">
Resorts for 7,500 Wyndham Rewards Points

{{offer.title}}

3-Days/2-Nights

Resort Overview

Book Now
 
View Details

Offer Details

You, and your spouse if married or partner if cohabitating, must attend a 120-minute timeshare sales presentation. Offer expires February 29, 2024. Must complete your stay by May 22, 2024. Please read our Terms and Conditions to see if you meet the minimum eligibility requirements. Earliest available check-in is 14 days from the vacation purchase date. Verifiable Retail Value $198 - $1,498, depending on destination, room availability and travel dates selected. Reservations are subject to availability. Transportation, airfare, gratuities, nightly room taxes ($20 - $173), parking fees, resort security deposit, meals, and incidentals are not included. Offer brought to you by Wyndham Vacation Resorts and Extra Holidays, 6277 Sea Harbor Drive, Orlando, Florida, 32821.

If you do not attend the presentation, you will forfeit the Wyndham Rewards points you redeem, be charged $150 per night and will not be refunded your deposit, unless otherwise prohibited by law.

This offer is valid only for residents of the following states: AK, AL, AR, AZ, CA, CO, CT, DE, FL, GA, IA, ID, IL, IN, KS, KY, LA, MA, MD, ME, MI, MN, MO, MS, NC, NE, NH, NJ, NM, NV, NY, OH, OK, OR, PA, RI, SC, TN, TX, VA, VT, WA, DC, WY. Void where prohibited by law. The price range of interests offered varies from $14,800 - $97,100 and is subject to change without notice.

THIS ADVERTISING MATERIAL IS BEING USED FOR THE PURPOSE OF SOLICITING SALES OF TIMESHARE INTERESTS.

WYNDHAM REWARDS® is a registered trademark used under license from Wyndham Rewards, Inc. Wyndham Rewards, Inc. is not the sponsor of this promotion nor the seller of any vacation ownership product.

THE COMPLETE OFFERING TERMS ARE IN AN OFFERING PLAN AVAILABLE FROM THE DEVELOPER.

Guests who are holders of the Wyndham Rewards Earner® Card, Wyndham Rewards Earner® Plus Card, Wyndham Rewards Earner® Business Card or Wyndham Rewards Earner® Access Card are required to redeem 6,750 or 13,500 Wyndham Rewards points per bedroom to secure booking; all other eligible points are required to redeem 7,500 or 15,000 Wyndham Rewards points to secure booking. Points will be removed from Wyndham Rewards member account within one week of booking.

View Complete Terms & Conditions

'), $templateCache.put("app/regional/extraholidays/meetings/view/meetings.tpl.html",'
{{vm.headerImageAlt || vm.h2 || vm.h1 || \'Featured Image\'}} {{vm.headerImageAlt || vm.h2 || vm.h1 || \'Featured Image\'}}

Groups & Meetings {{::vm.h1}}

{{::vm.h2}}

1-3 Bedroom Suites

Washers and Dryers

Full or Partial Kitchens

Amenities & Activities Programs

Request Group Information

Ready to get the crew together? Whether for a small social gathering or a larger group, Extra Holidays easily accommodates groups at resorts located across the United States and in the Caribbean. Fill out the form below to get started.
"),$templateCache.put("app/regional/extraholidays/nearby/view/nearby-listing.tpl.html",'
Item Thumb
{{::vm.item.name}} $
{{vm.item.types[0] | properCaps}} neaby-card-icon {{vm.item.types[1] | properCaps}}

{{::vm.item.formatted_address}}

{{::vm.item.rating}}   ({{::vm.item.user_ratings_total}})

{{::vm.item.formatted_phone_number}}

{{::vm.item.website}}

{{date | date:\'EEEE\'}}

{{::weekday}}

Recent Reviews

{{ ::review.author_name }}

{{ ::review.text }}
{{ ::review.text }} More...
{{vm.showMoreReviews ? "Show Less" : \'Show More Reviews\'}}
Local Resorts
'),$templateCache.put("app/regional/extraholidays/nearby/view/nearby.tpl.html",'

Explore Nearby Things to Do

Explore Nearby Things to Do

Things to Do {{::vm.h1}}

Things to Do Near

Please check again soon for fun attractions and things to do near {{vm.property.name}}!

{{::category.name}}

{{::item.name}}
On-Site

{{::item.name}} 

{{::item.streetAddress}}, {{::item.addressLocality}}, {{::item.addressRegion}} {{::item.postalCode}}  
{{vm.getDistanceFromHotel(item) | number : 1}} mi. away  
'), $templateCache.put("app/regional/extraholidays/offers/view/eh-travelclick-widget.tpl.html",'

{{currentCategory.title || currentCategory.name}}

{{::currentCategory.subtitle}}

All Countries{{hotel.country}}
All States{{state.name}}
All Destinations{{destination.name}}
All Resorts{{hotel.name}} - {{hotel.cityState}}
Check In
{{checkinDate | date : "M/d/yy"}}
Check Out
{{checkoutDate | date : "M/d/yy"}}
 Search
ListGrid
Select a state to start searching for resorts.
The dates you selected are not available, please select alternative dates or check the booking engine.
Tip #1 – For a full calendar of available dates, use the desktop version of this page.
Tip #2 – Remember that the Family Rental Rate may be an option at 30% off.
One moment while we check resort availability...
Click to Book {{vm.isProperty ? \'Offer\' : \'Resort\'}}
Find Dates
{{!offer.viewRooms ? \'View\' : \'Hide\'}} Rooms
From ${{rate.rate | number:0}}/Night
{{room.roomTypeName}}
{{feature.type}}: {{feature.quantity}} {{feature.amenityName}}{{feature.amenityName != \'People\' && feature.quantity > 1 ? \'s\' : \'\'}}  
'), $templateCache.put("app/regional/extraholidays/offers/view/offer-category.tpl.html",'
{{vm.headerImageAlt || vm.h2 || vm.h1 || \'Featured Image\'}} {{vm.headerImageAlt || vm.h2 || vm.h1 || \'Featured Image\'}}

Coming soon.... The campaign starts on September 18.

Get ready for a vacation extravaganza like never before! 🌴 For the next 12 days, indulge in unbeatable daily offers that will give you something extra for your dream getaway✨

Each offer lasts only 24 hours🕒 – you won\'t want to miss out on these limited-time deals. Join Insider Extras to unlock the Extra Rewards when you book. Let the countdown to your next getaway begin.

View Today\'s Deals

Get Ready for a New Deal

Last Chance!

Come back to reveal the mystery deal on Sept 30!

Today\'s Deals

{{dayTile.title}}

{{dayTile.copy}}

All Countries{{country.name}}All States{{state.name}}All Destinations{{destination.name}} All Resorts{{hotel.name}} - {{hotel.cityState}}Clear Filters
Choose a resort for: {{::categoryNav.menuName}} View All View All See Offer Details below.
ListGrid
Click to Explore {{vm.isProperty ? \'Offer\' : \'Resort\'}}{{offer.title || offer.hotelName}} {{offer.title || offer.hotelName}} {{offer.oldPrice}} {{offer.price}} {{offer.title || offer.hotelName}} {{offer.title || offer.hotelName}} {{offer.oldPrice}} {{offer.price}}

{{offer.title}}{{offer.hotelName}}

{{offer.hotelCityStateText}} | Resort Overview

Available at Multiple Resorts

{{offer.categoryName}}

View ResortOffer Details
{{offer.cta_label || \'Check Rates\'}}View Offer Resorts

'), $templateCache.put("app/regional/extraholidays/offers/view/offer.tpl.html",'
{{::vm.offer.title}}

{{::vm.offer.title}} {{::vm.offer.title}} {{::vm.h1}}

{{::vm.offer.hotelCityStateText}} |

{{::vm.offer.price}}

{{::vm.offer.cta_label || \'See Availability\'}}
'),$templateCache.put("app/regional/extraholidays/offers/view/offers.tpl.html",'

Special offers from Extra Holidays

Special offers from Extra Holidays

Specials and Packages {{vm.h1}}

Specials

{{category.title}}

{{category.showOfferTerms ? \'Hide Terms\' : \'View Terms\'}}
View {{category.totalOffers > 1 ? \'Specials\' : \'Special\'}}
Please check again soon for the latest offers and seasonal specials from {{vm.property.name | trustAsHTML}}!
Click to Explore {{vm.isProperty ? \'Offer\' : \'Resort\'}}{{offer.price}} {{offer.title || offer.hotelName}} {{offer.price}} {{offer.title || offer.hotelName}} {{offer.price}} {{offer.title || offer.hotelName}}
Offer DetailsOffer Details
{{offer.cta_label || \'Book Now\'}}
Load More
'),$templateCache.put("app/regional/extraholidays/photos/view/photos.tpl.html",'

Explore Our Resort Photo Galleries

{{::vm.h2}}

Explore Our Resort Photo Galleries

{{::vm.h2}}

{{vm.selectedDestination}} Resort Photo Galleries {{::vm.h1}}

Photo Gallery

All Countries{{country.name}}All States{{state.name}}All Destinations{{destination.name}}All Resorts{{hotel.name}} - {{hotel.cityName}}, {{hotel.stateName}}
 View the Virtual Tour
All Images
{{image.alt || image.title || (\'Gallery photo \' + ($index + 1) + \' from \' + vm.property.name)}}
'),$templateCache.put("app/regional/extraholidays/reviews/view/reviews.tpl.html",'
Read Recent {{::vm.property.LocationName}} Reviews
{{ ::review.user[0] }}

{{ ::review.user }} - {{ ::review.date }}

{{ ::review.comment }}
{{ ::review.comment }} More...
{{vm.showMoreReviews ? "Show Less" : \'Show More Reviews\'}}
Call
'), $templateCache.put("app/regional/extraholidays/rooms/view/room.tpl.html",'

{{::vm.itemOffered.name}}

Photos shown may vary from the actual unit you receive, but are typical of the room category you booked.
Read More

Premium Amenities

{{::amenity.name}} {{::amenity.name}}

Resort Suite Amenities

{{::amenity.name}}{{::amenity.name}}

Premium Amenities

{{::amenity.name}}{{::amenity.name}}

View all Rooms
View Room Photos{{::vm.itemOffered.name}}
Click to View Photos

Maximum Occupancy: {{::vm.itemOffered.occupancy.maxValue}} 

Bed Details

{{::bed.name}} Bed Icon {{::bed.numberOfBeds}} {{::bed.name}}{{bed.numberOfBeds > 1 ? \'s\' : \'\'}}

Check Rates
{{::vm.itemOffered.image.title}}
View Floor Plan
'),$templateCache.put("app/regional/extraholidays/rooms/view/rooms.tpl.html",'

Rooms & Suites at

Photos shown may vary from the actual unit you receive, but are typical of the room category you booked.
Please check again soon for room information from {{vm.property.name}}!
Read More
{{offer.itemOffered.name}}
From
{{[\'USD\',\'CAD\',\'AUD\',\'NZD\'].indexOf(offer.priceCurrency) > -1 ? \'$\' : \'\'}}{{[\'JPY\',\'CNY\'].indexOf(offer.priceCurrency) > -1 ? \'¥\' : \'\'}}{{[\'IDR\'].indexOf(offer.priceCurrency) > -1 ? \'Rp\' : \'\'}}{{offer.price | number:0}}
{{offer.priceCurrency || \'USD\'}}/{{[\'116083\'].indexOf(vm.property.hotelCode) > -1 ? \'person\' : \'night\'}}
Not available
for selected dates
{{offer.itemOffered.name}}
Max Occupancy: {{offer.itemOffered.occupancy.maxValue}} 
{{::bed.numberOfBeds}} {{::bed.name}}{{bed.numberOfBeds > 1 ? \'s\' : \'\'}}  
'), $templateCache.put("app/regional/extraholidays/search/view/search.tpl.html","
Search Extra Holidays
Check In
{{vm.checkinDate | date : \'d\'}}
{{vm.checkinDate | date : \'MMM yyyy\'}}
{{vm.checkinDate | date : \'EEEE\'}}
Check Out
{{vm.checkoutDate | date : \'d\'}}
{{vm.checkoutDate | date : \'MMM yyyy\'}}
{{vm.checkoutDate | date : \'EEEE\'}}
Search Options
Where To?
{{item.displayString || item.name | trustAsHTML}}{{item.resortCount ? (item.state ? \', \'+item.state : \'\') : \'\'}}Whoops, no locations found for "{{vm.searchWords | trustAsHTML}}"
Search Query
{{vm.searchWords | trustAsHTML}}
Search by Experience
Select an Experience
BeachesGolfingFamilyFunSki
Clear Selection
Apply ({{(vm.searchFilters[\'tripType\'].length && vm.searchFilters[\'tripType\'].length != 6) ? vm.searchFilters[\'tripType\'].length : \'All\'}} Experience{{vm.searchFilters[\'tripType\'].length != 1 ? \'s\' : \'\'}})
Sort Order
Sort By
RecommendedAlphabetical - A to ZAlphabetical - Z to APrice (Low to High)Price (High to Low)Distance (Closest)
Whoops, no resorts found for that search.
Please broaden your terms and try again.
 
'),$templateCache.put("app/regional/extraholidays/sitemap/view/sitemap.tpl.html",'

Extra Holidays

Extra Holidays

'),$templateCache.put("app/regional/extraholidays/stories/view/stories.tpl.html",'

Stories from {{::vm.siteName}} {{::vm.h1}} {{::vm.currentCategory}} | Stories from {{::vm.siteName}}

{{::vm.h2}}

{{story.title}}
{{story.bodyContent}}
Read More
View story
Load More
'), $templateCache.put("app/regional/extraholidays/stories/view/story.tpl.html",'
{{::vm.story.title}}

')}]);