var role = localStorage.getItem('role');
var tier = {
  t1: true,
  t2: true,
  t3: true,
  t4: true,
  'elastic': true
}
var startpage = true;
var isAdmin = 'admin';
var isManager = 'manager';
var isReporter = 'reporter';
var isScheduler = 'scheduler';
var isFieldinstaller = 'fieldinstaller';
var isSalesman = 'salesman';
var isWarehouse = 'warehouse';
var isStrategicDevelopment = 'stratdev';
var isSupportAssistant = 'supportassistant';
var isOutsideSales = 'outsidesales';
var isInFieldSupervisor = 'infieldsupervisor';
var isChatting = false;
var isKeyboardHide = true;
var time_refresh = 60 * 15 * 1000;
var time_idle = 5 * 60 * 1000;
var time_offline = 25 * 60 * 1000;
var templateLoading = "<ion-spinner icon='bubbles'></ion-spinner>";
var url_site = 'http://hungcaos3.glinkdeployments.com/crm-apar1/trunk/public';
var url_server = 'http://hungcaos3.glinkdeployments.com/crm-apar1/trunk/public/';
var server_chat = 'http://haiphams3.glinkdeployments.com:3008';
var server_chat_ip = 'http://haiphams3.glinkdeployments.com:3008';

// var url_site = 'http://haiphams2.glinkdeployments.com/crm2019-apar1/public';
// var url_server = 'http://haiphams2.glinkdeployments.com/crm2019-apar1/public/';
// var server_chat = 'http://haiphams2.glinkdeployments.com:3008';
// var server_chat_ip = 'http://haiphams2.glinkdeployments.com:3008';
// var url_site = 'https://app.reliablegaragedoor.com';
// var url_server = 'https://app.reliablegaragedoor.com/';
// var server_chat = 'https://app.reliablegaragedoor.com:3000';
// var server_chat_ip = 'https://app.reliablegaragedoor.com:3000';
// var url_site = 'https://app.reliablegaragedoor.com/crm-dev/public';
// var url_server = 'https://app.reliablegaragedoor.com/crm-dev/public/';
// var server_chat = 'https://app.reliablegaragedoor.com:3001';
// var url_site = 'https://app2.reliablegaragedoor.com';
// var url_server = 'https://app2.reliablegaragedoor.com/';
// var server_chat = 'https://app2.reliablegaragedoor.com:3000';
// var server_chat_ip = 'https://app2.reliablegaragedoor.com:3000';
var headers = {
  'Access-Control-Allow-Origin': '*',
  'locationpage': window.location.href
};
var config_chat = {
  'reconnection': true,
  'reconnectionDelay': 1000,
  'reconnectionDelayMax': 5000,
  'reconnectionAttempts': 10000
};
var isiOs = true;
var dispathRoomId = 2;
var currentIdLogin = localStorage.getItem('currentIdLogin');
var departmentId = localStorage.getItem('departmentId');
var bucketName = 'rgdapp';
var aclConfig = 'public-read';
var settingChat = {
  "isnotification": "1",
  "isnotifybackground": "1",
  "issound": "1",
  "sound_id": "1"
};
//for notetask color by status
var pendingColor = '#ea9999';
var enrouteColor = '#1155CC';
var workingColor = '#38761D';
var finishColor = '#B7B7B7';
var appStatusColor = '#F2E311';
var flagColorObj = [{
  id: 1,
  nclass: 'flag-yellow'
}, {
  id: 2,
  nclass: 'flag-orange'
}, {
  id: 3,
  nclass: 'flag-red'
}, {
  id: 4,
  nclass: 'flag-green'
}];
var defaultImage = 'resources/images/thumnails/profile-default.png';
var userSerectId = '3779';
var aplicationtype = {
  text: 'text',
  image: 'images',
  file: 'file',
  link: 'link'
};
var myFollowUpName = 'My Follow-Up';
var asapServiceName = 'ASAP SERVICE';
var storeInCloud = localStorage.getItem('storeInCloud') ? localStorage.getItem('storeInCloud') : true;
console.log('storeInCloud', storeInCloud);
// var storeInCloud = false;
var request_check_punch_inout = localStorage.getItem('request_check_punch_inout') ? localStorage.getItem('request_check_punch_inout') : true;
conFig = function() {}
conFig.url = 'templates/';
conFig.formatDate = 'MM/dd/yyyy';
conFig.fLongDate = 'MM/dd/yyyy h:mm:ss a';
conFig.momentfLongDate = 'MM/dd/yyyy H:mm:ss';
conFig.fDatetoServer = 'm/d/Y';
// for flag customer - work temp
var pathToPublic = getCurrentPathToPublic();
var NoCAId = 10;
var differentNoCaAndRouteColor = '#AA56FF';
var customer_type_new_customer_id = 1;
// for check parameter
function getParameterByName(name) {
  var name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
  var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
    results = regex.exec(location.search);
  return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}
// function getParameterByNameForIonic(name,url) {
//     var urlArray = url.split("?");
//     var name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
//     var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
//         results = url;
//     return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
// }
// for check path
function getCurrentPathToPublic() {
  var loc = window.location.pathname;
  var dir = loc.substring(0, loc.lastIndexOf('/'));
  return dir + '/';
}
// for unility
function differentArray(arr1, arr2) {
  return _.reject(arr1, function(obj) {
    return _.findWhere(arr2, obj);
  });
}
// parse full date
function globalParseDate(value) {
  var d = new Date(value);
  var m = String(d.getMonth()).length == 1 ? '0' + String(d.getMonth() + 1) + "/" : d.getMonth() + 1 + "/";
  m += String(d.getDate()).length == 1 ? '0' + String(d.getDate()) + "/" : d.getDate() + "/";
  return new Date(m + d.getFullYear());
}
// for call phone
function callphonenumber($this) {
  using_mobile = navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(andRoid)|(Linux)|(webOS)/i) != null;
  if (using_mobile) {
    return;
  }
  $.ajax({
    url: server_call + '/call.php?exten=SIP/' + current_ext + '&number=' + String($($this).attr('phone-number')).replace(/[^0-9]/g, ''),
    type: 'POST',
    dataType: 'json',
    data: {}
  })
}
// for unility
function arrayUnion(arr1, arr2, equalityFunc) {
  if (!arr1) {
    var arr1 = [];
  }
  if (!arr2) {
    var arr2 = [];
  }
  var union = arr1.concat(arr2);
  for (var i = 0; i < union.length; i++) {
    for (var j = i + 1; j < union.length; j++) {
      if (equalityFunc(union[i], union[j])) {
        union.splice(j, 1);
        j--;
      }
    }
  }
  return union;
}

function setGoogleMap(idElm, address) {
  var geocoder = new google.maps.Geocoder();
  var mapOptions = {
    zoom: 15,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  var map = new google.maps.Map(document.getElementById(idElm), mapOptions);
  geocoder.geocode({
    'address': address
  }, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK) {
      map.setCenter(results[0].geometry.location);
      var marker = new google.maps.Marker({
        map: map,
        draggable: true,
        animation: google.maps.Animation.DROP,
        position: results[0].geometry.location
      });
      var infoWindow = new google.maps.InfoWindow({
        content: address
      });
      google.maps.event.addListener(marker, 'click', function() {
        infoWindow.open(map, marker);
      });
    }
  })
}
var constantAngular = angular.module('constantAngular', []);
constantAngular.directive("detectFocus", function($focusTest) {
  return {
    restrict: "A",
    scope: {
      onFocus: '&onFocus',
      onBlur: '&onBlur',
    },
    link: function(scope, elem) {
      elem.on("focus", function() {
        scope.onFocus();
        $focusTest.setFocusOnBlur(true);
      });
      elem.on("blur", function() {
        scope.onBlur();
        if ($focusTest.getFocusOnBlur()) elem[0].focus();
      });
    }
  }
})
constantAngular.service("$focusTest", function() {
  this.focusOnBlur = true;
  this.setFocusOnBlur = function(val) {
    // console.log('set focus');
    this.focusOnBlur = val;
  }
  this.getFocusOnBlur = function() {
    // console.log('get focus');
    return this.focusOnBlur;
  }
});
constantAngular.factory('dataHtml', function($http, $templateCache) {
  return {
    getTemplate: function(templateURL) {
      return $http.get(templateURL, {
        cache: $templateCache
      })
    }
  }
});
constantAngular.directive('ckEditor', function() {
  return {
    require: '?ngModel',
    link: function(scope, elm, attr, ngModel) {
      var ck = CKEDITOR.replace(elm[0], {
        filebrowserBrowseUrl: roxyFileman,
        filebrowserImageBrowseUrl: roxyFileman,
        removeDialogTabs: 'link:upload;image:upload'
      });
      /*start config by thuan quach*/
      ck.config.allowedContent = true;
      ck.config.extraAllowedContent = 'p(*)[*]{*};div(*)[*]{*};li(*)[*]{*};ul(*)[*]{*};section(*)[*]{*};ul(*)[*]{*}';
      /*end config by thuan quach*/
      if (!ngModel) return;
      ck.on('instanceReady', function() {
        ck.setData(ngModel.$viewValue);
      });

      function updateModel() {
        scope.$apply(function() {
          ngModel.$setViewValue(ck.getData());
        });
      }
      ck.on('change', updateModel);
      ck.on('key', updateModel);
      ck.on('dataReady', updateModel);
      ngModel.$render = function(value) {
        ck.setData(ngModel.$viewValue);
      };
    }
  };
});
// Time dropper
constantAngular.directive('timePickker', function($cordovaToast) {
  return {
    restrict: 'A',
    link: function(scope, elem, attrs) {
      let roundTime = (time, minutesToRound) => {
        let apm = time.search('AM') != -1 ? 'AM' : 'PM';
        let [hours, minutes] = time.split(':');
        hours = parseInt(hours);
        minutes = parseInt(minutes);
        minutes = minutes % 15 == 6 ? minutes + 2 : minutes % 15 == 7 ? minutes + 1 : minutes;
        time = (hours * 60) + minutes;
        let rounded = Math.round(time / minutesToRound) * minutesToRound;
        let rHr = '' + Math.floor(rounded / 60)
        let rMin = '' + rounded % 60
        return rHr.padStart(2, '0') + ':' + rMin.padStart(2, '0') + apm;
      }
      let select_am_pm = attrs.selectAmPm ? true : false;
      $(elem).prop('readonly', true);
      elem.clockpicker({
        twelvehour: true,
        donetext: "Done",
        select_am_pm: select_am_pm,
        afterShow: function() {
          $('.backdrop').addClass('visible').addClass('active');
        },
        afterHide: function() {
          $('.backdrop').removeClass('visible').removeClass('active');
        },
        afterDone: function() {
          $('.backdrop').removeClass('visible').removeClass('active');
          if(attrs.roundtime != undefined){
            elem.val(roundTime(elem.val(), 15));
          }
        },
        onRequiredAmPm: function() {
          $cordovaToast.showLongTop('Please select AM or PM');
        }
      });
    }
  };
});
constantAngular.directive('timeDropper', function() {
  return {
    restrict: 'A',
    link: function(scope, elem, attrs) {
      $(elem).prop('readonly', true);
      $(elem).pickatime({
        placement: 'bottom',
        align: 'left',
        twelvehour: true
      });
    }
  };
});
constantAngular.directive('onScrollDir', function($timeout) {
  return {
    scope: {
      onScroll: '&onScroll',
    },
    link: function(scope, element) {
      var scrollDelay = 250,
        scrollThrottleTimeout,
        throttled = false,
        scrollHandler = function() {
          if (!throttled) {
            var t = scope.onScroll();
            throttled = true;
            scrollThrottleTimeout = $timeout(function() {
              throttled = false;
            }, scrollDelay);
          }
        };
      element.on("scroll", scrollHandler);
      scope.$on('$destroy', function() {
        element.off('scroll', scrollHandler);
      });
    }
  };
});
constantAngular.directive('donutChart', function() {
  return {
    replace: true,
    link: function($scope, element, attrs) {
      var data = JSON.parse(attrs.data),
        colors = JSON.parse(attrs.colors),
        labelColor = attrs.labelColor;
      Morris.Donut({
        element: element,
        labelColor: labelColor,
        colors: colors,
        data: data,
        formatter: function(x) {
          return x
        }
      }).on('click', function(i, row) {
        $('#employeeGraphDescription .itm[data-item|="' + row.label + '"]').addClass('active').siblings().removeClass('active');
        console.log(i, row);
      });
    }
  };
});
constantAngular.directive('rating', function() {
  return {
    require: 'ngModel',
    replace: true,
    link: function($scope, element, attrs, ngModel) {
      var initialRating = attrs.rating ? attrs.rating : 0;
      $(element).starRating({
        totalStars: 5,
        initialRating: initialRating,
        starSize: 25,
        starShape: 'rounded',
        useFullStars: true,
        useGradient: false,
        strokeWidth: 0,
        disableAfterRate: false,
        callback: function(currentRating, $el) {
          ngModel.$setViewValue(currentRating);
        }
      });
    }
  };
});
constantAngular.directive('checkImage', function($http, $timeout) {
  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      attrs.$observe('ngSrc', function(url) {
        if (url == undefined) return;
        if (url) {
          if (url.indexOf('s3.amazonaws.com') < 0) {
            url = url_site + '/' + url;
          }
        }
        imageExists(url, function(result) {
          if (!result) {
            element.attr('src', defaultImage); // set default image
          } else {
            element.attr('src', url);
          }
        });
      });
    }
  };
})
// for only number
constantAngular.directive('numbersOnly', function() {
  return {
    require: 'ngModel',
    link: function(scope, element, attrs, modelCtrl) {
      modelCtrl.$parsers.push(function(inputValue) {
        // this next if is necessary for when using ng-required on your input. 
        // In such cases, when a letter is typed first, this parser will be called
        // again, and the 2nd time, the value will be undefined
        if (inputValue == undefined) return '';
        try {
          var transformedInput = inputValue.replace(/[^0-9 -]/g, '');
        } catch (err) {
          return '';
        }
        if (transformedInput != inputValue) {
          modelCtrl.$setViewValue(transformedInput);
          modelCtrl.$render();
        }
        return transformedInput;
      });
    }
  };
});
// for show hide toggle
constantAngular.directive('showToggle', function() {
  return {
    require: "?ngModel",
    restrict: 'A',
    transclude: true,
    link: function(scope, elm, attr, ngModel) {
      $(elm).clockpicker({
        placement: 'bottom',
        align: 'left',
        autoclose: true,
        'default': 'now'
      });
    }
  }
});
// for format phone
constantAngular.directive('phoneInput', function($filter, $browser) {
  return {
    require: 'ngModel',
    link: function($scope, $element, $attrs, ngModelCtrl) {
      var listener = function() {
        var value = $element.val().replace(/[^0-9]/g, '');
        if (value.length > 10) value = value.substring(0, 10);
        $element.val($filter('tel')(value, false));
        $element.attr('pattern', '.{14,20}');
      };
      // This runs when we update the text field
      ngModelCtrl.$parsers.push(function(viewValue) {
        var value = viewValue.replace(/[^0-9]/g, '');
        if (value.length > 10) value = value.substring(0, 10);
        return $filter('tel')(value, false);
      });
      // This runs when the model gets updated on the scope directly and keeps our view in sync
      ngModelCtrl.$render = function() {
        $element.val($filter('tel')(ngModelCtrl.$viewValue, false));
      };
      $element.bind('change', listener);
      $element.bind('keyup', listener);
      $element.bind('keydown', function(event) {
        var key = event.keyCode;
        // If the keys include the CTRL, SHIFT, ALT, or META keys, or the arrow keys, do nothing.
        // This lets us support copy and paste too
        if (key == 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) {
          return;
        }
        $browser.defer(listener); // Have to do this or changes don't get picked up properly
      });
      $element.bind('paste cut', function() {
        $browser.defer(listener);
      });
    }
  };
})
constantAngular.filter('tel', function() {
  return function(tel) {
    if (!tel) {
      return '';
    }
    var value = tel.toString().trim().replace(/^\+/, '');
    if (value.match(/[^0-9]/)) {
      return tel;
    }
    var country, city, number;
    switch (value.length) {
      case 1:
      case 2:
      case 3:
        city = value;
        break;
      default:
        city = value.slice(0, 3);
        number = value.slice(3);
    }
    if (number) {
      if (number.length > 3) {
        number = number.slice(0, 3) + '-' + number.slice(3, 7);
      } else {
        number = number;
      }
      return ("(" + city + ") " + number).trim();
    } else {
      return "(" + city;
    }
  };
});
// for datetime
constantAngular.directive('datetimePicker', function() {
  return {
    restrict: 'A',
    transclude: true,
    link: function(scope, elm, attr, ngModel) {
      if (attr.format != undefined) {
        format = attr.format;
      }
      $(elm).datetimepicker({
        scrollMonth: false,
        scrollTime: false,
        scrollInput: false,
        timepicker: false,
        format: format,
        formatDate: format,
        onChangeDateTime: function(dp, $th) {}
      });
    }
  }
});
constantAngular.directive('clickInput', function() {
  return {
    restrict: 'A',
    transclude: true,
    link: function(scope, elm, attr, ngModel) {
      $(elm).focus(function(event) {
        $(elm).css("border", "1px solid grey");
      });
      $(elm).blur(function(event) {
        $(elm).css("border", "none");
      });
    }
  }
});
constantAngular.directive('timePicker', function() {
  return {
    require: "?ngModel",
    restrict: 'A',
    transclude: true,
    link: function(scope, elm, attr, ngModel) {
      $(elm).clockpicker({
        placement: 'bottom',
        align: 'left',
        autoclose: false,
        donetext: 'Done',
        twelvehour: true,
        afterShow: function() {
          var format = moment(elm.val(), 'hh:mmA').format('A'); // cắt val input lấy AM or PM;
          if (format == 'AM' || format == 'PM') {
            $('.clockpicker-span-am-pm').html(format);
            $('.clockpicker-span-am-pm-require').html('');
            // $('.clockpicker-button').removeClass('highlightampm');
            // format == 'AM' ? $('.am-button').addClass('highlightampm') : $('.pm-button').addClass('highlightampm');
            // $( ".clockpicker-button" ).click(function() {
            //   $('.clockpicker-button').removeClass('highlightampm');
            // });
          }
        },
        afterDone: function() {
          if (attr.mintime != undefined && attr.maxtime != undefined) {
            var selectTime = moment(elm.val(), 'hh:mmA').format('HH:mm');
            var minTime = moment(attr.mintime, 'hh:mmA').format('HH:mm');
            var maxTime = moment(attr.maxtime, 'hh:mmA').format('HH:mm');
            if (selectTime < minTime || selectTime > maxTime) {
              toastr.error('The appointment cannot be scheduled outside 6AM - 10PM');
              elm.val(moment(attr.mintime, 'hh:mmA').format('hh:mmA'));
            }
          }
          $(elm).parent().parent().find('.notif').html('');
        }
      });
    }
  }
});
constantAngular.directive('compileHtml', function($compile) {
  return {
    restrict: 'A',
    link: function(scope, element, attrs) {
      scope.$watch(function() {
        return scope.$eval(attrs.compileHtml);
      }, function(value) {
        element.html(value);
        $compile(element.contents())(scope);
      });
    }
  };
});
constantAngular.directive('colorPicker', function() {
  return {
    require: "?ngModel",
    restrict: 'A',
    transclude: true,
    link: function(scope, elm, attr, ngModel) {
      angular.element(elm).spectrum({
        color: "#ffffff",
        showInput: true,
        clickoutFiresChange: false,
        preferredFormat: "hex",
        appendTo: $(elm).closest('.itm'),
        beforeShow: function() {
          if (window.cordova) {
            window.cordova.plugins.Keyboard.close();
          }
        }
      });
      $('.sp-replacer').css('width', '20%');
    }
  }
});
constantAngular.directive('focusMe', function($timeout) {
  return {
    link: function(scope, element, attrs) {
      scope.$watch(attrs.focusMe, function(value) {
        if (value === true) {
          // console.log('value=', value);
          $timeout(function() {
            element[0].focus();
            scope[attrs.focusMe] = false;
          }, 1);
        }
      });
    }
  };
});
var offline_mode = false;
var offline_database = "offlinecrm3";
//End IndexedDB Offline Mode
// for scroll
function imageExists(url, callback) {
  var img = new Image();
  img.onload = function() {
    callback(true);
  };
  img.onerror = function() {
    callback(false);
  };
  img.src = url;
}
Array.prototype.getUnique = function() {
  var u = {},
    a = [];
  for (var i = 0, l = this.length; i < l; ++i) {
    if (u.hasOwnProperty(this[i])) {
      continue;
    }
    a.push(this[i]);
    u[this[i]] = 1;
  }
  return a;
}
// for time
function setDueDate($tag) {
  $($tag).unbind();
  $($tag).daterangepicker({
    ranges: {
      'Today': [moment(), moment()],
      'Tomorrow': [moment(), moment().add(1, 'days')],
      'One Week': [moment(), moment().add(6, 'days')]
    },
    startDate: moment(),
    endDate: moment().add(1, 'days')
  }, function(start, end) {
    //$('#taskDueDateAddTask .duedate').html(start.format(conFig.formatDate) + ' <span class="clr-orange-dark">-</span> ' + end.format(conFig.formatDate));
    $('input[name="starttime"]').val(start.format(conFig.formatDate.toUpperCase()))
    $('input[name="endtime"]').val(end.format(conFig.formatDate.toUpperCase()))
  });
}
//call function setting page
function call_function(action) {
  switch (action) {
    case 'Task_Groups':
      if (withoutPopup_TG == null) return;
      withoutPopup_TG.$apply(function() {
        withoutPopup_TG.getDataTaskGroup();
      });
      break;
    case 'Newsfeed_Type':
      if (withoutPopup_NFT == null) return;
      withoutPopup_NFT.$apply(function() {
        withoutPopup_NFT.getNewfeedtypes();
      });
      break;
    case 'Appointment_Group':
      if (withoutPopup_AG == null) return;
      withoutPopup_AG.$apply(function() {
        withoutPopup_AG.getAppointmentgroups();
      });
      break;
    case 'Login':
      if (withoutPopup_LG == null) return;
      withoutPopup_LG.$apply(function() {
        withoutPopup_LG.getMessagequotes();
      });
      break;
    case 'Note_Task':
      if (withoutPopup_NT == null) return;
      withoutPopup_NT.$apply(function() {
        withoutPopup_NT.getNotetasktypes();
      });
      break;
    case 'supplieritems':
      if (withoutPopup_SUP == null) return;
      withoutPopup_SUP.$apply(function() {
        withoutPopup_SUP.getSupplieritems();
      });
      break;
    case 'rooms':
      if (withoutPopup_ROM == null) return;
      withoutPopup_ROM.$apply(function() {
        withoutPopup_ROM.getRooms();
      });
      break;
    case 'dailyschedule':
      if (withoutPopup_DLS == null) return;
      withoutPopup_DLS.$apply(function() {
        withoutPopup_DLS.getSchedule();
      });
      break;
    case 'feedtitle':
      if (withoutPopup_Feedttile == null) return;
      withoutPopup_Feedttile.$apply(function() {
        withoutPopup_Feedttile.getFeedTitle();
      });
      break;
    case 'positiontitle':
      if (withoutPopup_Positiontile == null) return;
      withoutPopup_Positiontile.$apply(function() {
        withoutPopup_Positiontile.getPositiontitles();
      });
      break;
  }
}

function ShowActive(action, $this) {
  switch (action) {
    case 'Task_Groups':
      if (withoutPopup_TG == null) return;
      withoutPopup_TG.$apply(function() {
        withoutPopup_TG.ShowActive_TG($($this).is(':checked') == true);
      });
      break;
    case 'NotesTask_Options':
      if (withoutPopup_NT == null) return;
      withoutPopup_NT.$apply(function() {
        withoutPopup_NT.ShowActive_NT($($this).is(':checked') == true);
      });
      break;
    case 'Appointment_Group':
      if (withoutPopup_AG == null) return;
      withoutPopup_AG.$apply(function() {
        withoutPopup_AG.ShowActive_AG($($this).is(':checked') == true);
      });
      break;
    case 'Appointment_Types':
      if (withoutPopup_TG == null) return;
      withoutPopup_TG.$apply(function() {
        withoutPopup_TG.ShowActive_AT($($this).is(':checked') == true);
      });
      break;
    case 'Supplier_Items':
      if (withoutPopup_SUP == null) return;
      withoutPopup_SUP.$apply(function() {
        withoutPopup_SUP.ShowActive_SUP($($this).is(':checked') == true);
      });
      break;
    case 'rooms':
      if (withoutPopup_ROM == null) return;
      withoutPopup_ROM.$apply(function() {
        withoutPopup_ROM.ShowActive_ROM($($this).is(':checked') == true);
      });
      break;
    case 'feedtitle':
      if (withoutPopup_Feedttile == null) return;
      withoutPopup_Feedttile.$apply(function() {
        withoutPopup_Feedttile.ShowActive_FT($($this).is(':checked') == true);
      });
      break;
    case 'positiontitle':
      if (withoutPopup_Positiontile == null) return;
      withoutPopup_Positiontile.$apply(function() {
        withoutPopup_Positiontile.ShowActive_PositionTitle($($this).is(':checked') == true);
      });
      break;
  }
}

function CheckNumber(number, pattern) {
  var len = number.value.length;
  if (len != 0) {
    var index = 0;
    while ((index < len) && (len != 0))
      if (pattern.indexOf(number.value.charAt(index)) == -1) {
        if (index == len - 1) number.value = number.value.substring(0, len - 1);
        else if (index == 0) number.value = number.value.substring(1, len);
        else number.value = number.value.substring(0, index) + number.value.substring(index + 1, len);
        index = 0;
        len = number.value.length;
      } else index++;
    // number.value = numeral(number.value).format('0,0')
  }
}

function checkFloat(float) {
  if (!float.value) return 0;
  if (float.value.length == 0) {
    float.value = 0;
  } else {
    var item_length = float.value.toString().split('.').length;
    value = float.value.toString().replace(/[^0-9-.]/g, '');
    // if (item_length > 1 && float.value.toString().split('.')[1] != '' || item_length > 2) {
    if (item_length > 1) {
      setTimeout(function() {
        value = parseFloat(parseFloat(value).toFixed(2));
        float.value = value;
      }, 1500);
    }
    if (item_length == 1) {
      value = parseFloat(value);
      float.value = value;
    }
  }
  if (isNaN(value) == true) {
    value = 0;
    float.value = value;
  }
}

function checkCost(object) {
  if (!object.value) return 0;
  if (object.value.length == 0) {
    object.value = 0;
  } else {
    value = object.value.toString().replace(/[^0-9-.]/g, '');
    var data = value.toString().split('.');
    if (data[0] == '') value = '';
    var item_length = value.toString().split('.').length;
    if (item_length > 1) {
      var pre = data[0].toString().replace(/[^0-9]/g, '');
      data.splice(0, 1);
      var suf = data.join('');
      suf = suf.toString().replace(/[^0-9]/g, '');
      suf = suf.length > 2 ? suf.substring(0, 2) : suf;
      value = pre + '.' + suf;
    }
  }
  object.value = value;
}

function getFileType(extension) {
  var result = _.where(typeS3Amazon, {
    extension: extension.toLowerCase()
  });
  if (result.length > 0) {
    return result[0].type;
  }
  return 'image/jpeg';
}
var typeS3Amazon = [{
  extension: '3g2',
  type: 'video/3gpp2'
}, {
  extension: '3gp',
  type: 'video/3gpp'
}, {
  extension: '3gp2',
  type: 'video/3gpp2'
}, {
  extension: '3gpp',
  type: 'video/3gpp'
}, {
  extension: 'aa',
  type: 'audio/audible'
}, {
  extension: 'aac',
  type: 'audio/vnd.dlna.adts'
}, {
  extension: 'aax',
  type: 'audio/vnd.audible.aax'
}, {
  extension: 'addin',
  type: 'text/xml'
}, {
  extension: 'adt',
  type: 'audio/vnd.dlna.adts'
}, {
  extension: 'adts',
  type: 'audio/vnd.dlna.adts'
}, {
  extension: 'ai',
  type: 'application/postscript'
}, {
  extension: 'aif',
  type: 'audio/aiff'
}, {
  extension: 'aifc',
  type: 'audio/aiff'
}, {
  extension: 'aiff',
  type: 'audio/aiff'
}, {
  extension: 'application',
  type: 'application/x-ms-application'
}, {
  extension: 'asax',
  type: 'application/xml'
}, {
  extension: 'ascx',
  type: 'application/xml'
}, {
  extension: 'asf',
  type: 'video/x-ms-asf'
}, {
  extension: 'ashx',
  type: 'application/xml'
}, {
  extension: 'asmx',
  type: 'application/xml'
}, {
  extension: 'aspx',
  type: 'application/xml'
}, {
  extension: 'asx',
  type: 'video/x-ms-asf'
}, {
  extension: 'au',
  type: 'audio/basic'
}, {
  extension: 'avi',
  type: 'video/avi'
}, {
  extension: 'bmp',
  type: 'image/bmp'
}, {
  extension: 'btapp',
  type: 'application/x-bittorrent-app'
}, {
  extension: 'btinstall',
  type: 'application/x-bittorrent-appinst'
}, {
  extension: 'btkey',
  type: 'application/x-bittorrent-key'
}, {
  extension: 'btsearch',
  type: 'application/x-bittorrentsearchdescription+xml'
}, {
  extension: 'btskin',
  type: 'application/x-bittorrent-skin'
}, {
  extension: 'cat',
  type: 'application/vnd.ms-pki.seccat'
}, {
  extension: 'cd',
  type: 'text/plain'
}, {
  extension: 'cer',
  type: 'application/x-x509-ca-cert'
}, {
  extension: 'config',
  type: 'application/xml'
}, {
  extension: 'contact',
  type: 'text/x-ms-contact'
}, {
  extension: 'crl',
  type: 'application/pkix-crl'
}, {
  extension: 'crt',
  type: 'application/x-x509-ca-cert'
}, {
  extension: 'cs',
  type: 'text/plain'
}, {
  extension: 'csproj',
  type: 'text/plain'
}, {
  extension: 'css',
  type: 'text/css'
}, {
  extension: 'csv',
  type: 'application/vnd.ms-excel'
}, {
  extension: 'datasource',
  type: 'application/xml'
}, {
  extension: 'der',
  type: 'application/x-x509-ca-cert'
}, {
  extension: 'dib',
  type: 'image/bmp'
}, {
  extension: 'dll',
  type: 'application/x-msdownload'
}, {
  extension: 'doc',
  type: 'application/msword'
}, {
  extension: 'docm',
  type: 'application/vnd.ms-word.document.macroEnabled.12'
}, {
  extension: 'docx',
  type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
}, {
  extension: 'dot',
  type: 'application/msword'
}, {
  extension: 'dotm',
  type: 'application/vnd.ms-word.template.macroEnabled.12'
}, {
  extension: 'dotx',
  type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.template'
}, {
  extension: 'dtd',
  type: 'application/xml-dtd'
}, {
  extension: 'dtsconfig',
  type: 'text/xml'
}, {
  extension: 'eps',
  type: 'application/postscript'
}, {
  extension: 'exe',
  type: 'application/x-msdownload'
}, {
  extension: 'fdf',
  type: 'application/vnd.fdf'
}, {
  extension: 'fif',
  type: 'application/fractals'
}, {
  extension: 'gif',
  type: 'image/gif'
}, {
  extension: 'group',
  type: 'text/x-ms-group'
}, {
  extension: 'hdd',
  type: 'application/x-virtualbox-hdd'
}, {
  extension: 'hqx',
  type: 'application/mac-binhex40'
}, {
  extension: 'hta',
  type: 'application/hta'
}, {
  extension: 'htc',
  type: 'text/x-component'
}, {
  extension: 'htm',
  type: 'text/html'
}, {
  extension: 'html',
  type: 'text/html'
}, {
  extension: 'hxa',
  type: 'application/xml'
}, {
  extension: 'hxc',
  type: 'application/xml'
}, {
  extension: 'hxd',
  type: 'application/octet-stream'
}, {
  extension: 'hxe',
  type: 'application/xml'
}, {
  extension: 'hxf',
  type: 'application/xml'
}, {
  extension: 'hxh',
  type: 'application/octet-stream'
}, {
  extension: 'hxi',
  type: 'application/octet-stream'
}, {
  extension: 'hxk',
  type: 'application/xml'
}, {
  extension: 'hxq',
  type: 'application/octet-stream'
}, {
  extension: 'hxr',
  type: 'application/octet-stream'
}, {
  extension: 'hxs',
  type: 'application/octet-stream'
}, {
  extension: 'hxt',
  type: 'application/xml'
}, {
  extension: 'hxv',
  type: 'application/xml'
}, {
  extension: 'hxw',
  type: 'application/octet-stream'
}, {
  extension: 'ico',
  type: 'image/x-icon'
}, {
  extension: 'ics',
  type: 'text/calendar'
}, {
  extension: 'ipa',
  type: 'application/x-itunes-ipa'
}, {
  extension: 'ipg',
  type: 'application/x-itunes-ipg'
}, {
  extension: 'ipsw',
  type: 'application/x-itunes-ipsw'
}, {
  extension: 'iqy',
  type: 'text/x-ms-iqy'
}, {
  extension: 'iss',
  type: 'text/plain'
}, {
  extension: 'ite',
  type: 'application/x-itunes-ite'
}, {
  extension: 'itlp',
  type: 'application/x-itunes-itlp'
}, {
  extension: 'itls',
  type: 'application/x-itunes-itls'
}, {
  extension: 'itms',
  type: 'application/x-itunes-itms'
}, {
  extension: 'itpc',
  type: 'application/x-itunes-itpc'
}, {
  extension: 'jfif',
  type: 'image/jpeg'
}, {
  extension: 'jnlp',
  type: 'application/x-java-jnlp-file'
}, {
  extension: 'jpe',
  type: 'image/jpeg'
}, {
  extension: 'jpeg',
  type: 'image/jpeg'
}, {
  extension: 'jpg',
  type: 'image/jpeg'
}, {
  extension: 'js',
  type: 'application/javascript'
}, {
  extension: 'latex',
  type: 'application/x-latex'
}, {
  extension: 'library-ms',
  type: 'application/windows-library+xml'
}, {
  extension: 'm1v',
  type: 'video/mpeg'
}, {
  extension: 'm2t',
  type: 'video/vnd.dlna.mpeg-tts'
}, {
  extension: 'm2ts',
  type: 'video/vnd.dlna.mpeg-tts'
}, {
  extension: 'm2v',
  type: 'video/mpeg'
}, {
  extension: 'm3u',
  type: 'audio/mpegurl'
}, {
  extension: 'm3u8',
  type: 'audio/x-mpegurl'
}, {
  extension: 'm4a',
  type: 'audio/m4a'
}, {
  extension: 'm4b',
  type: 'audio/m4b'
}, {
  extension: 'm4p',
  type: 'audio/m4p'
}, {
  extension: 'm4r',
  type: 'audio/x-m4r'
}, {
  extension: 'm4v',
  type: 'video/x-m4v'
}, {
  extension: 'magnet',
  type: 'application/x-magnet'
}, {
  extension: 'man',
  type: 'application/x-troff-man'
}, {
  extension: 'master',
  type: 'application/xml'
}, {
  extension: 'mht',
  type: 'message/rfc822'
}, {
  extension: 'mhtml',
  type: 'message/rfc822'
}, {
  extension: 'mid',
  type: 'audio/mid'
}, {
  extension: 'midi',
  type: 'audio/mid'
}, {
  extension: 'mod',
  type: 'video/mpeg'
}, {
  extension: 'mov',
  type: 'video/quicktime'
}, {
  extension: 'mp2',
  type: 'audio/mpeg'
}, {
  extension: 'mp2v',
  type: 'video/mpeg'
}, {
  extension: 'mp3',
  type: 'audio/mpeg'
}, {
  extension: 'mp4',
  type: 'video/mp4'
}, {
  extension: 'mp4v',
  type: 'video/mp4'
}, {
  extension: 'mpa',
  type: 'video/mpeg'
}, {
  extension: 'mpe',
  type: 'video/mpeg'
}, {
  extension: 'mpeg',
  type: 'video/mpeg'
}, {
  extension: 'mpf',
  type: 'application/vnd.ms-mediapackage'
}, {
  extension: 'mpg',
  type: 'video/mpeg'
}, {
  extension: 'mpv2',
  type: 'video/mpeg'
}, {
  extension: 'mts',
  type: 'video/vnd.dlna.mpeg-tts'
}, {
  extension: 'odc',
  type: 'text/x-ms-odc'
}, {
  extension: 'odg',
  type: 'application/vnd.oasis.opendocument.graphics'
}, {
  extension: 'odm',
  type: 'application/vnd.oasis.opendocument.text-master'
}, {
  extension: 'odp',
  type: 'application/vnd.oasis.opendocument.presentation'
}, {
  extension: 'ods',
  type: 'application/vnd.oasis.opendocument.spreadsheet'
}, {
  extension: 'odt',
  type: 'application/vnd.oasis.opendocument.text'
}, {
  extension: 'otg',
  type: 'application/vnd.oasis.opendocument.graphics-template'
}, {
  extension: 'oth',
  type: 'application/vnd.oasis.opendocument.text-web'
}, {
  extension: 'ots',
  type: 'application/vnd.oasis.opendocument.spreadsheet-template'
}, {
  extension: 'ott',
  type: 'application/vnd.oasis.opendocument.text-template'
}, {
  extension: 'ova',
  type: 'application/x-virtualbox-ova'
}, {
  extension: 'ovf',
  type: 'application/x-virtualbox-ovf'
}, {
  extension: 'oxt',
  type: 'application/vnd.openofficeorg.extension'
}, {
  extension: 'p10',
  type: 'application/pkcs10'
}, {
  extension: 'p12',
  type: 'application/x-pkcs12'
}, {
  extension: 'p7b',
  type: 'application/x-pkcs7-certificates'
}, {
  extension: 'p7c',
  type: 'application/pkcs7-mime'
}, {
  extension: 'p7m',
  type: 'application/pkcs7-mime'
}, {
  extension: 'p7r',
  type: 'application/x-pkcs7-certreqresp'
}, {
  extension: 'p7s',
  type: 'application/pkcs7-signature'
}, {
  extension: 'pcast',
  type: 'application/x-podcast'
}, {
  extension: 'pdf',
  type: 'application/pdf'
}, {
  extension: 'pdfxml',
  type: 'application/vnd.adobe.pdfxml'
}, {
  extension: 'pdx',
  type: 'application/vnd.adobe.pdx'
}, {
  extension: 'pfx',
  type: 'application/x-pkcs12'
}, {
  extension: 'pko',
  type: 'application/vnd.ms-pki.pko'
}, {
  extension: 'pls',
  type: 'audio/scpls'
}, {
  extension: 'png',
  type: 'image/png'
}, {
  extension: 'pot',
  type: 'application/vnd.ms-powerpoint'
}, {
  extension: 'potm',
  type: 'application/vnd.ms-powerpoint.template.macroEnabled.12'
}, {
  extension: 'potx',
  type: 'application/vnd.openxmlformats-officedocument.presentationml.template'
}, {
  extension: 'ppa',
  type: 'application/vnd.ms-powerpoint'
}, {
  extension: 'ppam',
  type: 'application/vnd.ms-powerpoint.addin.macroEnabled.12'
}, {
  extension: 'pps',
  type: 'application/vnd.ms-powerpoint'
}, {
  extension: 'pps',
  type: 'mapplication/vnd.ms-powerpoint.slideshow.macroEnabled.12'
}, {
  extension: 'ppsx',
  type: 'application/vnd.openxmlformats-officedocument.presentationml.slideshow'
}, {
  extension: 'ppt',
  type: 'application/vnd.ms-powerpoint'
}, {
  extension: 'pptm',
  type: 'application/vnd.ms-powerpoint.presentation.macroEnabled.12'
}, {
  extension: 'pptx',
  type: 'application/vnd.openxmlformats-officedocument.presentationml.presentation'
}, {
  extension: 'prf',
  type: 'application/pics-rules'
}, {
  extension: 'ps',
  type: 'application/postscript'
}, {
  extension: 'psc1',
  type: 'application/PowerShell'
}, {
  extension: 'pwz',
  type: 'application/vnd.ms-powerpoint'
}, {
  extension: 'py',
  type: 'text/plain'
}, {
  extension: 'pyw',
  type: 'text/plain'
}, {
  extension: 'rat',
  type: 'application/rat-file'
}, {
  extension: 'rc',
  type: 'text/plain'
}, {
  extension: 'rc2',
  type: 'text/plain'
}, {
  extension: 'rct',
  type: 'text/plain'
}, {
  extension: 'rdlc',
  type: 'application/xml'
}, {
  extension: 'resx',
  type: 'application/xml'
}, {
  extension: 'rmi',
  type: 'audio/mid'
}, {
  extension: 'rmp',
  type: 'application/vnd.rn-rn_music_package'
}, {
  extension: 'rqy',
  type: 'text/x-ms-rqy'
}, {
  extension: 'rtf',
  type: 'application/msword'
}, {
  extension: 'sct',
  type: 'text/scriptlet'
}, {
  extension: 'settings',
  type: 'application/xml'
}, {
  extension: 'shtml',
  type: 'text/html'
}, {
  extension: 'sit',
  type: 'application/x-stuffit'
}, {
  extension: 'sitemap',
  type: 'application/xml'
}, {
  extension: 'skin',
  type: 'application/xml'
}, {
  extension: 'sldm',
  type: 'application/vnd.ms-powerpoint.slide.macroEnabled.12'
}, {
  extension: 'sldx',
  type: 'application/vnd.openxmlformats-officedocument.presentationml.slide'
}, {
  extension: 'slk',
  type: 'application/vnd.ms-excel'
}, {
  extension: 'sln',
  type: 'text/plain'
}, {
  extension: 'slupkg-ms',
  type: 'application/x-ms-license'
}, {
  extension: 'snd',
  type: 'audio/basic'
}, {
  extension: 'snippet',
  type: 'application/xml'
}, {
  extension: 'spc',
  type: 'application/x-pkcs7-certificates'
}, {
  extension: 'sst',
  type: 'application/vnd.ms-pki.certstore'
}, {
  extension: 'stc',
  type: 'application/vnd.sun.xml.calc.template'
}, {
  extension: 'std',
  type: 'application/vnd.sun.xml.draw.template'
}, {
  extension: 'stl',
  type: 'application/vnd.ms-pki.stl'
}, {
  extension: 'stw',
  type: 'application/vnd.sun.xml.writer.template'
}, {
  extension: 'svg',
  type: 'image/svg+xml'
}, {
  extension: 'sxc',
  type: 'application/vnd.sun.xml.calc'
}, {
  extension: 'sxd',
  type: 'application/vnd.sun.xml.draw'
}, {
  extension: 'sxg',
  type: 'application/vnd.sun.xml.writer.global'
}, {
  extension: 'sxw',
  type: 'application/vnd.sun.xml.writer'
}, {
  extension: 'tga',
  type: 'image/targa'
}, {
  extension: 'thmx',
  type: 'application/vnd.ms-officetheme'
}, {
  extension: 'tif',
  type: 'image/tiff'
}, {
  extension: 'tiff',
  type: 'image/tiff'
}, {
  extension: 'torrent',
  type: 'application/x-bittorrent'
}, {
  extension: 'ts',
  type: 'video/vnd.dlna.mpeg-tts'
}, {
  extension: 'tts',
  type: 'video/vnd.dlna.mpeg-tts'
}, {
  extension: 'txt',
  type: 'text/plain'
}, {
  extension: 'user',
  type: 'text/plain'
}, {
  extension: 'vb',
  type: 'text/plain'
}, {
  extension: 'vbox',
  type: 'application/x-virtualbox-vbox'
}, {
  extension: 'vbox-extpack',
  type: 'application/x-virtualbox-vbox-extpack'
}, {
  extension: 'vbproj',
  type: 'text/plain'
}, {
  extension: 'vcf',
  type: 'text/x-vcard'
}, {
  extension: 'vdi',
  type: 'application/x-virtualbox-vdi'
}, {
  extension: 'vdp',
  type: 'text/plain'
}, {
  extension: 'vdproj',
  type: 'text/plain'
}, {
  extension: 'vhd',
  type: 'application/x-virtualbox-vhd'
}, {
  extension: 'vmdk',
  type: 'application/x-virtualbox-vmdk'
}, {
  extension: 'vor',
  type: 'application/vnd.stardivision.writer'
}, {
  extension: 'vscontent',
  type: 'application/xml'
}, {
  extension: 'vsi',
  type: 'application/ms-vsi'
}, {
  extension: 'vspolicy',
  type: 'application/xml'
}, {
  extension: 'vspolicydef',
  type: 'application/xml'
}, {
  extension: 'vspscc',
  type: 'text/plain'
}, {
  extension: 'vsscc',
  type: 'text/plain'
}, {
  extension: 'vssettings',
  type: 'text/xml'
}, {
  extension: 'vssscc',
  type: 'text/plain'
}, {
  extension: 'vstemplate',
  type: 'text/xml'
}, {
  extension: 'vsto',
  type: 'application/x-ms-vsto'
}, {
  extension: 'wal',
  type: 'interface/x-winamp3-skin'
}, {
  extension: 'wav',
  type: 'audio/wav'
}, {
  extension: 'wave',
  type: 'audio/wav'
}, {
  extension: 'wax',
  type: 'audio/x-ms-wax'
}, {
  extension: 'wbk',
  type: 'application/msword'
}, {
  extension: 'wdp',
  type: 'image/vnd.ms-photo'
}, {
  extension: 'website',
  type: 'application/x-mswebsite'
}, {
  extension: 'wiz',
  type: 'application/msword'
}, {
  extension: 'wlz',
  type: 'interface/x-winamp-lang'
}, {
  extension: 'wm',
  type: 'video/x-ms-wm'
}, {
  extension: 'wma',
  type: 'audio/x-ms-wma'
}, {
  extension: 'wmd',
  type: 'application/x-ms-wmd'
}, {
  extension: 'wmv',
  type: 'video/x-ms-wmv'
}, {
  extension: 'wmx',
  type: 'video/x-ms-wmx'
}, {
  extension: 'wmz',
  type: 'application/x-ms-wmz'
}, {
  extension: 'wpl',
  type: 'application/vnd.ms-wpl'
}, {
  extension: 'wsc',
  type: 'text/scriptlet'
}, {
  extension: 'wsdl',
  type: 'application/xml'
}, {
  extension: 'wsz',
  type: 'interface/x-winamp-skin'
}, {
  extension: 'wvx',
  type: 'video/x-ms-wvx'
}, {
  extension: 'xaml',
  type: 'application/xaml+xml'
}, {
  extension: 'xbap',
  type: 'application/x-ms-xbap'
}, {
  extension: 'xdp',
  type: 'application/vnd.adobe.xdp+xml'
}, {
  extension: 'xdr',
  type: 'application/xml'
}, {
  extension: 'xfdf',
  type: 'application/vnd.adobe.xfdf'
}, {
  extension: 'xht',
  type: 'application/xhtml+xml'
}, {
  extension: 'xhtml',
  type: 'application/xhtml+xml'
}, {
  extension: 'xla',
  type: 'application/vnd.ms-excel'
}, {
  extension: 'xlam',
  type: 'application/vnd.ms-excel.addin.macroEnabled.12'
}, {
  extension: 'xld',
  type: 'application/vnd.ms-excel'
}, {
  extension: 'xlk',
  type: 'application/vnd.ms-excel'
}, {
  extension: 'xll',
  type: 'application/vnd.ms-excel'
}, {
  extension: 'xlm',
  type: 'application/vnd.ms-excel'
}, {
  extension: 'xls',
  type: 'application/vnd.ms-excel'
}, {
  extension: 'xlsb',
  type: 'application/vnd.ms-excel.sheet.binary.macroEnabled.12'
}, {
  extension: 'xlsm',
  type: 'application/vnd.ms-excel.sheet.macroEnabled.12'
}, {
  extension: 'xlsx',
  type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
}, {
  extension: 'xlt',
  type: 'application/vnd.ms-excel'
}, {
  extension: 'xltm',
  type: 'application/vnd.ms-excel.template.macroEnabled.12'
}, {
  extension: 'xltx',
  type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.template'
}, {
  extension: 'xlw',
  type: 'application/vnd.ms-excel'
}, {
  extension: 'xml',
  type: 'text/xml'
}, {
  extension: 'xrm-ms',
  type: 'text/xml'
}, {
  extension: 'xsc',
  type: 'application/xml'
}, {
  extension: 'xsd',
  type: 'application/xml'
}, {
  extension: 'xsl',
  type: 'text/xml'
}, {
  extension: 'xslt',
  type: 'application/xml'
}, {
  extension: 'xss',
  type: 'application/xml'
}, {
  extension: 'rar',
  type: 'file'
}, {
  extension: 'jar',
  type: 'file'
}, {
  extension: 'apk',
  type: 'file'
}, {
  extension: 'zip',
  type: 'file'
}];

function validateTime(from_time, end_time) {
  if (moment(from_time).isValid()) {
    $startTimeCheck = moment(from_time).format('hh:mmA');
    $startTimeCheck = moment($startTimeCheck, 'hh:mmA').format('HH:mm:ss');
  } else {
    $startTimeCheck = moment(from_time, 'hh:mmA').format('HH:mm:ss');
  }
  if (moment(end_time).isValid()) {
    $endTimeCheck = moment(end_time).format('hh:mmA');
    $endTimeCheck = moment($endTimeCheck, 'hh:mmA').format('HH:mm:ss');
  } else {
    $endTimeCheck = moment(end_time, 'hh:mmA').format('HH:mm:ss');
  }
  if ($startTimeCheck > $endTimeCheck) {
    return {
      status: false
    };
  }
  return {
    status: true,
    start: $startTimeCheck,
    end: $endTimeCheck
  }
}

function replaceAllPhone(number) {
  var value = number.replace(/[^0-9]/g, '');
  return value;
  // return number.replace(new RegExp(search, 'g'), replacement);
}
// for popup without angular
function popupWithout($selector, $this, selectors) {
  if (withoutPopup == null) return;
  withoutPopup.$apply(function() {
    switch ($selector) {
      case '#filterlastfieldworker':
        withoutPopup.getLastFieldWorker();
        break;
      case '#filterlastservicedate':
        withoutPopup.getlastservicedate();
        break;
      case '#filtercustomeraddress':
        withoutPopup.getstate();
        break;
      case '#filterposition':
        withoutPopup.getDepartments(3);
        break;
      case '#filterdepartment':
        withoutPopup.getDepartments(3);
        break;
      case '#popupAddusers':
        withoutPopup.getDepartments(1);
        break;
      case '#setupschedule':
        withoutPopup.getSchedule($($this).attr('schedule-data-id'), selectors);
        break;
      case '#popupFilterreview':
        withoutPopup.getDataFilter();
        break;
      case '#popupFilteremployee':
        withoutPopup.getDataFilter();
        break;
    }
    // openPopup($selector);
  });
}

function convertImgToBase64URL(url, callback, outputFormat) {
  var img = new Image();
  img.crossOrigin = 'Anonymous';
  img.onload = function() {
    var canvas = document.createElement('CANVAS'),
      ctx = canvas.getContext('2d'),
      dataURL;
    canvas.height = this.height;
    canvas.width = this.width;
    ctx.drawImage(this, 0, 0);
    dataURL = canvas.toDataURL(outputFormat);
    callback(dataURL);
    canvas = null;
  };
  img.src = url;
  // call function
  // convertImgToBase64URL(uri, function(base64Img){
  //                // Base64DataURL
  //            });
}

function utf8_encode(argString) {
  // http://jsphp.co/jsphp/fn/view/utf8_encode
  // + original by: Webtoolkit.info (http://www.webtoolkit.info/)
  // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
  // + improved by: sowberry
  // + tweaked by: Jack
  // + bugfixed by: Onno Marsman
  // + improved by: Yves Sucaet
  // + bugfixed by: Onno Marsman
  // + bugfixed by: Ulrich
  // + bugfixed by: Rafal Kukawski
  // * example 1: utf8_encode('Kevin van Zonneveld');
  // * returns 1: 'Kevin van Zonneveld'
  if (argString === null || typeof argString === "undefined") {
    return "";
  }
  var string = (argString + ''); // .replace(/\r\n/g, "\n").replace(/\r/g, "\n");
  var utftext = "",
    start, end, stringl = 0;
  start = end = 0;
  stringl = string.length;
  for (var n = 0; n < stringl; n++) {
    var c1 = string.charCodeAt(n);
    var enc = null;
    if (c1 < 128) {
      end++;
    } else if (c1 > 127 && c1 < 2048) {
      enc = String.fromCharCode((c1 >> 6) | 192) + String.fromCharCode((c1 & 63) | 128);
    } else {
      enc = String.fromCharCode((c1 >> 12) | 224) + String.fromCharCode(((c1 >> 6) & 63) | 128) + String.fromCharCode((c1 & 63) | 128);
    }
    if (enc !== null) {
      if (end > start) {
        utftext += string.slice(start, end);
      }
      utftext += enc;
      start = end = n + 1;
    }
  }
  if (end > start) {
    utftext += string.slice(start, stringl);
  }
  return utftext;
}
var keyStr = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + "ghijklmnopqrstuv" + "wxyz0123456789+/" + "=";

function encode64(input) {
  input = escape(input);
  var output = "";
  var chr1, chr2, chr3 = "";
  var enc1, enc2, enc3, enc4 = "";
  var i = 0;
  do {
    chr1 = input.charCodeAt(i++);
    chr2 = input.charCodeAt(i++);
    chr3 = input.charCodeAt(i++);
    enc1 = chr1 >> 2;
    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
    enc4 = chr3 & 63;
    if (isNaN(chr2)) {
      enc3 = enc4 = 64;
    } else if (isNaN(chr3)) {
      enc4 = 64;
    }
    output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4);
    chr1 = chr2 = chr3 = "";
    enc1 = enc2 = enc3 = enc4 = "";
  } while (i < input.length);
  return output;
}
var dataCityFilter = '[{"city":"Afton","state":"MN","city_state":"Afton, MN"},{"city":"Albertville","state":"MN","city_state":"Albertville, MN"},{"city":"Andover","state":"MN","city_state":"Andover, MN"},{"city":"Anoka","state":"MN","city_state":"Anoka, MN"},{"city":"Apple Valley","state":"MN","city_state":"Apple Valley, MN"},{"city":"Arden Hills","state":"MN","city_state":"Arden Hills, MN"},{"city":"Bayport","state":"MN","city_state":"Bayport, MN"},{"city":"Becker","state":"MN","city_state":"Becker, MN"},{"city":"Belle Plaine","state":"MN","city_state":"Belle Plaine, MN"},{"city":"Bethel","state":"MN","city_state":"Bethel, MN"},{"city":"Big Lake","state":"MN","city_state":"Big Lake, MN"},{"city":"Blaine","state":"MN","city_state":"Blaine, MN"},{"city":"Bloomington","state":"MN","city_state":"Bloomington, MN"},{"city":"Brichwood Village","state":"MN","city_state":"Brichwood Village, MN"},{"city":"Brooklyn Center","state":"MN","city_state":"Brooklyn Center, MN"},{"city":"Brooklyn Park","state":"MN","city_state":"Brooklyn Park, MN"},{"city":"Buffalo","state":"MN","city_state":"Buffalo, MN"},{"city":"Burnsville","state":"MN","city_state":"Burnsville, MN"},{"city":"Cambridge","state":"MN","city_state":"Cambridge, MN"},{"city":"Cannon Falls","state":"MN","city_state":"Cannon Falls, MN"},{"city":"Carver","state":"MN","city_state":"Carver, MN"},{"city":"Castle Rock","state":"MN","city_state":"Castle Rock, MN"},{"city":"Cedar","state":"MN","city_state":"Cedar, MN"},{"city":"Center City","state":"MN","city_state":"Center City, MN"},{"city":"Centerville","state":"MN","city_state":"Centerville, MN"},{"city":"Champlin","state":"MN","city_state":"Champlin, MN"},{"city":"Chanhassen","state":"MN","city_state":"Chanhassen, MN"},{"city":"Chaska","state":"MN","city_state":"Chaska, MN"},{"city":"Chisago City","state":"MN","city_state":"Chisago City, MN"},{"city":"Circle Pines","state":"MN","city_state":"Circle Pines, MN"},{"city":"Coates","state":"MN","city_state":"Coates, MN"},{"city":"Cocoran","state":"MN","city_state":"Cocoran, MN"},{"city":"Cologne","state":"MN","city_state":"Cologne, MN"},{"city":"Columbia Heights","state":"MN","city_state":"Columbia Heights, MN"},{"city":"Columbus","state":"MN","city_state":"Columbus, MN"},{"city":"Coon Rapids","state":"MN","city_state":"Coon Rapids, MN"},{"city":"Corcoran","state":"MN","city_state":"Corcoran, MN"},{"city":"Cottage Grove","state":"MN","city_state":"Cottage Grove, MN"},{"city":"Crown","state":"MN","city_state":"Crown, MN"},{"city":"Crystal","state":"MN","city_state":"Crystal, MN"},{"city":"Dayton","state":"MN","city_state":"Dayton, MN"},{"city":"Deephaven","state":"MN","city_state":"Deephaven, MN"},{"city":"Delano","state":"MN","city_state":"Delano, MN"},{"city":"Dellwood","state":"MN","city_state":"Dellwood, MN"},{"city":"Dennison","state":"MN","city_state":"Dennison, MN"},{"city":"Dundas","state":"MN","city_state":"Dundas, MN"},{"city":"Eagan","state":"MN","city_state":"Eagan, MN"},{"city":"East Bethel","state":"MN","city_state":"East Bethel, MN"},{"city":"East St Paul","state":"MN","city_state":"East St Paul, MN"},{"city":"Edina","state":"MN","city_state":"Edina, MN"},{"city":"Elk River","state":"MN","city_state":"Elk River, MN"},{"city":"Elko New Market","state":"MN","city_state":"Elko New Market, MN"},{"city":"Excelsior","state":"MN","city_state":"Excelsior, MN"},{"city":"Fairibault","state":"MN","city_state":"Fairibault, MN"},{"city":"Falcon Heights","state":"MN","city_state":"Falcon Heights, MN"},{"city":"Farmington","state":"MN","city_state":"Farmington, MN"},{"city":"Forest Lake","state":"MN","city_state":"Forest Lake, MN"},{"city":"Fridley","state":"MN","city_state":"Fridley, MN"},{"city":"Gem Lake","state":"MN","city_state":"Gem Lake, MN"},{"city":"Golden Valley","state":"MN","city_state":"Golden Valley, MN"},{"city":"Grant","state":"MN","city_state":"Grant, MN"},{"city":"Greenfield","state":"MN","city_state":"Greenfield, MN"},{"city":"Greenwood","state":"MN","city_state":"Greenwood, MN"},{"city":"Ham Lake","state":"MN","city_state":"Ham Lake, MN"},{"city":"Hamburg","state":"MN","city_state":"Hamburg, MN"},{"city":"Hamel","state":"MN","city_state":"Hamel, MN"},{"city":"Hampton","state":"MN","city_state":"Hampton, MN"},{"city":"Hanover","state":"MN","city_state":"Hanover, MN"},{"city":"Harris","state":"MN","city_state":"Harris, MN"},{"city":"Hastings","state":"MN","city_state":"Hastings, MN"},{"city":"Henderson","state":"MN","city_state":"Henderson, MN"},{"city":"Highland Park","state":"MN","city_state":"Highland Park, MN"},{"city":"Hopkins","state":"MN","city_state":"Hopkins, MN"},{"city":"Houlton","state":"WI","city_state":"Houlton, WI"},{"city":"Howard Lake","state":"MN","city_state":"Howard Lake, MN"},{"city":"Hudson","state":"WI","city_state":"Hudson, WI"},{"city":"Hugo","state":"MN","city_state":"Hugo, MN"},{"city":"Independance","state":"MN","city_state":"Independance, MN"},{"city":"Inver Grove Heights","state":"MN","city_state":"Inver Grove Heights, MN"},{"city":"Isanti","state":"MN","city_state":"Isanti, MN"},{"city":"Jordan","state":"MN","city_state":"Jordan, MN"},{"city":"Lake Elmo","state":"MN","city_state":"Lake Elmo, MN"},{"city":"Lake Saint Croix Beach","state":"MN","city_state":"Lake Saint Croix Beach, MN"},{"city":"Lakeland","state":"MN","city_state":"Lakeland, MN"},{"city":"Lakeland Shores","state":"MN","city_state":"Lakeland Shores, MN"},{"city":"Lakeville","state":"MN","city_state":"Lakeville, MN"},{"city":"Lauderdale","state":"MN","city_state":"Lauderdale, MN"},{"city":"Le Sueur","state":"MN","city_state":"Le Sueur, MN"},{"city":"Lexington","state":"MN","city_state":"Lexington, MN"},{"city":"Lilydale","state":"MN","city_state":"Lilydale, MN"},{"city":"Lindstrom","state":"MN","city_state":"Lindstrom, MN"},{"city":"Lino Lakes","state":"MN","city_state":"Lino Lakes, MN"},{"city":"Linwood","state":"MN","city_state":"Linwood, MN"},{"city":"Little Canada","state":"MN","city_state":"Little Canada, MN"},{"city":"Long Lake","state":"MN","city_state":"Long Lake, MN"},{"city":"Lonsdale","state":"MN","city_state":"Lonsdale, MN"},{"city":"Loretto","state":"MN","city_state":"Loretto, MN"},{"city":"Mahtomedi","state":"MN","city_state":"Mahtomedi, MN"},{"city":"Maple Grove","state":"MN","city_state":"Maple Grove, MN"},{"city":"Maple Lake","state":"MN","city_state":"Maple Lake, MN"},{"city":"Maple Plain","state":"MN","city_state":"Maple Plain, MN"},{"city":"Maplewood","state":"MN","city_state":"Maplewood, MN"},{"city":"Marine on St. Croix","state":"MN","city_state":"Marine on St. Croix, MN"},{"city":"Mayer","state":"MN","city_state":"Mayer, MN"},{"city":"Medicine Lake","state":"MN","city_state":"Medicine Lake, MN"},{"city":"Medina","state":"MN","city_state":"Medina, MN"},{"city":"Mendota","state":"MN","city_state":"Mendota, MN"},{"city":"Mendota Heights","state":"MN","city_state":"Mendota Heights, MN"},{"city":"Minneapolis","state":"MN","city_state":"Minneapolis, MN"},{"city":"Minnetonka","state":"MN","city_state":"Minnetonka, MN"},{"city":"Minnetonka Beach","state":"MN","city_state":"Minnetonka Beach, MN"},{"city":"Minnetrista","state":"MN","city_state":"Minnetrista, MN"},{"city":"Montgomery","state":"MN","city_state":"Montgomery, MN"},{"city":"Monticello","state":"MN","city_state":"Monticello, MN"},{"city":"Montrose","state":"MN","city_state":"Montrose, MN"},{"city":"Mound","state":"MN","city_state":"Mound, MN"},{"city":"Mounds View","state":"MN","city_state":"Mounds View, MN"},{"city":"N Minneapolis","state":"MN","city_state":"N Minneapolis, MN"},{"city":"NE Minneapolis","state":"MN","city_state":"NE Minneapolis, MN"},{"city":"New Brighton","state":"MN","city_state":"New Brighton, MN"},{"city":"New Germany","state":"MN","city_state":"New Germany, MN"},{"city":"New Hope","state":"MN","city_state":"New Hope, MN"},{"city":"New Prague","state":"MN","city_state":"New Prague, MN"},{"city":"New Richmond","state":"WI","city_state":"New Richmond, WI"},{"city":"Newport","state":"MN","city_state":"Newport, MN"},{"city":"North Branch","state":"MN","city_state":"North Branch, MN"},{"city":"North Hudson","state":"WI","city_state":"North Hudson, WI"},{"city":"North Oaks","state":"MN","city_state":"North Oaks, MN"},{"city":"North St. Paul","state":"MN","city_state":"North St. Paul, MN"},{"city":"Northfield","state":"MN","city_state":"Northfield, MN"},{"city":"Norwood Young America","state":"MN","city_state":"Norwood Young America, MN"},{"city":"Nowthen","state":"MN","city_state":"Nowthen, MN"},{"city":"Oak Grove","state":"MN","city_state":"Oak Grove, MN"},{"city":"Oak Park Heights","state":"MN","city_state":"Oak Park Heights, MN"},{"city":"Oakdale","state":"MN","city_state":"Oakdale, MN"},{"city":"Orono","state":"MN","city_state":"Orono, MN"},{"city":"Osceola","state":"WI","city_state":"Osceola, WI"},{"city":"Osseo","state":"MN","city_state":"Osseo, MN"},{"city":"Otsego","state":"MN","city_state":"Otsego, MN"},{"city":"Pine Springs","state":"MN","city_state":"Pine Springs, MN"},{"city":"Plymouth","state":"MN","city_state":"Plymouth, MN"},{"city":"Prescott","state":"WI","city_state":"Prescott, WI"},{"city":"Princeton","state":"MN","city_state":"Princeton, MN"},{"city":"Prior Lake","state":"MN","city_state":"Prior Lake, MN"},{"city":"Ramsey","state":"MN","city_state":"Ramsey, MN"},{"city":"Richfield","state":"MN","city_state":"Richfield, MN"},{"city":"River Falls","state":"WI","city_state":"River Falls, WI"},{"city":"Robbinsdale","state":"MN","city_state":"Robbinsdale, MN"},{"city":"Roberts","state":"WI","city_state":"Roberts, WI"},{"city":"Rockford","state":"MN","city_state":"Rockford, MN"},{"city":"Rogers","state":"MN","city_state":"Rogers, MN"},{"city":"Rosemont","state":"MN","city_state":"Rosemont, MN"},{"city":"Roseville","state":"MN","city_state":"Roseville, MN"},{"city":"S Minneapolis","state":"MN","city_state":"S Minneapolis, MN"},{"city":"Savage","state":"MN","city_state":"Savage, MN"},{"city":"Scandia","state":"MN","city_state":"Scandia, MN"},{"city":"Shafer","state":"MN","city_state":"Shafer, MN"},{"city":"Shakopee","state":"MN","city_state":"Shakopee, MN"},{"city":"Shoreview","state":"MN","city_state":"Shoreview, MN"},{"city":"Shorewood","state":"MN","city_state":"Shorewood, MN"},{"city":"Somerset","state":"WI","city_state":"Somerset, WI"},{"city":"South St. Paul","state":"MN","city_state":"South St. Paul, MN"},{"city":"Spring Lake Park","state":"MN","city_state":"Spring Lake Park, MN"},{"city":"Spring Park","state":"MN","city_state":"Spring Park, MN"},{"city":"St Croix Beach","state":"MN","city_state":"St Croix Beach, MN"},{"city":"St. Marys Point","state":"MN","city_state":"St. Marys Point, MN"},{"city":"St. Anthony","state":"MN","city_state":"St. Anthony, MN"},{"city":"St. Bonifacius","state":"MN","city_state":"St. Bonifacius, MN"},{"city":"St. Francis","state":"MN","city_state":"St. Francis, MN"},{"city":"St. Louis Park","state":"MN","city_state":"St. Louis Park, MN"},{"city":"St. Michael","state":"MN","city_state":"St. Michael, MN"},{"city":"St. Paul","state":"MN","city_state":"St. Paul, MN"},{"city":"St. Paul Park","state":"MN","city_state":"St. Paul Park, MN"},{"city":"Stacy","state":"MN","city_state":"Stacy, MN"},{"city":"Stillwater","state":"MN","city_state":"Stillwater, MN"},{"city":"Sunfish Lake","state":"MN","city_state":"Sunfish Lake, MN"},{"city":"Tonka Bay","state":"MN","city_state":"Tonka Bay, MN"},{"city":"Vadnais Heights","state":"MN","city_state":"Vadnais Heights, MN"},{"city":"Vermillion","state":"MN","city_state":"Vermillion, MN"},{"city":"Victoria","state":"MN","city_state":"Victoria, MN"},{"city":"Waconia","state":"MN","city_state":"Waconia, MN"},{"city":"Watertown","state":"MN","city_state":"Watertown, MN"},{"city":"Waverly","state":"MN","city_state":"Waverly, MN"},{"city":"Wayzata","state":"MN","city_state":"Wayzata, MN"},{"city":"Webster","state":"MN","city_state":"Webster, MN"},{"city":"Welch","state":"MN","city_state":"Welch, MN"},{"city":"West Lakeland Township","state":"MN","city_state":"West Lakeland Township, MN"},{"city":"West St. Paul","state":"MN","city_state":"West St. Paul, MN"},{"city":"White Bear Lake","state":"MN","city_state":"White Bear Lake, MN"},{"city":"White Bear Township","state":"MN","city_state":"White Bear Township, MN"},{"city":"Willernie","state":"MN","city_state":"Willernie, MN"},{"city":"Woodbury","state":"MN","city_state":"Woodbury, MN"},{"city":"Wyoming","state":"MN","city_state":"Wyoming, MN"},{"city":"Young America","state":"MN","city_state":"Young America, MN"},{"city":"Zimmerman","state":"MN","city_state":"Zimmerman, MN"},{"city":"Ho Chi Minh City","state":"Ho Chi Minh","city_state":"Ho Chi Minh City , Ho Chi Minh"}]';
var dataLeadsourceFilter = '[{"key":"5 Star Rated"},{"key":"612-460-8007"},{"key":"612-567-0073"},{"key":"Angie\'s List"},{"key":"D2D"},{"key":"David Gross Cell"},{"key":"Dex"},{"key":"Frontier"},{"key":"Google"},{"key":"Internet"},{"key":"October Port 1"},{"key":"October Port 2"},{"key":"Old Ported"},{"key":"Return Customer"},{"key":"Trade"},{"key":"Show Bag"},{"key":"Tune Up Direct"},{"key":"Tune Up Direct (5 Round Marketing)"},{"key":"Yelp.com"},{"key":"Z BIZ CARDS AARON THOMPSON"},{"key":"Z BIZ CARDS ALEX HARROLD"},{"key":"Z BIZ CARDS BEN RANTALA"},{"key":"Z BIZ CARDS CRAIG WILKING"},{"key":"Z BIZ CARDS DJ SCHABERT"},{"key":"Z BIZ CARDS GERALD"},{"key":"Z BIZ CARDS JC"},{"key":"Z BIZ CARDS JD"},{"key":"Z BIZ CARDS JOE KILL"},{"key":"Z BIZ CARDS JR"},{"key":"Z BIZ CARDS LUKE KNUTSON"},{"key":"Z BIZ CARDS MASON MIZE"},{"key":"Z BIZ CARDS NATE"},{"key":"BRIDGE"},{"key":"Z BIZ CARDS NATHAN P"},{"key":"Z BIZ CARDS RUSTY"},{"key":"Z"},{"key":"Z - Former Employees"},{"key":"Z Home Show"},{"key":"Other"},{"key":"Employee Refferal"},{"key":"Website"},{"key":"Trade Show"},{"key":"Email"},{"key":"Walk-In"},{"key":"Chat"},{"key":"Call Rail"},{"key":"Home Advisor"}]';
var zipcodeFilter = '[{"address":"Andover, MN","status_geocode":"Ok","formatted_address":"Andover, MN 55304, USA","latitude":45.2332984,"longitude":-93.29134049999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55304","city":"Andover","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Bethel, MN","status_geocode":"Ok","formatted_address":"Bethel, MN 55005, USA","latitude":45.3992646,"longitude":-93.26528929999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55005","city":"Bethel","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Buffalo, MN","status_geocode":"Ok","formatted_address":"Buffalo, MN 55313, USA","latitude":45.1717846,"longitude":-93.8747929,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55313","city":"Buffalo","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Cannon Falls, MN","status_geocode":"Ok","formatted_address":"Cannon Falls, MN 55009, USA","latitude":44.5069113,"longitude":-92.905484,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55009","city":"Cannon Falls","country":"United States","region":"Minnesota","department":"Goodhue County","department_number":"Goodhue County"},{"address":"Castle Rock, MN","status_geocode":"Ok","formatted_address":"Castle Rock, MN 55057, USA","latitude":44.5438543,"longitude":-93.1524381,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55057","city":"Castle Rock","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Cedar, MN","status_geocode":"Ok","formatted_address":"Cedar, Oak Grove, MN 55011, USA","latitude":45.31968699999999,"longitude":-93.2860625,"type":"neighborhood, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55011","city":"Oak Grove","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Center City, MN","status_geocode":"Ok","formatted_address":"Center City, MN 55012, USA","latitude":45.3938525,"longitude":-92.81660230000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55012","city":"Center City","country":"United States","region":"Minnesota","department":"Chisago County","department_number":"Chisago County"},{"address":"Centerville, MN","status_geocode":"Ok","formatted_address":"Centerville, MN 55038, USA","latitude":45.16302230000001,"longitude":-93.0557757,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55038","city":"Centerville","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Champlin, MN","status_geocode":"Ok","formatted_address":"Champlin, MN 55316, USA","latitude":45.1888539,"longitude":-93.39745370000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55316","city":"Champlin","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Chaska, MN","status_geocode":"Ok","formatted_address":"Chaska, MN 55318, USA","latitude":44.7893446,"longitude":-93.60183889999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55318","city":"Chaska","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Circle Pines, MN","status_geocode":"Ok","formatted_address":"Circle Pines, MN 55014, USA","latitude":45.1485771,"longitude":-93.15161239999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55014","city":"Circle Pines","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Coates, MN","status_geocode":"Ok","formatted_address":"Coates, MN 55068, USA","latitude":44.7171888,"longitude":-93.0346576,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55068","city":"Coates","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Cologne, MN","status_geocode":"Ok","formatted_address":"Cologne, MN 55322, USA","latitude":44.7688889,"longitude":-93.7805556,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55322","city":"Cologne","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Columbia Heights, MN","status_geocode":"Ok","formatted_address":"Columbia Heights, MN 55421, USA","latitude":45.0481968,"longitude":-93.2474098,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55421","city":"Columbia Heights","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Crown, MN","status_geocode":"Ok","formatted_address":"Crown, MN 55070, USA","latitude":45.444722,"longitude":-93.4599999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55070","city":"Crown","country":"United States","region":"Minnesota","department":"Isanti County","department_number":"Isanti County"},{"address":"Delano, MN","status_geocode":"Ok","formatted_address":"Delano, MN 55328, USA","latitude":45.0419073,"longitude":-93.7891331,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55328","city":"Delano","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Dellwood, MN","status_geocode":"Ok","formatted_address":"Dellwood, MN 55110, USA","latitude":45.0899665,"longitude":-92.9724382,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55110","city":"Dellwood","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Dennison, MN","status_geocode":"Ok","formatted_address":"Dennison, MN 55018, USA","latitude":44.4069101,"longitude":-93.0393771,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55018","city":"Dennison","country":"United States","region":"Minnesota","department":"Goodhue County","department_number":"Goodhue County"},{"address":"Elk River, MN","status_geocode":"Ok","formatted_address":"Elk River, MN 55330, USA","latitude":45.33772829999999,"longitude":-93.56911219999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55330","city":"Elk River","country":"United States","region":"Minnesota","department":"Sherburne County","department_number":"Sherburne County"},{"address":"Excelsior, MN","status_geocode":"Ok","formatted_address":"Excelsior, MN 55331, USA","latitude":44.9032963,"longitude":-93.5663455,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55331","city":"Excelsior","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Fairibault, MN","status_geocode":"Ok","formatted_address":"Faribault, MN 55021, USA","latitude":44.2949636,"longitude":-93.268827,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55021","city":"Faribault","country":"United States","region":"Minnesota","department":"Rice County","department_number":"Rice County"},{"address":"Gem Lake, MN","status_geocode":"Ok","formatted_address":"Gem Lake, MN 55110, USA","latitude":45.05746600000001,"longitude":-93.03244029999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55110","city":"Gem Lake","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Greenwood, MN","status_geocode":"Ok","formatted_address":"Greenwood, MN 55331, USA","latitude":44.9149631,"longitude":-93.5532896,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55331","city":"Greenwood","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Ham Lake, MN","status_geocode":"Ok","formatted_address":"Ham Lake, MN 55304, USA","latitude":45.2502429,"longitude":-93.2499507,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55304","city":"Ham Lake","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Hamburg, MN","status_geocode":"Ok","formatted_address":"Hamburg, MN 55339, USA","latitude":44.7330546,"longitude":-93.9662153,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55339","city":"Hamburg","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Hampton, MN","status_geocode":"Ok","formatted_address":"Hampton, MN 55031, USA","latitude":44.6116667,"longitude":-92.99916669999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55031","city":"Hampton","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Hastings, MN","status_geocode":"Ok","formatted_address":"Hastings, MN 55033, USA","latitude":44.7443293,"longitude":-92.8513706,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55033","city":"Hastings","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Henderson, MN","status_geocode":"Ok","formatted_address":"Henderson, MN 56044, USA","latitude":44.5282971,"longitude":-93.90774379999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"56044","city":"Henderson","country":"United States","region":"Minnesota","department":"Sibley County","department_number":"Sibley County"},{"address":"Houlton, WI","status_geocode":"Ok","formatted_address":"Houlton, WI 54082, USA","latitude":45.0606267,"longitude":-92.79167769999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54082","city":"Houlton","country":"United States","region":"Wisconsin","department":"St. Croix County","department_number":"St Croix County"},{"address":"Howard Lake, MN","status_geocode":"Ok","formatted_address":"Howard Lake, MN 55349, USA","latitude":45.0612665,"longitude":-94.0742843,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55349","city":"Howard Lake","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Hudson, WI","status_geocode":"Ok","formatted_address":"Hudson, WI 54016, USA","latitude":44.9746896,"longitude":-92.7568703,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54016","city":"Hudson","country":"United States","region":"Wisconsin","department":"St. Croix County","department_number":"St Croix County"},{"address":"Isanti, MN","status_geocode":"Ok","formatted_address":"Isanti, MN 55040, USA","latitude":45.4894008,"longitude":-93.24760909999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55040","city":"Isanti","country":"United States","region":"Minnesota","department":"Isanti County","department_number":"Isanti County"},{"address":"Jordan, MN","status_geocode":"Ok","formatted_address":"Jordan, MN 55352, USA","latitude":44.6711949,"longitude":-93.6294286,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55352","city":"Jordan","country":"United States","region":"Minnesota","department":"Scott County","department_number":"Scott County"},{"address":"Lake Elmo, MN","status_geocode":"Ok","formatted_address":"Lake Elmo, MN 55042, USA","latitude":44.9957998,"longitude":-92.8793768,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55042","city":"Lake Elmo","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Lake Saint Croix Beach, MN","status_geocode":"Ok","formatted_address":"Lake St Croix Beach, MN 55043, USA","latitude":44.9208007,"longitude":-92.76687009999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55043","city":"Lake Saint Croix Beach","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Lakeland, MN","status_geocode":"Ok","formatted_address":"Lakeland, MN 55043, USA","latitude":44.9563563,"longitude":-92.7657593,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55043","city":"Lakeland","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Lakeland Shores, MN","status_geocode":"Ok","formatted_address":"Lakeland Shores, MN 55043, USA","latitude":44.948023,"longitude":-92.76409249999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55043","city":"Lakeland Shores","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Le Sueur, MN","status_geocode":"Ok","formatted_address":"Le Sueur, MN 56058, USA","latitude":44.4598517,"longitude":-93.9113634,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"56058","city":"Le Sueur","country":"United States","region":"Minnesota","department":"Le Sueur County","department_number":"Le Sueur County"},{"address":"Lexington, MN","status_geocode":"Ok","formatted_address":"Lexington, MN 55014, USA","latitude":45.1359942,"longitude":-93.1701619,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55014","city":"Lexington","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Lonsdale, MN","status_geocode":"Ok","formatted_address":"Lonsdale, MN 55046, USA","latitude":44.48024119999999,"longitude":-93.4285587,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55046","city":"Lonsdale","country":"United States","region":"Minnesota","department":"Rice County","department_number":"Rice County"},{"address":"Loretto, MN","status_geocode":"Ok","formatted_address":"Loretto, MN 55357, USA","latitude":45.0546855,"longitude":-93.63551649999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55357","city":"Loretto","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Maple Lake, MN","status_geocode":"Ok","formatted_address":"Maple Lake, MN 55358, USA","latitude":45.2299207,"longitude":-94.0038756,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55358","city":"Maple Lake","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Maple Plain, MN","status_geocode":"Ok","formatted_address":"Maple Plain, MN 55359, USA","latitude":45.0067822,"longitude":-93.6555315,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55359","city":"Maple Plain","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Marine on St. Croix, MN","status_geocode":"Ok","formatted_address":"Marine on St Croix, MN 55047, USA","latitude":45.1984344,"longitude":-92.77053099999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55047","city":"Marine on Saint Croix","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Mayer, MN","status_geocode":"Ok","formatted_address":"Mayer, MN 55360, USA","latitude":44.8849625,"longitude":-93.88774529999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55360","city":"Mayer","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Medicine Lake, MN","status_geocode":"Ok","formatted_address":"Medicine Lake, MN 55441, USA","latitude":44.9991099,"longitude":-93.4192127,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55441","city":"Medicine Lake","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Minnetonka Beach, MN","status_geocode":"Ok","formatted_address":"Minnetonka Beach, MN 55391, USA","latitude":44.9368839,"longitude":-93.58057579999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55391","city":"Minnetonka Beach","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Montgomery, MN","status_geocode":"Ok","formatted_address":"Montgomery, MN 56069, USA","latitude":44.4383146,"longitude":-93.58132010000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"56069","city":"Montgomery","country":"United States","region":"Minnesota","department":"Le Sueur County","department_number":"Le Sueur County"},{"address":"Montrose, MN","status_geocode":"Ok","formatted_address":"Montrose, MN 55363, USA","latitude":45.06944439999999,"longitude":-93.91249999999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55363","city":"Montrose","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Mound, MN","status_geocode":"Ok","formatted_address":"Mound, MN 55364, USA","latitude":44.9366295,"longitude":-93.66607189999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55364","city":"Mound","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Mounds View, MN","status_geocode":"Ok","formatted_address":"Mounds View, MN 55112, USA","latitude":45.1049656,"longitude":-93.2085582,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55112","city":"Mounds View","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"New Brighton, MN","status_geocode":"Ok","formatted_address":"New Brighton, MN 55112, USA","latitude":45.0655212,"longitude":-93.2018908,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55112","city":"New Brighton","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"New Germany, MN","status_geocode":"Ok","formatted_address":"New Germany, MN 55367, USA","latitude":44.8841291,"longitude":-93.9705254,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55367","city":"New Germany","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"New Prague, MN","status_geocode":"Ok","formatted_address":"New Prague, MN 56071, USA","latitude":44.5432966,"longitude":-93.5760652,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"56071","city":"New Prague","country":"United States","region":"Minnesota","department":"Scott County","department_number":"Scott County"},{"address":"New Richmond, WI","status_geocode":"Ok","formatted_address":"New Richmond, WI 54017, USA","latitude":45.1230213,"longitude":-92.5365865,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54017","city":"New Richmond","country":"United States","region":"Wisconsin","department":"St. Croix County","department_number":"St Croix County"},{"address":"North Hudson, WI","status_geocode":"Ok","formatted_address":"North Hudson, WI 54016, USA","latitude":44.993023,"longitude":-92.75687049999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54016","city":"North Hudson","country":"United States","region":"Wisconsin","department":"St. Croix County","department_number":"St Croix County"},{"address":"North Oaks, MN","status_geocode":"Ok","formatted_address":"North Oaks, MN 55127, USA","latitude":45.0914155,"longitude":-93.09053349999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55127","city":"North Oaks","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"North St. Paul, MN","status_geocode":"Ok","formatted_address":"North St Paul, MN 55109, USA","latitude":45.0124657,"longitude":-92.9918828,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55109","city":"North Saint Paul","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Northfield, MN","status_geocode":"Ok","formatted_address":"Northfield, MN 55057, USA","latitude":44.4582983,"longitude":-93.161604,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55057","city":"Northfield","country":"United States","region":"Minnesota","department":"Rice County","department_number":"Rice County"},{"address":"Oak Park Heights, MN","status_geocode":"Ok","formatted_address":"Oak Park Heights, MN 55082, USA","latitude":45.0313559,"longitude":-92.79298419999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55082","city":"Oak Park Heights","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Oakdale, MN","status_geocode":"Ok","formatted_address":"Oakdale, MN 55128, USA","latitude":44.9630216,"longitude":-92.9649361,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55128","city":"Oakdale","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Osceola, WI","status_geocode":"Ok","formatted_address":"Osceola, WI 54020, USA","latitude":45.3205199,"longitude":-92.7049303,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54020","city":"Osceola","country":"United States","region":"Wisconsin","department":"Polk County","department_number":"Polk County"},{"address":"Osseo, MN","status_geocode":"Ok","formatted_address":"Osseo, MN 55369, USA","latitude":45.1194091,"longitude":-93.4024532,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55369","city":"Osseo","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Prescott, WI","status_geocode":"Ok","formatted_address":"Prescott, WI 54021, USA","latitude":44.7488565,"longitude":-92.8021471,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54021","city":"Prescott","country":"United States","region":"Wisconsin","department":"Pierce County","department_number":"Pierce County"},{"address":"Princeton, MN","status_geocode":"Ok","formatted_address":"Princeton, MN 55371, USA","latitude":45.569965,"longitude":-93.58162779999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55371","city":"Princeton","country":"United States","region":"Minnesota","department":"Mille Lacs County","department_number":"Mille Lacs County"},{"address":"Ramsey, MN","status_geocode":"Ok","formatted_address":"Ramsey, MN 55303, USA","latitude":45.2611,"longitude":-93.45,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55303","city":"Ramsey","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"River Falls, WI","status_geocode":"Ok","formatted_address":"River Falls, WI 54022, USA","latitude":44.8613563,"longitude":-92.6238082,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54022","city":"River Falls","country":"United States","region":"Wisconsin","department":"Pierce County","department_number":"Pierce County"},{"address":"Roberts, WI","status_geocode":"Ok","formatted_address":"Roberts, WI 54023, USA","latitude":44.98385580000001,"longitude":-92.5560301,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54023","city":"Roberts","country":"United States","region":"Wisconsin","department":"St. Croix County","department_number":"St Croix County"},{"address":"Rogers, MN","status_geocode":"Ok","formatted_address":"Rogers, MN 55374, USA","latitude":45.1878015,"longitude":-93.55252059999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55374","city":"Rogers","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Rosemont, MN","status_geocode":"Ok","formatted_address":"Rosemount, MN 55068, USA","latitude":44.7394103,"longitude":-93.12577230000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55068","city":"Rosemount","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Roseville, MN","status_geocode":"Ok","formatted_address":"Roseville, MN 55113, USA","latitude":45.0060767,"longitude":-93.15661070000002,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55113","city":"Roseville","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Shafer, MN","status_geocode":"Ok","formatted_address":"Shafer, MN 55074, USA","latitude":45.3869076,"longitude":-92.7477114,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55074","city":"Shafer","country":"United States","region":"Minnesota","department":"Chisago County","department_number":"Chisago County"},{"address":"Shoreview, MN","status_geocode":"Ok","formatted_address":"Shoreview, MN 55126, USA","latitude":45.0791325,"longitude":-93.14716670000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55126","city":"Shoreview","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Somerset, WI","status_geocode":"Ok","formatted_address":"Somerset, WI 54025, USA","latitude":45.1244108,"longitude":-92.6735365,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54025","city":"Somerset","country":"United States","region":"Wisconsin","department":"St. Croix County","department_number":"St Croix County"},{"address":"Spring Lake Park, MN","status_geocode":"Ok","formatted_address":"Spring Lake Park, MN 55432, USA","latitude":45.1077433,"longitude":-93.2380038,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55432","city":"Spring Lake Park","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Spring Park, MN","status_geocode":"Ok","formatted_address":"Spring Park, MN 55384, USA","latitude":44.9352407,"longitude":-93.63218169999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55384","city":"Spring Park","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"St Croix Beach, MN","status_geocode":"Ok","formatted_address":"Lake St Croix Beach, MN 55043, USA","latitude":44.9208007,"longitude":-92.76687009999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55043","city":"Lake Saint Croix Beach","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"St. Marys Point, MN","status_geocode":"Ok","formatted_address":"St Marys Point, MN 55043, USA","latitude":44.9144322,"longitude":-92.77152839999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55043","city":"Saint Marys Point","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"St. Bonifacius, MN","status_geocode":"Ok","formatted_address":"St Bonifacius, MN 55375, USA","latitude":44.90551809999999,"longitude":-93.74746359999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55375","city":"Saint Bonifacius","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Stacy, MN","status_geocode":"Ok","formatted_address":"Stacy, MN 55079, USA","latitude":45.3980205,"longitude":-92.9874404,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55079","city":"Stacy","country":"United States","region":"Minnesota","department":"Chisago County","department_number":"Chisago County"},{"address":"Stillwater, MN","status_geocode":"Ok","formatted_address":"Stillwater, MN 55082, USA","latitude":45.056004,"longitude":-92.80884429999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55082","city":"Stillwater","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Tonka Bay, MN","status_geocode":"Ok","formatted_address":"Tonka Bay, MN 55331, USA","latitude":44.9085741,"longitude":-93.5930133,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55331","city":"Tonka Bay","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Waconia, MN","status_geocode":"Ok","formatted_address":"Waconia, MN 55387, USA","latitude":44.8504317,"longitude":-93.78764289999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55387","city":"Waconia","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Wayzata, MN","status_geocode":"Ok","formatted_address":"Wayzata, MN 55391, USA","latitude":44.97413,"longitude":-93.5066217,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55391","city":"Wayzata","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Webster, MN","status_geocode":"Ok","formatted_address":"Webster, MN 55088, USA","latitude":44.529686,"longitude":-93.352723,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55088","city":"Webster","country":"United States","region":"Minnesota","department":"Rice County","department_number":"Rice County"},{"address":"Welch, MN","status_geocode":"Ok","formatted_address":"Welch, MN 55089, USA","latitude":44.5683003,"longitude":-92.7385321,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55089","city":"Welch","country":"United States","region":"Minnesota","department":"Goodhue County","department_number":"Goodhue County"},{"address":"West St. Paul, MN","status_geocode":"Ok","formatted_address":"West St Paul, MN 55118, USA","latitude":44.9160768,"longitude":-93.10160739999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55118","city":"West Saint Paul","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Zimmerman, MN","status_geocode":"Ok","formatted_address":"Zimmerman, MN 55398, USA","latitude":45.4432986,"longitude":-93.58996200000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55398","city":"Zimmerman","country":"United States","region":"Minnesota","department":"Sherburne County","department_number":"Sherburne County"}]';
var zipcodeFilterFull = '[{"address":"Afton, MN","status_geocode":"Ok","formatted_address":"Afton, MN, USA","latitude":44.9027452,"longitude":-92.78353729999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Afton","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Albertville, MN","status_geocode":"Ok","formatted_address":"Albertville, MN, USA","latitude":45.2312337,"longitude":-93.66876569999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Albertville","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Andover, MN","status_geocode":"Ok","formatted_address":"Andover, MN 55304, USA","latitude":45.2332984,"longitude":-93.29134049999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55304","city":"Andover","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Anoka, MN","status_geocode":"Ok","formatted_address":"Anoka, MN, USA","latitude":45.1977428,"longitude":-93.38717579999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Anoka","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Apple Valley, MN","status_geocode":"Ok","formatted_address":"Apple Valley, MN, USA","latitude":44.7319094,"longitude":-93.21772000000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Apple Valley","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Arden Hills, MN","status_geocode":"Ok","formatted_address":"Arden Hills, MN, USA","latitude":45.0502435,"longitude":-93.1566112,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Arden Hills","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Bayport, MN","status_geocode":"Ok","formatted_address":"Bayport, MN, USA","latitude":45.01888779999999,"longitude":-92.77779889999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Bayport","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Becker, MN","status_geocode":"Ok","formatted_address":"Becker, MN, USA","latitude":45.3936545,"longitude":-93.8765076,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Becker","country":"United States","region":"Minnesota","department":"Sherburne County","department_number":"Sherburne County"},{"address":"Belle Plaine, MN","status_geocode":"Ok","formatted_address":"Belle Plaine, MN, USA","latitude":44.6230409,"longitude":-93.76840419999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Belle Plaine","country":"United States","region":"Minnesota","department":"Scott County","department_number":"Scott County"},{"address":"Bethel, MN","status_geocode":"Ok","formatted_address":"Bethel, MN 55005, USA","latitude":45.3992646,"longitude":-93.26528929999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55005","city":"Bethel","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Big Lake, MN","status_geocode":"Ok","formatted_address":"Big Lake, MN, USA","latitude":45.3331421,"longitude":-93.73350619999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Big Lake","country":"United States","region":"Minnesota","department":"Sherburne County","department_number":"Sherburne County"},{"address":"Blaine, MN","status_geocode":"Ok","formatted_address":"Blaine, MN, USA","latitude":45.1607987,"longitude":-93.23494889999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Blaine","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Bloomington, MN","status_geocode":"Ok","formatted_address":"Bloomington, MN, USA","latitude":44.840798,"longitude":-93.2982799,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Bloomington","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Brichwood Village, MN","status_geocode":"Ok","formatted_address":"Birchwood Village, MN, USA","latitude":45.0603175,"longitude":-92.9774108,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Birchwood Village","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Brooklyn Center, MN","status_geocode":"Ok","formatted_address":"Brooklyn Center, MN, USA","latitude":45.076076,"longitude":-93.3327283,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Brooklyn Center","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Brooklyn Park, MN","status_geocode":"Ok","formatted_address":"Brooklyn Park, MN, USA","latitude":45.0941315,"longitude":-93.3563405,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Brooklyn Park","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Buffalo, MN","status_geocode":"Ok","formatted_address":"Buffalo, MN 55313, USA","latitude":45.1717846,"longitude":-93.8747929,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55313","city":"Buffalo","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Burnsville, MN","status_geocode":"Ok","formatted_address":"Burnsville, MN, USA","latitude":44.7677424,"longitude":-93.27772259999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Burnsville","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Cambridge, MN","status_geocode":"Ok","formatted_address":"Cambridge, MN, USA","latitude":45.5656755,"longitude":-93.2258999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Cambridge","country":"United States","region":"Minnesota","department":"Isanti County","department_number":"Isanti County"},{"address":"Cannon Falls, MN","status_geocode":"Ok","formatted_address":"Cannon Falls, MN 55009, USA","latitude":44.5069113,"longitude":-92.905484,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55009","city":"Cannon Falls","country":"United States","region":"Minnesota","department":"Goodhue County","department_number":"Goodhue County"},{"address":"Carver, MN","status_geocode":"Ok","formatted_address":"Carver, MN, USA","latitude":44.76339429999999,"longitude":-93.6254404,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Carver","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Castle Rock, MN","status_geocode":"Ok","formatted_address":"Castle Rock, MN 55057, USA","latitude":44.5438543,"longitude":-93.1524381,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55057","city":"Castle Rock","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Cedar, MN","status_geocode":"Ok","formatted_address":"Cedar, Oak Grove, MN 55011, USA","latitude":45.31968699999999,"longitude":-93.2860625,"type":"neighborhood, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55011","city":"Oak Grove","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Center City, MN","status_geocode":"Ok","formatted_address":"Center City, MN 55012, USA","latitude":45.3938525,"longitude":-92.81660230000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55012","city":"Center City","country":"United States","region":"Minnesota","department":"Chisago County","department_number":"Chisago County"},{"address":"Centerville, MN","status_geocode":"Ok","formatted_address":"Centerville, MN 55038, USA","latitude":45.16302230000001,"longitude":-93.0557757,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55038","city":"Centerville","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Champlin, MN","status_geocode":"Ok","formatted_address":"Champlin, MN 55316, USA","latitude":45.1888539,"longitude":-93.39745370000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55316","city":"Champlin","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Chanhassen, MN","status_geocode":"Ok","formatted_address":"Chanhassen, MN, USA","latitude":44.86196450000001,"longitude":-93.53231029999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Chanhassen","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Chaska, MN","status_geocode":"Ok","formatted_address":"Chaska, MN 55318, USA","latitude":44.7893446,"longitude":-93.60183889999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55318","city":"Chaska","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Chisago City, MN","status_geocode":"Ok","formatted_address":"Chisago City, MN, USA","latitude":45.3735757,"longitude":-92.8899376,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Chisago City","country":"United States","region":"Minnesota","department":"Chisago County","department_number":"Chisago County"},{"address":"Circle Pines, MN","status_geocode":"Ok","formatted_address":"Circle Pines, MN 55014, USA","latitude":45.1485771,"longitude":-93.15161239999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55014","city":"Circle Pines","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Coates, MN","status_geocode":"Ok","formatted_address":"Coates, MN 55068, USA","latitude":44.7171888,"longitude":-93.0346576,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55068","city":"Coates","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Cocoran, MN","status_geocode":"Ok","formatted_address":"Corcoran, MN, USA","latitude":45.0952417,"longitude":-93.5474577,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Corcoran","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Cologne, MN","status_geocode":"Ok","formatted_address":"Cologne, MN 55322, USA","latitude":44.7688889,"longitude":-93.7805556,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55322","city":"Cologne","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Columbia Heights, MN","status_geocode":"Ok","formatted_address":"Columbia Heights, MN 55421, USA","latitude":45.0481968,"longitude":-93.2474098,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55421","city":"Columbia Heights","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Columbus, MN","status_geocode":"Ok","formatted_address":"Columbus, MN, USA","latitude":45.265222,"longitude":-93.05015299999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Columbus","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Coon Rapids, MN","status_geocode":"Ok","formatted_address":"Coon Rapids, MN, USA","latitude":45.1732394,"longitude":-93.30300629999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Coon Rapids","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Corcoran, MN","status_geocode":"Ok","formatted_address":"Corcoran, MN, USA","latitude":45.0952417,"longitude":-93.5474577,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Corcoran","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Cottage Grove, MN","status_geocode":"Ok","formatted_address":"Cottage Grove, MN, USA","latitude":44.8277446,"longitude":-92.94382179999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Cottage Grove","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Crown, MN","status_geocode":"Ok","formatted_address":"Crown, MN 55070, USA","latitude":45.444722,"longitude":-93.4599999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55070","city":"Crown","country":"United States","region":"Minnesota","department":"Isanti County","department_number":"Isanti County"},{"address":"Crystal, MN","status_geocode":"Ok","formatted_address":"Crystal, MN, USA","latitude":45.0327425,"longitude":-93.3602286,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Crystal","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Dayton, MN","status_geocode":"Ok","formatted_address":"Dayton, MN, USA","latitude":45.243854,"longitude":-93.5149576,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Dayton","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Deephaven, MN","status_geocode":"Ok","formatted_address":"Deephaven, MN, USA","latitude":44.9296853,"longitude":-93.5224552,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Deephaven","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Delano, MN","status_geocode":"Ok","formatted_address":"Delano, MN 55328, USA","latitude":45.0419073,"longitude":-93.7891331,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55328","city":"Delano","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Dellwood, MN","status_geocode":"Ok","formatted_address":"Dellwood, MN 55110, USA","latitude":45.0899665,"longitude":-92.9724382,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55110","city":"Dellwood","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Dennison, MN","status_geocode":"Ok","formatted_address":"Dennison, MN 55018, USA","latitude":44.4069101,"longitude":-93.0393771,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55018","city":"Dennison","country":"United States","region":"Minnesota","department":"Goodhue County","department_number":"Goodhue County"},{"address":"Dundas, MN","status_geocode":"Ok","formatted_address":"Dundas, MN, USA","latitude":44.4294089,"longitude":-93.20188259999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Dundas","country":"United States","region":"Minnesota","department":"Rice County","department_number":"Rice County"},{"address":"Eagan, MN","status_geocode":"Ok","formatted_address":"Eagan, MN, USA","latitude":44.8041322,"longitude":-93.1668858,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Eagan","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"East Bethel, MN","status_geocode":"Ok","formatted_address":"East Bethel, MN, USA","latitude":45.3194095,"longitude":-93.20244869999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"East Bethel","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"East St Paul, MN","status_geocode":"Ok","formatted_address":"St Paul, MN, USA","latitude":44.9537029,"longitude":-93.08995779999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Saint Paul","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Edina, MN","status_geocode":"Ok","formatted_address":"Edina, MN, USA","latitude":44.8896866,"longitude":-93.3499489,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Edina","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Elk River, MN","status_geocode":"Ok","formatted_address":"Elk River, MN 55330, USA","latitude":45.33772829999999,"longitude":-93.56911219999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55330","city":"Elk River","country":"United States","region":"Minnesota","department":"Sherburne County","department_number":"Sherburne County"},{"address":"Elko New Market, MN","status_geocode":"Ok","formatted_address":"Elko New Market, MN, USA","latitude":44.5647222,"longitude":-93.3269444,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Elko New Market","country":"United States","region":"Minnesota","department":"Scott County","department_number":"Scott County"},{"address":"Excelsior, MN","status_geocode":"Ok","formatted_address":"Excelsior, MN 55331, USA","latitude":44.9032963,"longitude":-93.5663455,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55331","city":"Excelsior","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Fairibault, MN","status_geocode":"Ok","formatted_address":"Faribault, MN 55021, USA","latitude":44.2949636,"longitude":-93.268827,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55021","city":"Faribault","country":"United States","region":"Minnesota","department":"Rice County","department_number":"Rice County"},{"address":"Falcon Heights, MN","status_geocode":"Ok","formatted_address":"Falcon Heights, MN, USA","latitude":44.99163230000001,"longitude":-93.16633299999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Falcon Heights","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Farmington, MN","status_geocode":"Ok","formatted_address":"Farmington, MN, USA","latitude":44.6402434,"longitude":-93.14354969999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Farmington","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Forest Lake, MN","status_geocode":"Ok","formatted_address":"Forest Lake, MN, USA","latitude":45.2788561,"longitude":-92.9852183,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Forest Lake","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Fridley, MN","status_geocode":"Ok","formatted_address":"Fridley, MN, USA","latitude":45.0860765,"longitude":-93.2632821,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Fridley","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Gem Lake, MN","status_geocode":"Ok","formatted_address":"Gem Lake, MN 55110, USA","latitude":45.05746600000001,"longitude":-93.03244029999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55110","city":"Gem Lake","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Golden Valley, MN","status_geocode":"Ok","formatted_address":"Golden Valley, MN, USA","latitude":44.9917149,"longitude":-93.3600034,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Golden Valley","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Grant, MN","status_geocode":"Ok","formatted_address":"Grant, MN, USA","latitude":45.084411,"longitude":-92.91049079999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Grant","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Greenfield, MN","status_geocode":"Ok","formatted_address":"Greenfield, MN, USA","latitude":45.1032966,"longitude":-93.6913527,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Greenfield","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Greenwood, MN","status_geocode":"Ok","formatted_address":"Greenwood, MN 55331, USA","latitude":44.9149631,"longitude":-93.5532896,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55331","city":"Greenwood","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Ham Lake, MN","status_geocode":"Ok","formatted_address":"Ham Lake, MN 55304, USA","latitude":45.2502429,"longitude":-93.2499507,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55304","city":"Ham Lake","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Hamburg, MN","status_geocode":"Ok","formatted_address":"Hamburg, MN 55339, USA","latitude":44.7330546,"longitude":-93.9662153,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55339","city":"Hamburg","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Hamel, MN","status_geocode":"Ok","formatted_address":"Hamel, Medina, MN, USA","latitude":45.0408365,"longitude":-93.5253597,"type":"neighborhood, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Medina","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Hampton, MN","status_geocode":"Ok","formatted_address":"Hampton, MN 55031, USA","latitude":44.6116667,"longitude":-92.99916669999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55031","city":"Hampton","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Hanover, MN","status_geocode":"Ok","formatted_address":"Hanover, MN, USA","latitude":45.155797,"longitude":-93.6663523,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Hanover","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Harris, MN","status_geocode":"Ok","formatted_address":"Harris, MN, USA","latitude":45.5860723,"longitude":-92.9745964,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Harris","country":"United States","region":"Minnesota","department":"Chisago County","department_number":"Chisago County"},{"address":"Hastings, MN","status_geocode":"Ok","formatted_address":"Hastings, MN 55033, USA","latitude":44.7443293,"longitude":-92.8513706,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55033","city":"Hastings","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Henderson, MN","status_geocode":"Ok","formatted_address":"Henderson, MN 56044, USA","latitude":44.5282971,"longitude":-93.90774379999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"56044","city":"Henderson","country":"United States","region":"Minnesota","department":"Sibley County","department_number":"Sibley County"},{"address":"Highland Park, MN","status_geocode":"Ok","formatted_address":"Highland, St Paul, MN, USA","latitude":44.9095374,"longitude":-93.1679257,"type":"neighborhood, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Saint Paul","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Hopkins, MN","status_geocode":"Ok","formatted_address":"Hopkins, MN, USA","latitude":44.9260794,"longitude":-93.40441869999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Hopkins","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Houlton, WI","status_geocode":"Ok","formatted_address":"Houlton, WI 54082, USA","latitude":45.0606267,"longitude":-92.79167769999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54082","city":"Houlton","country":"United States","region":"Wisconsin","department":"St. Croix County","department_number":"St Croix County"},{"address":"Howard Lake, MN","status_geocode":"Ok","formatted_address":"Howard Lake, MN 55349, USA","latitude":45.0612665,"longitude":-94.0742843,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55349","city":"Howard Lake","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Hudson, WI","status_geocode":"Ok","formatted_address":"Hudson, WI 54016, USA","latitude":44.9746896,"longitude":-92.7568703,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54016","city":"Hudson","country":"United States","region":"Wisconsin","department":"St. Croix County","department_number":"St Croix County"},{"address":"Hugo, MN","status_geocode":"Ok","formatted_address":"Hugo, MN, USA","latitude":45.159964,"longitude":-92.99334119999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Hugo","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Independance, MN","status_geocode":"Ok","formatted_address":"Independence, MN, USA","latitude":45.0252407,"longitude":-93.70746339999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Independence","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Inver Grove Heights, MN","status_geocode":"Ok","formatted_address":"Inver Grove Heights, MN, USA","latitude":44.8480218,"longitude":-93.04271530000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Inver Grove Heights","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Isanti, MN","status_geocode":"Ok","formatted_address":"Isanti, MN 55040, USA","latitude":45.4894008,"longitude":-93.24760909999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55040","city":"Isanti","country":"United States","region":"Minnesota","department":"Isanti County","department_number":"Isanti County"},{"address":"Jordan, MN","status_geocode":"Ok","formatted_address":"Jordan, MN 55352, USA","latitude":44.6711949,"longitude":-93.6294286,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55352","city":"Jordan","country":"United States","region":"Minnesota","department":"Scott County","department_number":"Scott County"},{"address":"Lake Elmo, MN","status_geocode":"Ok","formatted_address":"Lake Elmo, MN 55042, USA","latitude":44.9957998,"longitude":-92.8793768,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55042","city":"Lake Elmo","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Lake Saint Croix Beach, MN","status_geocode":"Ok","formatted_address":"Lake St Croix Beach, MN 55043, USA","latitude":44.9208007,"longitude":-92.76687009999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55043","city":"Lake Saint Croix Beach","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Lakeland, MN","status_geocode":"Ok","formatted_address":"Lakeland, MN 55043, USA","latitude":44.9563563,"longitude":-92.7657593,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55043","city":"Lakeland","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Lakeland Shores, MN","status_geocode":"Ok","formatted_address":"Lakeland Shores, MN 55043, USA","latitude":44.948023,"longitude":-92.76409249999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55043","city":"Lakeland Shores","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Lakeville, MN","status_geocode":"Ok","formatted_address":"Lakeville, MN, USA","latitude":44.6496868,"longitude":-93.24271999999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Lakeville","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Lauderdale, MN","status_geocode":"Ok","formatted_address":"Lauderdale, MN, USA","latitude":44.9985767,"longitude":-93.2057789,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Lauderdale","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Le Sueur, MN","status_geocode":"Ok","formatted_address":"Le Sueur, MN 56058, USA","latitude":44.4598517,"longitude":-93.9113634,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"56058","city":"Le Sueur","country":"United States","region":"Minnesota","department":"Le Sueur County","department_number":"Le Sueur County"},{"address":"Lexington, MN","status_geocode":"Ok","formatted_address":"Lexington, MN 55014, USA","latitude":45.1359942,"longitude":-93.1701619,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55014","city":"Lexington","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Lilydale, MN","status_geocode":"Ok","formatted_address":"Lilydale, MN, USA","latitude":44.9160768,"longitude":-93.12605259999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Lilydale","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Lindstrom, MN","status_geocode":"Ok","formatted_address":"Lindstrom, MN, USA","latitude":45.3894083,"longitude":-92.8479921,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Lindstrom","country":"United States","region":"Minnesota","department":"Chisago County","department_number":"Chisago County"},{"address":"Lino Lakes, MN","status_geocode":"Ok","formatted_address":"Lino Lakes, MN, USA","latitude":45.1602442,"longitude":-93.0888324,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Lino Lakes","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Linwood Township, MN","status_geocode":"Ok","formatted_address":"Linwood Township, MN, USA","latitude":45.3519468,"longitude":-93.0795069,"type":"administrative_area_level_3, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":null,"country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Little Canada, MN","status_geocode":"Ok","formatted_address":"Little Canada, MN, USA","latitude":45.02691009999999,"longitude":-93.0877196,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Little Canada","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Long Lake, MN","status_geocode":"Ok","formatted_address":"Long Lake, MN, USA","latitude":44.9866298,"longitude":-93.5716243,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Long Lake","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Lonsdale, MN","status_geocode":"Ok","formatted_address":"Lonsdale, MN 55046, USA","latitude":44.48024119999999,"longitude":-93.4285587,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55046","city":"Lonsdale","country":"United States","region":"Minnesota","department":"Rice County","department_number":"Rice County"},{"address":"Loretto, MN","status_geocode":"Ok","formatted_address":"Loretto, MN 55357, USA","latitude":45.0546855,"longitude":-93.63551649999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55357","city":"Loretto","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Mahtomedi, MN","status_geocode":"Ok","formatted_address":"Mahtomedi, MN, USA","latitude":45.0696886,"longitude":-92.95160369999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Mahtomedi","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Maple Grove, MN","status_geocode":"Ok","formatted_address":"Maple Grove, MN, USA","latitude":45.0724642,"longitude":-93.4557877,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Maple Grove","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Maple Lake, MN","status_geocode":"Ok","formatted_address":"Maple Lake, MN 55358, USA","latitude":45.2299207,"longitude":-94.0038756,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55358","city":"Maple Lake","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Maple Plain, MN","status_geocode":"Ok","formatted_address":"Maple Plain, MN 55359, USA","latitude":45.0067822,"longitude":-93.6555315,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55359","city":"Maple Plain","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Maplewood, MN","status_geocode":"Ok","formatted_address":"Maplewood, MN, USA","latitude":44.9530215,"longitude":-92.9952153,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Maplewood","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Marine on St. Croix, MN","status_geocode":"Ok","formatted_address":"Marine on St Croix, MN 55047, USA","latitude":45.1984344,"longitude":-92.77053099999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55047","city":"Marine on Saint Croix","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Mayer, MN","status_geocode":"Ok","formatted_address":"Mayer, MN 55360, USA","latitude":44.8849625,"longitude":-93.88774529999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55360","city":"Mayer","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Medicine Lake, MN","status_geocode":"Ok","formatted_address":"Medicine Lake, MN 55441, USA","latitude":44.9991099,"longitude":-93.4192127,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55441","city":"Medicine Lake","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Medina, MN","status_geocode":"Ok","formatted_address":"Medina, MN, USA","latitude":45.0352411,"longitude":-93.5824586,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Medina","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Mendota, MN","status_geocode":"Ok","formatted_address":"Mendota, MN, USA","latitude":44.8871878,"longitude":-93.1643869,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Mendota","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Mendota Heights, MN","status_geocode":"Ok","formatted_address":"Mendota Heights, MN, USA","latitude":44.8835768,"longitude":-93.1382749,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Mendota Heights","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Minneapolis, MN","status_geocode":"Ok","formatted_address":"Minneapolis, MN, USA","latitude":44.977753,"longitude":-93.2650108,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Minneapolis","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Minnetonka, MN","status_geocode":"Ok","formatted_address":"Minnetonka, MN, USA","latitude":44.9211836,"longitude":-93.46874889999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Minnetonka","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Minnetonka Beach, MN","status_geocode":"Ok","formatted_address":"Minnetonka Beach, MN 55391, USA","latitude":44.9368839,"longitude":-93.58057579999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55391","city":"Minnetonka Beach","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Minnetrista, MN","status_geocode":"Ok","formatted_address":"Minnetrista, MN, USA","latitude":44.938296,"longitude":-93.7177406,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Minnetrista","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Montgomery, MN","status_geocode":"Ok","formatted_address":"Montgomery, MN 56069, USA","latitude":44.4383146,"longitude":-93.58132010000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"56069","city":"Montgomery","country":"United States","region":"Minnesota","department":"Le Sueur County","department_number":"Le Sueur County"},{"address":"Monticello, MN","status_geocode":"Ok","formatted_address":"Monticello, MN, USA","latitude":45.3055201,"longitude":-93.7941378,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Monticello","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Montrose, MN","status_geocode":"Ok","formatted_address":"Montrose, MN 55363, USA","latitude":45.06944439999999,"longitude":-93.91249999999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55363","city":"Montrose","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Mound, MN","status_geocode":"Ok","formatted_address":"Mound, MN 55364, USA","latitude":44.9366295,"longitude":-93.66607189999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55364","city":"Mound","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Mounds View, MN","status_geocode":"Ok","formatted_address":"Mounds View, MN 55112, USA","latitude":45.1049656,"longitude":-93.2085582,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55112","city":"Mounds View","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"North Minneapolis, MN","status_geocode":"Ok, partial match","formatted_address":"Minneapolis, MN, USA","latitude":44.977753,"longitude":-93.2650108,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Minneapolis","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"NE Minneapolis, MN","status_geocode":"Ok","formatted_address":"Northeast Minneapolis, Minneapolis, MN, USA","latitude":45.0190505,"longitude":-93.2557053,"type":"neighborhood, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Minneapolis","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"New Brighton, MN","status_geocode":"Ok","formatted_address":"New Brighton, MN 55112, USA","latitude":45.0655212,"longitude":-93.2018908,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55112","city":"New Brighton","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"New Germany, MN","status_geocode":"Ok","formatted_address":"New Germany, MN 55367, USA","latitude":44.8841291,"longitude":-93.9705254,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55367","city":"New Germany","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"New Hope, MN","status_geocode":"Ok","formatted_address":"New Hope, MN, USA","latitude":45.0380201,"longitude":-93.3866185,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"New Hope","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"New Prague, MN","status_geocode":"Ok","formatted_address":"New Prague, MN 56071, USA","latitude":44.5432966,"longitude":-93.5760652,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"56071","city":"New Prague","country":"United States","region":"Minnesota","department":"Scott County","department_number":"Scott County"},{"address":"New Richmond, WI","status_geocode":"Ok","formatted_address":"New Richmond, WI 54017, USA","latitude":45.1230213,"longitude":-92.5365865,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54017","city":"New Richmond","country":"United States","region":"Wisconsin","department":"St. Croix County","department_number":"St Croix County"},{"address":"Newport, MN","status_geocode":"Ok","formatted_address":"Newport, MN, USA","latitude":44.8668528,"longitude":-92.99976909999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Newport","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"North Branch, MN","status_geocode":"Ok","formatted_address":"North Branch, MN, USA","latitude":45.5102135,"longitude":-92.99310539999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"North Branch","country":"United States","region":"Minnesota","department":"Chisago County","department_number":"Chisago County"},{"address":"North Hudson, WI","status_geocode":"Ok","formatted_address":"North Hudson, WI 54016, USA","latitude":44.993023,"longitude":-92.75687049999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54016","city":"North Hudson","country":"United States","region":"Wisconsin","department":"St. Croix County","department_number":"St Croix County"},{"address":"North Oaks, MN","status_geocode":"Ok","formatted_address":"North Oaks, MN 55127, USA","latitude":45.0914155,"longitude":-93.09053349999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55127","city":"North Oaks","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"North St. Paul, MN","status_geocode":"Ok","formatted_address":"North St Paul, MN 55109, USA","latitude":45.0124657,"longitude":-92.9918828,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55109","city":"North Saint Paul","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Northfield, MN","status_geocode":"Ok","formatted_address":"Northfield, MN 55057, USA","latitude":44.4582983,"longitude":-93.161604,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55057","city":"Northfield","country":"United States","region":"Minnesota","department":"Rice County","department_number":"Rice County"},{"address":"Norwood Young America, MN","status_geocode":"Ok","formatted_address":"Norwood Young America, MN, USA","latitude":44.7735732,"longitude":-93.92163479999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Norwood Young America","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Nowthen, MN","status_geocode":"Ok","formatted_address":"Burns Township, MN, USA","latitude":45.3414932,"longitude":-93.44626020000001,"type":"administrative_area_level_3, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":null,"country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Oak Grove, MN","status_geocode":"Ok","formatted_address":"Oak Grove, MN, USA","latitude":45.3407981,"longitude":-93.326897,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Oak Grove","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Oak Park Heights, MN","status_geocode":"Ok","formatted_address":"Oak Park Heights, MN 55082, USA","latitude":45.0313559,"longitude":-92.79298419999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55082","city":"Oak Park Heights","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Oakdale, MN","status_geocode":"Ok","formatted_address":"Oakdale, MN 55128, USA","latitude":44.9630216,"longitude":-92.9649361,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55128","city":"Oakdale","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Orono, MN","status_geocode":"Ok","formatted_address":"Orono, MN, USA","latitude":44.97135189999999,"longitude":-93.6044033,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Orono","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Osceola, WI","status_geocode":"Ok","formatted_address":"Osceola, WI 54020, USA","latitude":45.3205199,"longitude":-92.7049303,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54020","city":"Osceola","country":"United States","region":"Wisconsin","department":"Polk County","department_number":"Polk County"},{"address":"Osseo, MN","status_geocode":"Ok","formatted_address":"Osseo, MN 55369, USA","latitude":45.1194091,"longitude":-93.4024532,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55369","city":"Osseo","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Otsego, MN","status_geocode":"Ok","formatted_address":"Otsego, MN, USA","latitude":45.2741314,"longitude":-93.5913501,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Otsego","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Pine Springs, MN","status_geocode":"Ok","formatted_address":"Pine Springs, MN, USA","latitude":45.03579939999999,"longitude":-92.9543812,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Pine Springs","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Plymouth, MN","status_geocode":"Ok","formatted_address":"Plymouth, MN, USA","latitude":45.0105194,"longitude":-93.4555093,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Plymouth","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Prescott, WI","status_geocode":"Ok","formatted_address":"Prescott, WI 54021, USA","latitude":44.7488565,"longitude":-92.8021471,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54021","city":"Prescott","country":"United States","region":"Wisconsin","department":"Pierce County","department_number":"Pierce County"},{"address":"Princeton, MN","status_geocode":"Ok","formatted_address":"Princeton, MN 55371, USA","latitude":45.569965,"longitude":-93.58162779999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55371","city":"Princeton","country":"United States","region":"Minnesota","department":"Mille Lacs County","department_number":"Mille Lacs County"},{"address":"Prior Lake, MN","status_geocode":"Ok","formatted_address":"Prior Lake, MN, USA","latitude":44.7132969,"longitude":-93.4227274,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Prior Lake","country":"United States","region":"Minnesota","department":"Scott County","department_number":"Scott County"},{"address":"Ramsey, MN","status_geocode":"Ok","formatted_address":"Ramsey, MN 55303, USA","latitude":45.2611,"longitude":-93.45,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55303","city":"Ramsey","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Richfield, MN","status_geocode":"Ok","formatted_address":"Richfield, MN, USA","latitude":44.8832982,"longitude":-93.28300209999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Richfield","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"River Falls, WI","status_geocode":"Ok","formatted_address":"River Falls, WI 54022, USA","latitude":44.8613563,"longitude":-92.6238082,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54022","city":"River Falls","country":"United States","region":"Wisconsin","department":"Pierce County","department_number":"Pierce County"},{"address":"Robbinsdale, MN","status_geocode":"Ok","formatted_address":"Robbinsdale, MN, USA","latitude":45.032187,"longitude":-93.3385614,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Robbinsdale","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Roberts, WI","status_geocode":"Ok","formatted_address":"Roberts, WI 54023, USA","latitude":44.98385580000001,"longitude":-92.5560301,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54023","city":"Roberts","country":"United States","region":"Wisconsin","department":"St. Croix County","department_number":"St Croix County"},{"address":"Rockford, MN","status_geocode":"Ok","formatted_address":"Rockford, MN, USA","latitude":45.0872861,"longitude":-93.74150929999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Rockford","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Rogers, MN","status_geocode":"Ok","formatted_address":"Rogers, MN 55374, USA","latitude":45.1878015,"longitude":-93.55252059999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55374","city":"Rogers","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Rosemont, MN","status_geocode":"Ok","formatted_address":"Rosemount, MN 55068, USA","latitude":44.7394103,"longitude":-93.12577230000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55068","city":"Rosemount","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Roseville, MN","status_geocode":"Ok","formatted_address":"Roseville, MN 55113, USA","latitude":45.0060767,"longitude":-93.15661070000002,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55113","city":"Roseville","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"South Minneapolis, MN","status_geocode":"Ok, partial match","formatted_address":"Minneapolis, MN, USA","latitude":44.977753,"longitude":-93.2650108,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Minneapolis","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Savage, MN","status_geocode":"Ok","formatted_address":"Savage, MN, USA","latitude":44.7647329,"longitude":-93.35911470000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Savage","country":"United States","region":"Minnesota","department":"Scott County","department_number":"Scott County"},{"address":"Scandia, MN","status_geocode":"Ok","formatted_address":"Scandia, MN, USA","latitude":45.2535777,"longitude":-92.80576689999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Scandia","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Shafer, MN","status_geocode":"Ok","formatted_address":"Shafer, MN 55074, USA","latitude":45.3869076,"longitude":-92.7477114,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55074","city":"Shafer","country":"United States","region":"Minnesota","department":"Chisago County","department_number":"Chisago County"},{"address":"Shakopee, MN","status_geocode":"Ok","formatted_address":"Shakopee, MN, USA","latitude":44.7973962,"longitude":-93.5272861,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Shakopee","country":"United States","region":"Minnesota","department":"Scott County","department_number":"Scott County"},{"address":"Shoreview, MN","status_geocode":"Ok","formatted_address":"Shoreview, MN 55126, USA","latitude":45.0791325,"longitude":-93.14716670000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55126","city":"Shoreview","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Shorewood, MN","status_geocode":"Ok","formatted_address":"Shorewood, MN, USA","latitude":44.90115309999999,"longitude":-93.58470919999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Shorewood","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Somerset, WI","status_geocode":"Ok","formatted_address":"Somerset, WI 54025, USA","latitude":45.1244108,"longitude":-92.6735365,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"54025","city":"Somerset","country":"United States","region":"Wisconsin","department":"St. Croix County","department_number":"St Croix County"},{"address":"South St. Paul, MN","status_geocode":"Ok","formatted_address":"South St Paul, MN, USA","latitude":44.8759802,"longitude":-93.0275802,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"South Saint Paul","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Spring Lake Park, MN","status_geocode":"Ok","formatted_address":"Spring Lake Park, MN 55432, USA","latitude":45.1077433,"longitude":-93.2380038,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55432","city":"Spring Lake Park","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"Spring Park, MN","status_geocode":"Ok","formatted_address":"Spring Park, MN 55384, USA","latitude":44.9352407,"longitude":-93.63218169999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55384","city":"Spring Park","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"St Croix Beach, MN","status_geocode":"Ok","formatted_address":"Lake St Croix Beach, MN 55043, USA","latitude":44.9208007,"longitude":-92.76687009999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55043","city":"Lake Saint Croix Beach","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"St. Marys Point, MN","status_geocode":"Ok","formatted_address":"St Marys Point, MN 55043, USA","latitude":44.9144322,"longitude":-92.77152839999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55043","city":"Saint Marys Point","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"St. Anthony, MN","status_geocode":"Ok","formatted_address":"St Anthony, MN, USA","latitude":45.0205565,"longitude":-93.2179335,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Saint Anthony","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"St. Bonifacius, MN","status_geocode":"Ok","formatted_address":"St Bonifacius, MN 55375, USA","latitude":44.90551809999999,"longitude":-93.74746359999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55375","city":"Saint Bonifacius","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"St. Francis, MN","status_geocode":"Ok","formatted_address":"St Francis, MN, USA","latitude":45.3974847,"longitude":-93.38792199999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Saint Francis","country":"United States","region":"Minnesota","department":"Anoka County","department_number":"Anoka County"},{"address":"St. Louis Park, MN","status_geocode":"Ok","formatted_address":"St Louis Park, MN, USA","latitude":44.9597376,"longitude":-93.3702186,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Saint Louis Park","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"St. Michael, MN","status_geocode":"Ok","formatted_address":"St Michael, MN, USA","latitude":45.209964,"longitude":-93.6649642,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Saint Michael","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"St. Paul, MN","status_geocode":"Ok","formatted_address":"St Paul, MN, USA","latitude":44.9537029,"longitude":-93.08995779999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Saint Paul","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"St. Paul Park, MN","status_geocode":"Ok","formatted_address":"St Paul Park, MN, USA","latitude":44.8348405,"longitude":-92.99255769999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Saint Paul Park","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Stacy, MN","status_geocode":"Ok","formatted_address":"Stacy, MN 55079, USA","latitude":45.3980205,"longitude":-92.9874404,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55079","city":"Stacy","country":"United States","region":"Minnesota","department":"Chisago County","department_number":"Chisago County"},{"address":"Stillwater, MN","status_geocode":"Ok","formatted_address":"Stillwater, MN 55082, USA","latitude":45.056004,"longitude":-92.80884429999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55082","city":"Stillwater","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Sunfish Lake, MN","status_geocode":"Ok","formatted_address":"Sunfish Lake, MN, USA","latitude":44.8707992,"longitude":-93.098551,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Sunfish Lake","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Tonka Bay, MN","status_geocode":"Ok","formatted_address":"Tonka Bay, MN 55331, USA","latitude":44.9085741,"longitude":-93.5930133,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55331","city":"Tonka Bay","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Vadnais Heights, MN","status_geocode":"Ok","formatted_address":"Vadnais Heights, MN, USA","latitude":45.0574658,"longitude":-93.0738305,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Vadnais Heights","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Vermillion, MN","status_geocode":"Ok","formatted_address":"Vermillion, MN, USA","latitude":44.6735782,"longitude":-92.96715449999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Vermillion","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"Victoria, MN","status_geocode":"Ok","formatted_address":"Victoria, MN, USA","latitude":44.8587227,"longitude":-93.6615338,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Victoria","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Waconia, MN","status_geocode":"Ok","formatted_address":"Waconia, MN 55387, USA","latitude":44.8504317,"longitude":-93.78764289999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55387","city":"Waconia","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Watertown, MN","status_geocode":"Ok","formatted_address":"Watertown, MN, USA","latitude":44.9635738,"longitude":-93.847189,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Watertown","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Waverly, MN","status_geocode":"Ok","formatted_address":"Waverly, MN, USA","latitude":45.0643283,"longitude":-93.9679204,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Waverly","country":"United States","region":"Minnesota","department":"Wright County","department_number":"Wright County"},{"address":"Wayzata, MN","status_geocode":"Ok","formatted_address":"Wayzata, MN 55391, USA","latitude":44.97413,"longitude":-93.5066217,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55391","city":"Wayzata","country":"United States","region":"Minnesota","department":"Hennepin County","department_number":"Hennepin County"},{"address":"Webster, MN","status_geocode":"Ok","formatted_address":"Webster, MN 55088, USA","latitude":44.529686,"longitude":-93.352723,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55088","city":"Webster","country":"United States","region":"Minnesota","department":"Rice County","department_number":"Rice County"},{"address":"Welch, MN","status_geocode":"Ok","formatted_address":"Welch, MN 55089, USA","latitude":44.5683003,"longitude":-92.7385321,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55089","city":"Welch","country":"United States","region":"Minnesota","department":"Goodhue County","department_number":"Goodhue County"},{"address":"West Lakeland Township, MN","status_geocode":"Ok","formatted_address":"West Lakeland Township, MN, USA","latitude":44.9743985,"longitude":-92.8287156,"type":"administrative_area_level_3, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":null,"country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"West St. Paul, MN","status_geocode":"Ok","formatted_address":"West St Paul, MN 55118, USA","latitude":44.9160768,"longitude":-93.10160739999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55118","city":"West Saint Paul","country":"United States","region":"Minnesota","department":"Dakota County","department_number":"Dakota County"},{"address":"White Bear Lake, MN","status_geocode":"Ok","formatted_address":"White Bear Lake, MN, USA","latitude":45.0853814,"longitude":-93.0081479,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"White Bear Lake","country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"White Bear Township, MN","status_geocode":"Ok","formatted_address":"White Bear Township, MN, USA","latitude":45.09607159999999,"longitude":-93.02095419999999,"type":"administrative_area_level_3, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":null,"country":"United States","region":"Minnesota","department":"Ramsey County","department_number":"Ramsey County"},{"address":"Willernie, MN","status_geocode":"Ok","formatted_address":"Willernie, MN, USA","latitude":45.0541329,"longitude":-92.9566037,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Willernie","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Woodbury, MN","status_geocode":"Ok","formatted_address":"Woodbury, MN, USA","latitude":44.9238552,"longitude":-92.9593797,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Woodbury","country":"United States","region":"Minnesota","department":"Washington County","department_number":"Washington County"},{"address":"Wyoming, MN","status_geocode":"Ok","formatted_address":"Wyoming Township, MN, USA","latitude":45.3080154,"longitude":-92.96312950000001,"type":"administrative_area_level_3, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":null,"country":"United States","region":"Minnesota","department":"Chisago County","department_number":"Chisago County"},{"address":"Young America, MN","status_geocode":"Ok","formatted_address":"Norwood Young America, MN, USA","latitude":44.7735732,"longitude":-93.92163479999999,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":null,"city":"Norwood Young America","country":"United States","region":"Minnesota","department":"Carver County","department_number":"Carver County"},{"address":"Zimmerman, MN","status_geocode":"Ok","formatted_address":"Zimmerman, MN 55398, USA","latitude":45.4432986,"longitude":-93.58996200000001,"type":"locality, political","location_type":"APPROXIMATE","street_number":null,"street":null,"postal_code":"55398","city":"Zimmerman","country":"United States","region":"Minnesota","department":"Sherburne County","department_number":"Sherburne County"}]';

function addEventScan(selector, container) {
  document.addEventListener('deviceready', scanCreditCard, false);
  var resizeType;

  function scanCreditCard() {
    CardIO.canScan(onCardIOCheck);

    function onCardIOComplete(response) {
      // var cardIOResponseFields = [
      //   "cardType",
      //   "redactedCardNumber",
      //   "cardNumber",
      //   "expiryMonth",
      //   "expiryYear",
      //   "cvv",
      //   "postalCode"
      // ];
      screen.orientation.unlock();
      var month_id = response['expiryMonth'];
      switch (response['expiryMonth']) {
        case 1:
          month = "January";
          break;
        case 2:
          month = "February";
          break;
        case 3:
          month = "March";
          break;
        case 4:
          month = "April";
          break;
        case 5:
          month = "May";
          break;
        case 6:
          month = "June";
          break;
        case 7:
          month = "July";
          break;
        case 8:
          month = "August";
          break;
        case 9:
          month = "September";
          break;
        case 10:
          month = "October";
          break;
        case 11:
          month = "November";
          break;
        case 12:
          month = "December";
          break;
      }
      angular.element('.' + container).find("input[name='CVV2_Code']").val(response['cvv']);
      angular.element('.' + container).find("input[name='CVV2_Code']").trigger("click");
      angular.element('.' + container).find("input[name='card_number']").val(response['cardNumber']);
      angular.element('.' + container).find("input[name='card_number']").trigger("click");
      angular.element('.' + container).find("input[name='card_number']").trigger("input");
      angular.element('.' + container).find("input[name='month']").val(month);
      angular.element('.' + container).find("input[name='month']").trigger("click");
      angular.element('.' + container).find("input[name='year']").val(response['expiryYear']);
      angular.element('.' + container).find("input[name='year']").trigger("click");
      var scope = angular.element($('.' + container)).scope();
      if (container == 'autoScanPayment_Plan') {
        scope.Payment_Plan.CVV2_Codes = response['cvv'];
        scope.Payment_Plan.Card_Number = response['cardNumber'];
        scope.Payment_Plan.month = month_id;
        scope.Payment_Plan.year = response['expiryYear'];
        scope.Input_value.Payment_Plan_month = month;
        scope.set_month(scope.Payment_Plan.month, 'plan');
      }
      if (container == 'autoScanManual') {
        scope.CC_Manual.CVV2_Code = response['cvv'];
        scope.CC_Manual.card_number = response['cardNumber'];
        scope.CC_Manual.month_cc = month_id;
        scope.CC_Manual.year_cc = response['expiryYear'];
        scope.Input_value.CC_Manual_month_cc = month;
        scope.set_month(scope.CC_Manual.month_cc, 'manual');
      }
    }

    function onCardIOCancel() {
      // switch(screen.orientation.type){
      //     case "portrait-primary": 
      //         screen.orientation.lock('portrait');
      //         break;
      //     case "portrait-secondary": 
      //         screen.orientation.lock('portrait');
      //         break;
      //     case "landscape-primary":
      //         screen.orientation.lock('landscape');
      //         break;
      //     case "landscape-secondary":
      //         screen.orientation.lock('landscape');
      //         break;
      // }
      screen.orientation.unlock();
    }

    function onCardIOCheck(canScan) {
      var scanBtn = document.getElementById(selector);
      // scanBtn.removeEventListener("click");
      scanBtn.addEventListener("click", function(e) {
        resizeType = screen.orientation.type;
        switch (screen.orientation.type) {
          case "portrait-primary":
            screen.orientation.lock('landscape');
            screen.orientation.lock('portrait-primary');
            break;
          case "portrait-secondary":
            screen.orientation.lock('landscape');
            screen.orientation.lock('portrait-secondary');
            break;
          case "landscape-primary":
            screen.orientation.lock('portrait');
            screen.orientation.lock('landscape-secondary');
            break;
          case "landscape-secondary":
            screen.orientation.lock('portrait');
            screen.orientation.lock('landscape-primary');
            break;
        }
        CardIO.scan({
          "requireExpiry": true,
          "scanExpiry": true,
          "allowFreelyRotatingCardGuide": false,
          "requirePostalCode": false,
          "hidePostalCode": true,
          "restrictPostalCodeToNumericOnly": true,
          "hideCardIOLogo": true,
          "suppressScan": false,
          "suppressManual": true,
          "keepApplicationTheme": false
        }, onCardIOComplete, onCardIOCancel);
      });
    }
  }
}
