var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,f,g){if(g.get||g.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[f]=g.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_"; $jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(a){return $jscomp.SYMBOL_PREFIX+(a||"")+$jscomp.symbolCounter_++}; $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(a){var f=0;return $jscomp.iteratorPrototype(function(){return fg;)--b in this?this[--a]=this[b]:delete this[a];return this}},"es6-impl","es3"); var itsMustache=function(a){function f(t){t&&(a.templates=t);a.templates&&(x=a.templates)}function g(t,c){a.templates||(a.templates={});a.templates[t]=c;a.templates&&(x=a.templates)}function b(t,c,k){for(var l=0,d=t.length;le;e++)h[e]=0;l[d]=h}})();(function(){for(var c=0,h= l.length;cl;l++)h[l]=0;e[d]=h}})();(function(){for(var e=0,a=L.length;ek.points.length)return console.error("cannot add polygon with less than three points"),!1;null!==f&&d();f=new google.maps.Polygon({paths:k.points,map:c,strokeColor:"#ffffff", strokeOpacity:.8,strokeWeight:2,fillColor:"#02ff02",fillOpacity:.45});k.center=g(k.points);for(var e=k,h=k.points,b=0,q=new N(k.center),n=0;nb&&(b=r)}e.radius=b;k.label=l();a&&(e=k.Dup(),e.label="",e.type="circle",p=new z(c,e));return!0}function g(a){var c=new y(0,0);a.forEach(function(a){c.lat+=a.lat;c.lng+=a.lng});c.lat/=a.length;c.lng/=a.length;return c}var f=new google.maps.Polyline({map:c,strokeColor:"#ffffff", strokeOpacity:.8,strokeWeight:2}),m=new u(c),k=function(a){if(!a)return new v("","","polygon",null,0,null);if(a.constructor!==v)console.error("invalid location type",a);else return setTimeout(e,0),a}(b),p=null;this.getLabel=l;this.getType=function(){return"polygon"};this.getLocation=function(){return k.Dup()};this.getID=function(){return k.id};this.setLabel=n;this.setID=function(a){k.id=a};this.setPaths=q;this.setFocus=function(){h("#02ff02","#ffffff");c.setCenter(k.center);Z(c,k.radius)};this.unsetFocus= function(){h("#f4e842","#666666")};this.insertPath=function(a){k.points.push(a);q(k.points);m.insert(a)};this.render=e;this.remove=d}function u(a){var c=[];this.insert=function(b){b.constructor!==y?console.error("invalid type",b):(b=new L(a,b),c.push(b))};this.remove=function(){c.forEach(function(a){a.remove()})};this.setFocus=function(){c.forEach(function(a){a.setFocus()})};this.unsetFocus=function(){c.forEach(function(a){a.unsetFocus()})}}function L(a,b){function c(a,c){l.setOptions({fillColor:a, strokeColor:c})}var l=new google.maps.Circle({strokeColor:"#ff0000",strokeOpacity:1,strokeWeight:2,fillColor:"#ff0000",fillOpacity:1,map:a,center:b,radius:function(){var c=a.getZoom(),c=Math.pow(2,18-c);1E3c&&(c=1);return c}()});this.setFocus=function(){c("#02ff02","#ffffff")};this.unsetFocus=function(){c("#f4e842","#666666")};this.remove=function(){l.setMap(null)}}function N(a){this.lat=function(){return a.lat};this.lng=function(){return a.lng}}function F(a,b,g,n,f){n.Put("radiusThreshold", f.radiusThreshold);this.name=new p(b,f);this.lookback=new w(b,f);this.search=new D(b,n);this.within=new M(b,n,"Within","within");this.radius=new M(b,n,"Radius","radius");this.mapType=P.New(b,g,n,"mapType",a.mapTypes,function(a){g.setMapTypeId(a)});this.radiusThreshold=P.New(b,g,n,"radiusThreshold",a.radiusThresholds,function(a){return function(c){a.radiusThreshold=c}}(f));this.goBtn=da.New(b,n,"Go","goButton")}function R(a,b,f,g,q){var c=document.createElement("control-opts");c.appendChild(function(){var a= document.createElement("h3");a.textContent="Control options";return a}());var d=new F(q,c,b,f,g);d.hideAll();a.appendChild(c);f.Sub("activeControl",function(a){var b=0;d.search.setEmpty();H(a,"nameInput")?(d.name.show(),b++):d.name.hide();H(a,"lookbackInput")?(d.lookback.show(),b++):d.lookback.hide();H(a,"search")?(d.search.show(),b++):d.search.hide();H(a,"within")?(d.within.show(),b++):d.within.hide();H(a,"radius")?(d.radius.show(),b++):d.radius.hide();H(a,"mapType")?(d.mapType.show(),b++):d.mapType.hide(); H(a,"radiusThreshold")?(d.radiusThreshold.show(),b++):d.radiusThreshold.hide();H(a,"goButton")?(d.goBtn.show(),b++):d.goBtn.hide();c.style.display=0b?a.setZoom(16):500>b?a.setZoom(14):1E3>b?a.setZoom(12):5E3>b?a.setZoom(11):1E4>b?a.setZoom(10):15E3>b? a.setZoom(8):a.setZoom(7)}function ba(a){X?a():aa.push(a)}var X=!1,aa=[],ca=new y(32.7767,-96.797);(function(){if(google&&google.maps&&google.maps.places)setTimeout(f.Init);else{var a=document.createElement("script");a.type="application/javascript";a.src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCNXQ2K0aI31ZI5iJezmmEf41H-PsaRlKs&callback=DrawMap.Init&libraries=places,geometry";document.head.appendChild(a)}})();f.prototype.New=function(a,f,g,m){return new b(a,f,g,m)};f.prototype.Init=function(){X|| (X=!0,aa.forEach(function(a){a()}))};m.prototype.Dup=function(){return this?new m(this):new m({})};m.prototype.GetLocation=function(a){var b=null;this.locations.some(function(c){if(c.id===a)return b=c,!0});return b};v.prototype.Dup=function(){return new v(this.id,this.label,this.type,this.center,this.radius,this.points.copyWithin(),this.address)};y.prototype.isValid=function(){return isNaN(this.lat)?(console.error("Invalid latitude provided",this.lat),!1):isNaN(this.lng)?(console.error("Invalid longitude provided", this.lng),!1):!0};F.prototype.forEach=function(a){var b=this;Object.keys(b).forEach(function(c){a(b[c])})};F.prototype.hideAll=function(){this.forEach(function(a){a.hide()})};var P=function(){function a(a,c,e,f,g,l){return new b(a,c,e,f,g,l)}function b(a,b,c,g,l,m){function d(a){return q.some(function(b){return b.key===a?(b.set(),!0):!1})}function e(a){p&&p.unsetActive();p=a;p.setActive();m&&m(a.getValue())}var h=new EventManager,n=document.createElement("multi-select-container"),q=[],p=null,r=c.Get(g); l.forEach(function(a,b){var c=new f(n,a,m);(void 0!==r&&null!==r||0!==b)&&c.getValue()!==r||e(c);h.add(c.getElement(),"click",function(a){return function(b){b.preventDefault();e(a)}}(c));q.push(c)});a.appendChild(n);c.Sub(g,d);this.show=function(){n.style.display=""};this.hide=function(){n.style.display="none"};this.set=d;this.exit=function(){h.reset();removeChild(a,n);n.innerHTML=""}}function f(a,b,c){var d=document.createElement("multi-select"),e=b.value,g=b.label;d.textContent=b.label;a.appendChild(d); this.getElement=function(){return d};this.getValue=function(){return e};this.getLabel=function(){return g};this.setActive=function(){d.classList.add("active")};this.unsetActive=function(){d.classList.remove("active")};this.remove=function(){removeChild(a,d)}}function g(a,b){return new m(a,b)}function m(a,b){this.value=a;this.label=b}return new function(){this.New=a;this.NewEntry=g}}(),da=function(){function a(a,c,g,d){return new b(a,c,g,d)}function b(a,b,c,d){function e(a){a.preventDefault();b.Put(d, !0)}var f=g(c);f.addEventListener("click",e);a.appendChild(f);this.show=function(){f.style.display=""};this.hide=function(){f.style.display="none"};this.exit=function(){removeChild(a,f);f.removeEventListener("click",e)}}function g(a){var b=document.createElement("a");b.classList.add("coButton");b.textContent=a;return b}return new function(){this.New=a}}();return new f}(!1);