{"version":3,"sources":["text!Templates/store-locations.html","Plugins/mustache.js","Modules/store-locator.js","home.js"],"names":["define","global","factory","exports","nodeName","amd","Mustache","this","mustache","isFunction","object","typeStr","obj","isArray","escapeRegExp","string","replace","hasProperty","propName","testRegExp","re","regExpTest","call","isWhitespace","nonSpaceRe","escapeHtml","String","s","entityMap","parseTemplate","template","tags","stripSpace","hasTag","nonSpace","spaces","length","tokens","pop","compileTags","tagsToCompile","split","spaceRe","Error","openingTagRe","RegExp","closingTagRe","closingCurlyRe","sections","start","type","value","chr","token","openSection","scanner","Scanner","eos","pos","scanUntil","i","valueLength","charAt","push","scan","tagRe","whiteRe","equalsRe","curlyRe","nestTokens","squashTokens","lastToken","squashedTokens","numTokens","section","nestedTokens","collector","tail","Context","view","parentContext","cache",".","parent","Writer","objectToString","Object","prototype","toString","Array","test","&","<",">","\"","'","/","`","=","match","index","substring","search","lookup","name","hasOwnProperty","names","context","lookupHit","indexOf","clearCache","parse","render","partials","renderTokens","originalTemplate","symbol","buffer","undefined","renderSection","renderInverted","renderPartial","unescapedValue","escapedValue","rawValue","subRender","self","j","slice","escape","version","defaultWriter","TypeError","to_html","send","result","$","helpers","StoreLocator","options","init","defaultSettings","$btnCurrentLocation","currentCountry","$form","googleApiKey","$body","data","isStoreLocatorPage","mapId","markerImage","markerImageActive","$postcode","$postcodeSuburb","$countryCode","$storesError","$storesList","$storesHeading","storeSelector","storeLocatorUrl","attr","val","settings","extend","bindEvents","loadGoogleApi","checkParams","lat","long","postCode","searchQuery","window","location","params","getQueryStringValues","each","getStores","renderMap","latLong","mapOptions","center","zoom","map","google","maps","Map","document","getElementById","load","other_params","callback","initStoreLocator","markerClick","marker","event","addListener","$activeStore","find","removeClass","eq","addClass","activeMarker","setIcon","markers","selectStore","$this","resetMap","on","getCurrentLocation","e","preventDefault","$window","debounce","navigator","geolocation","getCurrentPosition","getCurrentLocationSuccess","position","coords","latitude","lng","longitude","redirectToStores","addStoreMarkers","stores","bounds","LatLngBounds","store","LatLng","parseFloat","Marker","icon","animation","Animation","DROP","title","searchLocation","empty","get","done","response","updatePostcode","rendered","html","promise","fail","textStatus","jqXHR","console","log","autocomplete","places","Autocomplete","componentRestrictions","country","types","place","getPlace","geometry","searchAddressComponents","address_components","searchPostalCode","short_name","url","fitBounds","setCenter","getCenter","postcode","text","Swiper","$document","ready","initCarousel","swiperHero","autoplay","constants","swiperInterval","pagination","paginationClickable","slidesPerView"],"mappings":"AAAA,AACAA,OAAA,yCAAA,WAAA,MAAA,scCMA,SAAAC,EAAAC,GACA,gBAAAC,UAAAA,SAAA,gBAAAA,SAAAC,SACAF,EAAAC,SACA,kBAAAH,SAAAA,OAAAK,IACAL,OAAA,oBAAA,WAAAE,IAEAD,EAAAK,YACAJ,EAAAD,EAAAK,YAEAC,KAAA,SAAAC,GAOA,QAAAC,GAAAC,GACA,MAAA,kBAAAA,GAOA,QAAAC,GAAAC,GACA,MAAAC,GAAAD,GAAA,cAAAA,GAGA,QAAAE,GAAAC,GACA,MAAAA,GAAAC,QAAA,8BAAA,QAOA,QAAAC,GAAAL,EAAAM,GACA,MAAA,OAAAN,GAAA,gBAAAA,IAAAM,IAAAN,GAMA,QAAAO,GAAAC,EAAAL,GACA,MAAAM,GAAAC,KAAAF,EAAAL,GAIA,QAAAQ,GAAAR,GACA,OAAAI,EAAAK,EAAAT,GAcA,QAAAU,GAAAV,GACA,MAAAW,QAAAX,GAAAC,QAAA,eAAA,SAAAW,GACA,MAAAC,GAAAD,KAgCA,QAAAE,GAAAC,EAAAC,GAYA,QAAAC,KACA,GAAAC,IAAAC,EACA,KAAAC,EAAAC,cACAC,GAAAF,EAAAG,WAEAH,KAGAF,IAAA,EACAC,GAAA,EAIA,QAAAK,GAAAC,GAIA,GAHA,gBAAAA,KACAA,EAAAA,EAAAC,MAAAC,EAAA,KAEA7B,EAAA2B,IAAA,IAAAA,EAAAJ,OACA,KAAA,IAAAO,OAAA,iBAAAH,EAEAI,GAAA,GAAAC,QAAA/B,EAAA0B,EA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2F,EAGA,QAAAzD,KACAhF,EAAAwD,IAAAkF,UAAA1I,EAAAoC,SAAA+D,QACAnG,EAAAwD,IAAAmF,UAAA3I,EAAAoC,SAAA+D,OAAAyC,aAGA,QAAAzB,GAAA0B,GACA7I,EAAAoC,SAAAV,UAAAoH,KAAAD,GAvVA,GAAA7I,GAAAvH,IAEAuH,GAAA2E,aAAA,KACA3E,EAAAsE,aAAA,KACAtE,EAAAwD,IAAA,KACAxD,EAAA6E,WAEA/D,IAqVA,MAAAF,KAIA1I,OAAA,QC9WA,SACA,SACA,UACA,iBAEA,SAAAwI,EAAAqI,EAAApI,EAAAC,GACA,YAEAD,GAAAqI,UAAAC,MAAA,WAEA,QAAAC,KAEA,GAAAC,EAEAA,GAAA,GAAAJ,GAAA,yBACAK,SAAAzI,EAAA0I,UAAAC,eACAC,WAAA,mCACAC,qBAAA,EACAC,cAAA,IAIA,QAAA3I,KACAoI,IACA,GAAAtI,GAGAE;AH3BA;AACA;ACFA,ADGA;ACFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACtnBA,ADunBA;ACtnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,AC/WA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"home.js","sourcesContent":["\ndefine('text!Templates/store-locations.html',[],function () { return '{{#stores}}\\r\\n
\\r\\n\\t
{{name}}
\\r\\n\\t
{{street}}
\\r\\n\\t
{{suburb}} {{state}} {{postcode}}
\\r\\n\\t
\\r\\n\\t\\t{{website}}\\r\\n\\t
\\r\\n\\t
\\r\\n\\t\\t{{phone}}\\r\\n\\t
\\r\\n
\\r\\n{{/stores}}\\r\\n';});\n\n","/*!\r\n * mustache.js - Logic-less {{mustache}} templates with JavaScript\r\n * http://github.com/janl/mustache.js\r\n */\r\n\r\n/*global define: false Mustache: true*/\r\n\r\n(function defineMustache (global, factory) {\r\n if (typeof exports === 'object' && exports && typeof exports.nodeName !== 'string') {\r\n factory(exports); // CommonJS\r\n } else if (typeof define === 'function' && define.amd) {\r\n define('Plugins/mustache',['exports'], factory); // AMD\r\n } else {\r\n global.Mustache = {};\r\n factory(global.Mustache); // script, wsh, asp\r\n }\r\n}(this, function mustacheFactory (mustache) {\r\n\r\n var objectToString = Object.prototype.toString;\r\n var isArray = Array.isArray || function isArrayPolyfill (object) {\r\n return objectToString.call(object) === '[object Array]';\r\n };\r\n\r\n function isFunction (object) {\r\n return typeof object === 'function';\r\n }\r\n\r\n /**\r\n * More correct typeof string handling array\r\n * which normally returns typeof 'object'\r\n */\r\n function typeStr (obj) {\r\n return isArray(obj) ? 'array' : typeof obj;\r\n }\r\n\r\n function escapeRegExp (string) {\r\n return string.replace(/[\\-\\[\\]{}()*+?.,\\\\\\^$|#\\s]/g, '\\\\$&');\r\n }\r\n\r\n /**\r\n * Null safe way of checking whether or not an object,\r\n * including its prototype, has a given property\r\n */\r\n function hasProperty (obj, propName) {\r\n return obj != null && typeof obj === 'object' && (propName in obj);\r\n }\r\n\r\n // Workaround for https://issues.apache.org/jira/browse/COUCHDB-577\r\n // See https://github.com/janl/mustache.js/issues/189\r\n var regExpTest = RegExp.prototype.test;\r\n function testRegExp (re, string) {\r\n return regExpTest.call(re, string);\r\n }\r\n\r\n var nonSpaceRe = /\\S/;\r\n function isWhitespace (string) {\r\n return !testRegExp(nonSpaceRe, string);\r\n }\r\n\r\n var entityMap = {\r\n '&': '&',\r\n '<': '<',\r\n '>': '>',\r\n '\"': '"',\r\n \"'\": ''',\r\n '/': '/',\r\n '`': '`',\r\n '=': '='\r\n };\r\n\r\n function escapeHtml (string) {\r\n return String(string).replace(/[&<>\"'`=\\/]/g, function fromEntityMap (s) {\r\n return entityMap[s];\r\n });\r\n }\r\n\r\n var whiteRe = /\\s*/;\r\n var spaceRe = /\\s+/;\r\n var equalsRe = /\\s*=/;\r\n var curlyRe = /\\s*\\}/;\r\n var tagRe = /#|\\^|\\/|>|\\{|&|=|!/;\r\n\r\n /**\r\n * Breaks up the given `template` string into a tree of tokens. If the `tags`\r\n * argument is given here it must be an array with two string values: the\r\n * opening and closing tags used in the template (e.g. [ \"<%\", \"%>\" ]). Of\r\n * course, the default is to use mustaches (i.e. mustache.tags).\r\n *\r\n * A token is an array with at least 4 elements. The first element is the\r\n * mustache symbol that was used inside the tag, e.g. \"#\" or \"&\". If the tag\r\n * did not contain a symbol (i.e. {{myValue}}) this element is \"name\". For\r\n * all text that appears outside a symbol this element is \"text\".\r\n *\r\n * The second element of a token is its \"value\". For mustache tags this is\r\n * whatever else was inside the tag besides the opening symbol. For text tokens\r\n * this is the text itself.\r\n *\r\n * The third and fourth elements of the token are the start and end indices,\r\n * respectively, of the token in the original template.\r\n *\r\n * Tokens that are the root node of a subtree contain two more elements: 1) an\r\n * array of tokens in the subtree and 2) the index in the original template at\r\n * which the closing tag for that section begins.\r\n */\r\n function parseTemplate (template, tags) {\r\n if (!template)\r\n return [];\r\n\r\n var sections = []; // Stack to hold section tokens\r\n var tokens = []; // Buffer to hold the tokens\r\n var spaces = []; // Indices of whitespace tokens on the current line\r\n var hasTag = false; // Is there a {{tag}} on the current line?\r\n var nonSpace = false; // Is there a non-space char on the current line?\r\n\r\n // Strips all whitespace tokens array for the current line\r\n // if there was a {{#tag}} on it and otherwise only space.\r\n function stripSpace () {\r\n if (hasTag && !nonSpace) {\r\n while (spaces.length)\r\n delete tokens[spaces.pop()];\r\n } else {\r\n spaces = [];\r\n }\r\n\r\n hasTag = false;\r\n nonSpace = false;\r\n }\r\n\r\n var openingTagRe, closingTagRe, closingCurlyRe;\r\n function compileTags (tagsToCompile) {\r\n if (typeof tagsToCompile === 'string')\r\n tagsToCompile = tagsToCompile.split(spaceRe, 2);\r\n\r\n if (!isArray(tagsToCompile) || tagsToCompile.length !== 2)\r\n throw new Error('Invalid tags: ' + tagsToCompile);\r\n\r\n openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + '\\\\s*');\r\n closingTagRe = new RegExp('\\\\s*' + escapeRegExp(tagsToCompile[1]));\r\n closingCurlyRe = new RegExp('\\\\s*' + escapeRegExp('}' + tagsToCompile[1]));\r\n }\r\n\r\n compileTags(tags || mustache.tags);\r\n\r\n var scanner = new Scanner(template);\r\n\r\n var start, type, value, chr, token, openSection;\r\n while (!scanner.eos()) {\r\n start = scanner.pos;\r\n\r\n // Match any text between tags.\r\n value = scanner.scanUntil(openingTagRe);\r\n\r\n if (value) {\r\n for (var i = 0, valueLength = value.length; i < valueLength; ++i) {\r\n chr = value.charAt(i);\r\n\r\n if (isWhitespace(chr)) {\r\n spaces.push(tokens.length);\r\n } else {\r\n nonSpace = true;\r\n }\r\n\r\n tokens.push([ 'text', chr, start, start + 1 ]);\r\n start += 1;\r\n\r\n // Check for whitespace on the current line.\r\n if (chr === '\\n')\r\n stripSpace();\r\n }\r\n }\r\n\r\n // Match the opening tag.\r\n if (!scanner.scan(openingTagRe))\r\n break;\r\n\r\n hasTag = true;\r\n\r\n // Get the tag type.\r\n type = scanner.scan(tagRe) || 'name';\r\n scanner.scan(whiteRe);\r\n\r\n // Get the tag value.\r\n if (type === '=') {\r\n value = scanner.scanUntil(equalsRe);\r\n scanner.scan(equalsRe);\r\n scanner.scanUntil(closingTagRe);\r\n } else if (type === '{') {\r\n value = scanner.scanUntil(closingCurlyRe);\r\n scanner.scan(curlyRe);\r\n scanner.scanUntil(closingTagRe);\r\n type = '&';\r\n } else {\r\n value = scanner.scanUntil(closingTagRe);\r\n }\r\n\r\n // Match the closing tag.\r\n if (!scanner.scan(closingTagRe))\r\n throw new Error('Unclosed tag at ' + scanner.pos);\r\n\r\n token = [ type, value, start, scanner.pos ];\r\n tokens.push(token);\r\n\r\n if (type === '#' || type === '^') {\r\n sections.push(token);\r\n } else if (type === '/') {\r\n // Check section nesting.\r\n openSection = sections.pop();\r\n\r\n if (!openSection)\r\n throw new Error('Unopened section \"' + value + '\" at ' + start);\r\n\r\n if (openSection[1] !== value)\r\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + start);\r\n } else if (type === 'name' || type === '{' || type === '&') {\r\n nonSpace = true;\r\n } else if (type === '=') {\r\n // Set the tags for the next time around.\r\n compileTags(value);\r\n }\r\n }\r\n\r\n // Make sure there are no open sections when we're done.\r\n openSection = sections.pop();\r\n\r\n if (openSection)\r\n throw new Error('Unclosed section \"' + openSection[1] + '\" at ' + scanner.pos);\r\n\r\n return nestTokens(squashTokens(tokens));\r\n }\r\n\r\n /**\r\n * Combines the values of consecutive text tokens in the given `tokens` array\r\n * to a single token.\r\n */\r\n function squashTokens (tokens) {\r\n var squashedTokens = [];\r\n\r\n var token, lastToken;\r\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\r\n token = tokens[i];\r\n\r\n if (token) {\r\n if (token[0] === 'text' && lastToken && lastToken[0] === 'text') {\r\n lastToken[1] += token[1];\r\n lastToken[3] = token[3];\r\n } else {\r\n squashedTokens.push(token);\r\n lastToken = token;\r\n }\r\n }\r\n }\r\n\r\n return squashedTokens;\r\n }\r\n\r\n /**\r\n * Forms the given array of `tokens` into a nested tree structure where\r\n * tokens that represent a section have two additional items: 1) an array of\r\n * all tokens that appear in that section and 2) the index in the original\r\n * template that represents the end of that section.\r\n */\r\n function nestTokens (tokens) {\r\n var nestedTokens = [];\r\n var collector = nestedTokens;\r\n var sections = [];\r\n\r\n var token, section;\r\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\r\n token = tokens[i];\r\n\r\n switch (token[0]) {\r\n case '#':\r\n case '^':\r\n collector.push(token);\r\n sections.push(token);\r\n collector = token[4] = [];\r\n break;\r\n case '/':\r\n section = sections.pop();\r\n section[5] = token[2];\r\n collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;\r\n break;\r\n default:\r\n collector.push(token);\r\n }\r\n }\r\n\r\n return nestedTokens;\r\n }\r\n\r\n /**\r\n * A simple string scanner that is used by the template parser to find\r\n * tokens in template strings.\r\n */\r\n function Scanner (string) {\r\n this.string = string;\r\n this.tail = string;\r\n this.pos = 0;\r\n }\r\n\r\n /**\r\n * Returns `true` if the tail is empty (end of string).\r\n */\r\n Scanner.prototype.eos = function eos () {\r\n return this.tail === '';\r\n };\r\n\r\n /**\r\n * Tries to match the given regular expression at the current position.\r\n * Returns the matched text if it can match, the empty string otherwise.\r\n */\r\n Scanner.prototype.scan = function scan (re) {\r\n var match = this.tail.match(re);\r\n\r\n if (!match || match.index !== 0)\r\n return '';\r\n\r\n var string = match[0];\r\n\r\n this.tail = this.tail.substring(string.length);\r\n this.pos += string.length;\r\n\r\n return string;\r\n };\r\n\r\n /**\r\n * Skips all text until the given regular expression can be matched. Returns\r\n * the skipped string, which is the entire tail if no match can be made.\r\n */\r\n Scanner.prototype.scanUntil = function scanUntil (re) {\r\n var index = this.tail.search(re), match;\r\n\r\n switch (index) {\r\n case -1:\r\n match = this.tail;\r\n this.tail = '';\r\n break;\r\n case 0:\r\n match = '';\r\n break;\r\n default:\r\n match = this.tail.substring(0, index);\r\n this.tail = this.tail.substring(index);\r\n }\r\n\r\n this.pos += match.length;\r\n\r\n return match;\r\n };\r\n\r\n /**\r\n * Represents a rendering context by wrapping a view object and\r\n * maintaining a reference to the parent context.\r\n */\r\n function Context (view, parentContext) {\r\n this.view = view;\r\n this.cache = { '.': this.view };\r\n this.parent = parentContext;\r\n }\r\n\r\n /**\r\n * Creates a new context using the given view with this context\r\n * as the parent.\r\n */\r\n Context.prototype.push = function push (view) {\r\n return new Context(view, this);\r\n };\r\n\r\n /**\r\n * Returns the value of the given name in this context, traversing\r\n * up the context hierarchy if the value is absent in this context's view.\r\n */\r\n Context.prototype.lookup = function lookup (name) {\r\n var cache = this.cache;\r\n\r\n var value;\r\n if (cache.hasOwnProperty(name)) {\r\n value = cache[name];\r\n } else {\r\n var context = this, names, index, lookupHit = false;\r\n\r\n while (context) {\r\n if (name.indexOf('.') > 0) {\r\n value = context.view;\r\n names = name.split('.');\r\n index = 0;\r\n\r\n /**\r\n * Using the dot notion path in `name`, we descend through the\r\n * nested objects.\r\n *\r\n * To be certain that the lookup has been successful, we have to\r\n * check if the last object in the path actually has the property\r\n * we are looking for. We store the result in `lookupHit`.\r\n *\r\n * This is specially necessary for when the value has been set to\r\n * `undefined` and we want to avoid looking up parent contexts.\r\n **/\r\n while (value != null && index < names.length) {\r\n if (index === names.length - 1)\r\n lookupHit = hasProperty(value, names[index]);\r\n\r\n value = value[names[index++]];\r\n }\r\n } else {\r\n value = context.view[name];\r\n lookupHit = hasProperty(context.view, name);\r\n }\r\n\r\n if (lookupHit)\r\n break;\r\n\r\n context = context.parent;\r\n }\r\n\r\n cache[name] = value;\r\n }\r\n\r\n if (isFunction(value))\r\n value = value.call(this.view);\r\n\r\n return value;\r\n };\r\n\r\n /**\r\n * A Writer knows how to take a stream of tokens and render them to a\r\n * string, given a context. It also maintains a cache of templates to\r\n * avoid the need to parse the same template twice.\r\n */\r\n function Writer () {\r\n this.cache = {};\r\n }\r\n\r\n /**\r\n * Clears all cached templates in this writer.\r\n */\r\n Writer.prototype.clearCache = function clearCache () {\r\n this.cache = {};\r\n };\r\n\r\n /**\r\n * Parses and caches the given `template` and returns the array of tokens\r\n * that is generated from the parse.\r\n */\r\n Writer.prototype.parse = function parse (template, tags) {\r\n var cache = this.cache;\r\n var tokens = cache[template];\r\n\r\n if (tokens == null)\r\n tokens = cache[template] = parseTemplate(template, tags);\r\n\r\n return tokens;\r\n };\r\n\r\n /**\r\n * High-level method that is used to render the given `template` with\r\n * the given `view`.\r\n *\r\n * The optional `partials` argument may be an object that contains the\r\n * names and templates of partials that are used in the template. It may\r\n * also be a function that is used to load partial templates on the fly\r\n * that takes a single argument: the name of the partial.\r\n */\r\n Writer.prototype.render = function render (template, view, partials) {\r\n var tokens = this.parse(template);\r\n var context = (view instanceof Context) ? view : new Context(view);\r\n return this.renderTokens(tokens, context, partials, template);\r\n };\r\n\r\n /**\r\n * Low-level method that renders the given array of `tokens` using\r\n * the given `context` and `partials`.\r\n *\r\n * Note: The `originalTemplate` is only ever used to extract the portion\r\n * of the original template that was contained in a higher-order section.\r\n * If the template doesn't use higher-order sections, this argument may\r\n * be omitted.\r\n */\r\n Writer.prototype.renderTokens = function renderTokens (tokens, context, partials, originalTemplate) {\r\n var buffer = '';\r\n\r\n var token, symbol, value;\r\n for (var i = 0, numTokens = tokens.length; i < numTokens; ++i) {\r\n value = undefined;\r\n token = tokens[i];\r\n symbol = token[0];\r\n\r\n if (symbol === '#') value = this.renderSection(token, context, partials, originalTemplate);\r\n else if (symbol === '^') value = this.renderInverted(token, context, partials, originalTemplate);\r\n else if (symbol === '>') value = this.renderPartial(token, context, partials, originalTemplate);\r\n else if (symbol === '&') value = this.unescapedValue(token, context);\r\n else if (symbol === 'name') value = this.escapedValue(token, context);\r\n else if (symbol === 'text') value = this.rawValue(token);\r\n\r\n if (value !== undefined)\r\n buffer += value;\r\n }\r\n\r\n return buffer;\r\n };\r\n\r\n Writer.prototype.renderSection = function renderSection (token, context, partials, originalTemplate) {\r\n var self = this;\r\n var buffer = '';\r\n var value = context.lookup(token[1]);\r\n\r\n // This function is used to render an arbitrary template\r\n // in the current context by higher-order sections.\r\n function subRender (template) {\r\n return self.render(template, context, partials);\r\n }\r\n\r\n if (!value) return;\r\n\r\n if (isArray(value)) {\r\n for (var j = 0, valueLength = value.length; j < valueLength; ++j) {\r\n buffer += this.renderTokens(token[4], context.push(value[j]), partials, originalTemplate);\r\n }\r\n } else if (typeof value === 'object' || typeof value === 'string' || typeof value === 'number') {\r\n buffer += this.renderTokens(token[4], context.push(value), partials, originalTemplate);\r\n } else if (isFunction(value)) {\r\n if (typeof originalTemplate !== 'string')\r\n throw new Error('Cannot use higher-order sections without the original template');\r\n\r\n // Extract the portion of the original template that the section contains.\r\n value = value.call(context.view, originalTemplate.slice(token[3], token[5]), subRender);\r\n\r\n if (value != null)\r\n buffer += value;\r\n } else {\r\n buffer += this.renderTokens(token[4], context, partials, originalTemplate);\r\n }\r\n return buffer;\r\n };\r\n\r\n Writer.prototype.renderInverted = function renderInverted (token, context, partials, originalTemplate) {\r\n var value = context.lookup(token[1]);\r\n\r\n // Use JavaScript's definition of falsy. Include empty arrays.\r\n // See https://github.com/janl/mustache.js/issues/186\r\n if (!value || (isArray(value) && value.length === 0))\r\n return this.renderTokens(token[4], context, partials, originalTemplate);\r\n };\r\n\r\n Writer.prototype.renderPartial = function renderPartial (token, context, partials) {\r\n if (!partials) return;\r\n\r\n var value = isFunction(partials) ? partials(token[1]) : partials[token[1]];\r\n if (value != null)\r\n return this.renderTokens(this.parse(value), context, partials, value);\r\n };\r\n\r\n Writer.prototype.unescapedValue = function unescapedValue (token, context) {\r\n var value = context.lookup(token[1]);\r\n if (value != null)\r\n return value;\r\n };\r\n\r\n Writer.prototype.escapedValue = function escapedValue (token, context) {\r\n var value = context.lookup(token[1]);\r\n if (value != null)\r\n return mustache.escape(value);\r\n };\r\n\r\n Writer.prototype.rawValue = function rawValue (token) {\r\n return token[1];\r\n };\r\n\r\n mustache.name = 'mustache.js';\r\n mustache.version = '2.3.0';\r\n mustache.tags = [ '{{', '}}' ];\r\n\r\n // All high-level mustache.* functions use this writer.\r\n var defaultWriter = new Writer();\r\n\r\n /**\r\n * Clears all cached templates in the default writer.\r\n */\r\n mustache.clearCache = function clearCache () {\r\n return defaultWriter.clearCache();\r\n };\r\n\r\n /**\r\n * Parses and caches the given template in the default writer and returns the\r\n * array of tokens it contains. Doing this ahead of time avoids the need to\r\n * parse templates on the fly as they are rendered.\r\n */\r\n mustache.parse = function parse (template, tags) {\r\n return defaultWriter.parse(template, tags);\r\n };\r\n\r\n /**\r\n * Renders the `template` with the given `view` and `partials` using the\r\n * default writer.\r\n */\r\n mustache.render = function render (template, view, partials) {\r\n if (typeof template !== 'string') {\r\n throw new TypeError('Invalid template! Template should be a \"string\" ' +\r\n 'but \"' + typeStr(template) + '\" was given as the first ' +\r\n 'argument for mustache#render(template, view, partials)');\r\n }\r\n\r\n return defaultWriter.render(template, view, partials);\r\n };\r\n\r\n // This is here for backwards compatibility with 0.4.x.,\r\n /*eslint-disable */ // eslint wants camel cased function name\r\n mustache.to_html = function to_html (template, view, partials, send) {\r\n /*eslint-enable*/\r\n\r\n var result = mustache.render(template, view, partials);\r\n\r\n if (isFunction(send)) {\r\n send(result);\r\n } else {\r\n return result;\r\n }\r\n };\r\n\r\n // Export the escaping function so that the user may override it.\r\n // See https://github.com/janl/mustache.js/issues/244\r\n mustache.escape = escapeHtml;\r\n\r\n // Export these mainly for testing, but also for advanced usage.\r\n mustache.Scanner = Scanner;\r\n mustache.Context = Context;\r\n mustache.Writer = Writer;\r\n\r\n return mustache;\r\n}));\r\n\n","define('store-locator',[\r\n\t'jquery',\r\n\t'helpers',\r\n\t'text!Templates/store-locations.html',\r\n\t'Plugins/mustache',\r\n\t'//www.google.com/jsapi'\r\n], function ($, helpers, template, Mustache) {\r\n\t\"use strict\";\r\n\r\n\t/***\r\n\t * Constructor for StoreLocator.\r\n\t * @constructor\r\n\t */\r\n\tfunction StoreLocator(options) {\r\n\r\n\t\tvar self = this;\r\n\r\n\t\tself.activeMarker = null;\r\n\t\tself.$activeStore = null;\r\n\t\tself.map = null;\r\n\t\tself.markers = [];\r\n\r\n\t\tinit();\r\n\r\n\t\tfunction init() {\r\n\r\n\t\t\tself.defaultSettings = {\r\n\t\t\t\t$btnCurrentLocation: $('.btn-current-location'),\r\n\t\t\t\tcurrentCountry: '',\r\n\t\t\t\t$form: $('.store-locator--form'),\r\n\t\t\t\tgoogleApiKey: helpers.$body.data('google-places-key'),\r\n\t\t\t\tisStoreLocatorPage: false,\r\n\t\t\t\tmapId: 'map-canvas',\r\n\t\t\t\tmarkerImage: '/common/images/map-marker.png',\r\n\t\t\t\tmarkerImageActive: '/common/images/map-marker-active.png',\r\n\t\t\t\t$postcode: $('.store-locator--postcode'),\r\n\t\t\t\t$postcodeSuburb: $('#PostCodeSuburb'),\r\n\t\t\t\t$countryCode: $('#StoreLocatorCountryCode'),\r\n\t\t\t\t$storesError: $('.store-locator--error'),\r\n\t\t\t\t$storesList: $('.store-locator--results'),\r\n\t\t\t\t$storesHeading: $('.store-locator--heading'),\r\n\t\t\t\tstoreSelector: '.store-locator--item'\r\n\t\t\t};\r\n\r\n\t\t\t/***\r\n\t\t\t * This property can either be the store locator results page if we're on the homepage, or the\r\n\t\t\t * API endpoint URL if we're already on the results page.\r\n\t\t\t */\r\n\t\t\tself.defaultSettings.storeLocatorUrl = self.defaultSettings.$form.attr('action');\r\n\r\n\t\t\tself.defaultSettings.currentCountry = self.defaultSettings.$countryCode.val();\r\n\r\n\t\t\t/***\r\n\t\t\t * Combine custom options with default settings.\r\n\t\t\t */\r\n\t\t\tself.settings = $.extend(true, self.defaultSettings, options);\r\n\r\n\t\t\tbindEvents();\r\n\t\t\tloadGoogleApi();\r\n\t\t\tcheckParams();\r\n\t\t}\r\n\r\n\t\t/***\r\n\t\t * Check if there are querystring parameters for lat/long and if so call our endpoint.\r\n\t\t */\r\n\t\tfunction checkParams() {\r\n\t\t\tvar lat,\r\n\t\t\t\tlong,\r\n\t\t\t\tpostCode,\r\n\t\t\t\tsearchQuery = window.location.search,\r\n\t\t\t\tparams = null;\r\n\r\n\t\t\tif (searchQuery.length > 0) {\r\n\t\t\t\tparams = helpers.getQueryStringValues(searchQuery);\r\n\r\n\t\t\t\t$.each(params, function (index, value) {\r\n\t\t\t\t\tswitch (index) {\r\n\t\t\t\t\t\tcase 'lat':\r\n\t\t\t\t\t\t\tlat = value;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'lng':\r\n\t\t\t\t\t\t\tlong = value;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'postcode':\r\n\t\t\t\t\t\t\tpostCode = value;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tif (lat !== undefined && long !== undefined) {\r\n\t\t\t\t\tgetStores(lat, long, postCode);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/**\r\n\t\t * Renders the map and its markers on the screen.\r\n\t\t * @param latLong { object } containing latitude and longitude values.\r\n\t\t * @param mapOptions { object } Map options from the Google Maps API v3.\r\n\t\t */\r\n\t\tfunction renderMap(latLong, mapOptions) {\r\n\t\t\tif (!mapOptions) {\r\n\t\t\t\tmapOptions = {\r\n\t\t\t\t\tcenter: latLong,\r\n\t\t\t\t\tzoom: self.defaultSettings.currentCountry === 'au' ? 4 : 5\r\n\t\t\t\t};\r\n\t\t\t}\r\n\t\t\tself.map = new google.maps.Map(document.getElementById(self.settings.mapId), mapOptions);\r\n\t\t}\r\n\r\n\t\t/***\r\n\t\t * Use Google Loader to load maps and places api\r\n\t\t * https://developers.google.com/loader/\r\n\t\t */\r\n\t\tfunction loadGoogleApi() {\r\n\t\t\tgoogle.load('maps', '3', {\r\n\t\t\t\t'other_params': 'key=' + self.settings.googleApiKey + '&libraries=places',\r\n\t\t\t\t'callback': initStoreLocator\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t/***\r\n\t\t * Add click handler for a map marker.\r\n\t\t * @param {object} marker\r\n\t\t * @param {number} index\r\n\t\t */\r\n\t\tfunction markerClick(marker, index) {\r\n\t\t\tgoogle.maps.event.addListener(marker, \"click\", function () {\r\n\t\t\t\t//Find the corresponding store to this marker and add an 'active' class.\r\n\t\t\t\tself.$activeStore = self.settings.$storesList.find(self.settings.storeSelector).removeClass('active').eq(index).addClass('active');\r\n\t\t\t\t// Reset the previously active marker's icon.\r\n\t\t\t\tif (self.activeMarker) {\r\n\t\t\t\t\tself.activeMarker.setIcon(self.settings.markerImage);\r\n\t\t\t\t}\r\n\t\t\t\t// Set icon for this marker to the active version.\r\n\t\t\t\tthis.setIcon(self.settings.markerImageActive);\r\n\t\t\t\t// Save a reference to this marker as the currently active one.\r\n\t\t\t\tself.activeMarker = self.markers[index];\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t/***\r\n\t\t * Click handler for a store.\r\n\t\t */\r\n\t\tfunction selectStore() {\r\n\t\t\tvar index, $this;\r\n\t\t\t$this = $(this);\r\n\r\n\t\t\t// Get the index of the store we just selected\r\n\t\t\tindex = self.settings.$storesList.find(self.settings.storeSelector).index(this);\r\n\r\n\t\t\t// Reset active marker's icon.\r\n\t\t\tif (self.activeMarker) {\r\n\t\t\t\tself.activeMarker.setIcon(self.settings.markerImage);\r\n\t\t\t}\r\n\t\t\t// Save reference to this marker as the new active marker, and set its icon.\r\n\t\t\tself.activeMarker = self.markers[index];\r\n\t\t\tself.activeMarker.setIcon(self.settings.markerImageActive);\r\n\r\n\t\t\t// Remove 'active' class from previously active store.\r\n\t\t\tif (self.$activeStore) {\r\n\t\t\t\tself.$activeStore.removeClass('active');\r\n\t\t\t}\r\n\t\t\t$this.addClass('active');\r\n\t\t\t// Save a reference to this store as the new active store.\r\n\t\t\tself.$activeStore = $this;\r\n\r\n\t\t\t// Reset map in case it's been moved\r\n\t\t\tresetMap();\r\n\t\t}\r\n\r\n\t\tfunction bindEvents() {\r\n\t\t\tself.settings.$btnCurrentLocation.on('click', getCurrentLocation);\r\n\t\t\tself.settings.$form.on('submit', function (e) {\r\n\t\t\t\te.preventDefault();\r\n\t\t\t});\r\n\r\n\t\t\tif (self.settings.isStoreLocatorPage) {\r\n\t\t\t\tself.settings.$storesList.on('click', self.settings.storeSelector, selectStore);\r\n\t\t\t\thelpers.$window.on('resize', helpers.debounce(resetMap, 100));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/***\r\n\t\t * Handler for the 'Use current location' button.\r\n\t\t * @param {object} e\r\n\t\t */\r\n\t\tfunction getCurrentLocation(e) {\r\n\t\t\te.preventDefault();\r\n\t\t\tself.settings.$postcodeSuburb.val('');\r\n\t\t\tnavigator.geolocation.getCurrentPosition(getCurrentLocationSuccess);\r\n\t\t}\r\n\r\n\t\tfunction getCurrentLocationSuccess(position) {\r\n\t\t\tvar lat = position.coords.latitude;\r\n\t\t\tvar lng = position.coords.longitude;\r\n\r\n\t\t\tif (!self.settings.isStoreLocatorPage) {\r\n\t\t\t\tredirectToStores(lat,lng,null);\r\n\t\t\t} else {\r\n\t\t\t\tgetStores(lat, lng, null);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction addStoreMarkers(stores) {\r\n\t\t\t// Reset bounds so we aren't working with the bounds of the previous markers, as even if they're hidden\r\n\t\t\t// the bounds will still be there.\r\n\t\t\tself.settings.bounds = new google.maps.LatLngBounds();\r\n\r\n\t\t\t// Iterate through our stores collection and create a marker for each one.\r\n\t\t\tfor (var i = 0; i < stores.length; i++) {\r\n\t\t\t\tvar store = stores[i];\r\n\t\t\t\t// Must parseFloat lat and lng, google.maps.LatLng can't accept strings.\r\n\t\t\t\tvar position = new google.maps.LatLng(parseFloat(store.lat), parseFloat(store.long));\r\n\r\n\t\t\t\t// Create a new marker\r\n\t\t\t\tvar marker = new google.maps.Marker({\r\n\t\t\t\t\ticon: self.settings.markerImage,\r\n\t\t\t\t\tposition: position,\r\n\t\t\t\t\tmap: self.map,\r\n\t\t\t\t\tanimation: google.maps.Animation.DROP,\r\n\t\t\t\t\ttitle: store.name\r\n\t\t\t\t});\r\n\r\n\t\t\t\t// Reset map bounds to take this new marker into account.\r\n\t\t\t\tself.settings.bounds.extend(marker.position);\r\n\r\n\t\t\t\tself.markers.push(marker);\r\n\r\n\t\t\t\t//Attach click event to the marker.\r\n\t\t\t\tmarkerClick(marker, i);\r\n\r\n\t\t\t\tresetMap();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t/***\r\n\t\t * Call our endpoint to get list of stores.\r\n\t\t * @param {number} lat\r\n\t\t * @param {number} lng\r\n\t\t */\r\n\t\tfunction getStores(lat, lng, searchLocation) {\r\n\t\t\tvar params = {\r\n\t\t\t\tlat: lat,\r\n\t\t\t\tlng: lng\r\n\t\t\t};\r\n\r\n\t\t\tself.activeMarker = null;\r\n\t\t\tself.$activeStore = null;\r\n\t\t\tself.markers = [];\r\n\r\n\t\t\tself.settings.$storesHeading.removeClass('in');\r\n\t\t\tself.settings.$storesError.removeClass('in');\r\n\t\t\tself.settings.$storesList.empty().addClass('loading');\r\n\r\n\t\t\t$.get(self.defaultSettings.storeLocatorUrl, params)\r\n\t\t\t\t.done(function (response) {\r\n\t\t\t\t\tself.settings.$storesList.removeClass('loading');\r\n\r\n\t\t\t\t\tif (response.stores.length > 0) {\r\n\t\t\t\t\t\tif (searchLocation) {\r\n\t\t\t\t\t\t\tupdatePostcode(searchLocation);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tupdatePostcode(\"your current location\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Add stores to list\r\n\t\t\t\t\t\tvar rendered = Mustache.render(template, response);\r\n\t\t\t\t\t\tself.settings.$storesList.html(rendered)\r\n\t\t\t\t\t\t\t.promise()\r\n\t\t\t\t\t\t\t.done(function () {\r\n\t\t\t\t\t\t\t\tself.settings.$storesList.removeClass('loading');\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t// Add markers to map\r\n\t\t\t\t\t\taddStoreMarkers(response.stores);\r\n\r\n\t\t\t\t\t\t// Show heading\r\n\t\t\t\t\t\tself.settings.$storesHeading.addClass('in');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tself.settings.$storesList.empty().html('Sorry, no stores found');\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t.fail(function (data, textStatus, jqXHR) {\r\n\t\t\t\t\tconsole.log(data, textStatus, jqXHR);\r\n\t\t\t\t\tself.settings.$storesError.addClass('in');\r\n\t\t\t\t});\r\n\t\t}\r\n\r\n\t\t/***\r\n\t\t * Init Google Places autocomplete for the Postcode/Suburb field.\r\n\t\t */\r\n\t\tfunction initStoreLocator() {\r\n\r\n\t\t\tvar autocomplete,\r\n\t\t\t\tlatLong;\r\n\r\n\t\t\tautocomplete = new google.maps.places.Autocomplete(document.getElementById('PostCodeSuburb'), {\r\n\t\t\t\tcomponentRestrictions: {\r\n\t\t\t\t\tcountry: self.defaultSettings.currentCountry\r\n\t\t\t\t},\r\n\t\t\t\ttypes: ['(regions)']\r\n\t\t\t});\r\n\r\n\t\t\tlatLong = self.defaultSettings.currentCountry === 'au' ? new google.maps.LatLng(-25.363, 131.044) : new google.maps.LatLng(-41.5290841,173.937417);\r\n\r\n\t\t\t/***\r\n\t\t\t * Add an event listener for when a place is selected from the dropdown.\r\n\t\t\t */\r\n\t\t\tautocomplete.addListener('place_changed', function () {\r\n\t\t\t\tvar place = autocomplete.getPlace();\r\n\r\n\t\t\t\tif (place.geometry === undefined) {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar lat = place.geometry.location.lat();\r\n\t\t\t\tvar lng = place.geometry.location.lng();\r\n\r\n\t\t\t\tvar searchAddressComponents = place.address_components,\r\n\t\t\t\t\tsearchPostalCode = \"\";\r\n\t\t\t\t\r\n\t\t\t\tif (searchAddressComponents) {\r\n\t\t\t\t\t$.each(searchAddressComponents, function () {\r\n\t\t\t\t\t\tif (this.types[0] === \"postal_code\") {\r\n\t\t\t\t\t\t\tsearchPostalCode = this.short_name;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif (!self.settings.isStoreLocatorPage) {\r\n\t\t\t\t\tredirectToStores(lat, lng, searchPostalCode);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tgetStores(lat, lng, searchPostalCode);\r\n\t\t\t\t}\r\n\t\t\t});\r\n\r\n\t\t\tif (self.settings.isStoreLocatorPage) {\r\n\t\t\t\tself.settings.bounds = new google.maps.LatLngBounds();\r\n\t\t\t\trenderMap(latLong);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfunction redirectToStores(lat, lng, postCode) {\r\n\r\n\t\t\tvar url = self.settings.storeLocatorUrl + '?lat=' + lat + '&lng=' + lng;\r\n\t\t\tif (postCode) {\r\n\t\t\t\turl = url + '&postcode=' + postCode;\r\n\t\t\t}\r\n\t\t\twindow.location = url;\r\n\t\t}\r\n\r\n\t\tfunction resetMap() {\r\n\t\t\tself.map.fitBounds(self.settings.bounds);\r\n\t\t\tself.map.setCenter(self.settings.bounds.getCenter());\r\n\t\t}\r\n\r\n\t\tfunction updatePostcode(postcode) {\r\n\t\t\tself.settings.$postcode.text(postcode);\r\n\t\t}\r\n\r\n\t}\r\n\r\n\treturn StoreLocator;\r\n\r\n});\r\n\n","define('home',[\r\n\t\t'jquery',\r\n\t\t'swiper',\r\n\t\t'helpers',\r\n\t\t'store-locator'\r\n\t],\r\n\tfunction ($, Swiper, helpers, StoreLocator) {\r\n\t\t'use strict';\r\n\r\n\t\thelpers.$document.ready(function () {\r\n\r\n\t\t\tfunction initCarousel() {\r\n\r\n\t\t\t\tvar swiperHero;\r\n\r\n\t\t\t\tswiperHero = new Swiper('.swiper-homepage-hero', {\r\n\t\t\t\t\tautoplay: helpers.constants.swiperInterval,\r\n\t\t\t\t\tpagination: '.swiper-pagination-homepage-hero',\r\n\t\t\t\t\tpaginationClickable: true,\r\n\t\t\t\t\tslidesPerView: 1\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\tfunction init() {\r\n\t\t\t\tinitCarousel();\r\n\t\t\t\tnew StoreLocator();\r\n\t\t\t}\r\n\r\n\t\t\tinit();\r\n\t\t});\r\n\t}\r\n);\r\n\n"]}