{"version":3,"file":"connect.js","mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,uEAAuE;AACpG;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;AACrB;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://nv-base-template/./src/js/features/connect.js"],"sourcesContent":["\r\nnew Vue({\r\n el:\"#connect-app\",\r\n data: {\r\n allListings: [],\r\n loaded: false,\r\n search: \"\",\r\n locationDropdown: false,\r\n areaDropdown: false,\r\n serviceDropdown: false,\r\n peopleDropdown: false,\r\n locations: [],\r\n categories: [],\r\n services: [],\r\n people: [],\r\n locationFilters: [],\r\n categoryFilters: [],\r\n serviceFilters: [],\r\n peopleFilters: [],\r\n allLocations: true,\r\n allCategories: true,\r\n allServices: true,\r\n allPeople: true,\r\n totalFilteredItems: 0,\r\n Keyword: \"\",\r\n countToReturn: 10,\r\n update: true,\r\n serviceEnums: {\r\n 1:\"Disability / Accessibility / Inclusion\",\r\n 2:\"Social Services\",\r\n 3:\"Education / Training / Employment\",\r\n 4:\"Local Governmnent\",\r\n 5:\"Health\",\r\n 7:\"Local Clubs\",\r\n 9:\"Tourism\",\r\n 8:\"Business / Commercial\",\r\n 11:\"Volunteer\",\r\n 10:\"Community / Residents Association\"\r\n },\r\n peopleEnums: {\r\n 15:\"Parents and caregivers\",\r\n 13:\"Pets & animals\",\r\n 12:\"Seniors / older people\",\r\n 17:\"Whole community\",\r\n 7:\"Children\",\r\n 16:\"Families / Whānau\",\r\n 8:\"Youth\",\r\n 9:\"Ethnic & migrant communities\",\r\n 10:\"Māori\",\r\n 18:\"Disabled people\",\r\n 13:\"LGBTQI community\",\r\n 11:\"Pets & animals\"\r\n },\r\n locationEnums: {\r\n 16:\"Whole Wanaka / Upper Clutha area\",\r\n 17:\"Whole Queenstown / Wakatipu area\",\r\n 3:\"Wanaka\",\r\n 2:\"Queenstown\",\r\n 26:\"Lake Hayes Estate / Shotover Country\",\r\n 5:\"Kingston\",\r\n 24:\"Kelvin Heights\",\r\n 10:\"Hawea / Hawea Flat\",\r\n 4:\"Glenorchy\",\r\n 9:\"Frankton\",\r\n 7:\"District Wide\",\r\n 1:\"Arrowtown\",\r\n },\r\n categoryEnums: {\r\n 7:\"Arts / Dance / Music / Theatre\",\r\n 16:\"Childcare / Playgroup / Activities for children\",\r\n 15:\"Civil Defence and Emergency Management\",\r\n 9:\"Community Support / Advice / Advocacy\",\r\n 6:\"Council\",\r\n 14:\"Culture / Heritage\",\r\n 11:\"Education / Training\",\r\n 13:\"Employment & Volunteering\",\r\n 12:\"Environment / Conservation\",\r\n 2:\"Health & Wellbeing\",\r\n 10:\"Hobbies / Crafts\",\r\n 8:\"Library\",\r\n 4:\"Religion / Faith / Spiritual\",\r\n 5:\"Sports / Recreation\"\r\n }\r\n },\r\n methods: {\r\n openListing: function(index, event){\r\n var self = this;\r\n var listing = self.allListings[index];\r\n listing.open = !listing.open;\r\n self.update = !self.update;\r\n\r\n if (listing.open && listing.longitude != 0 && listing.latitude != 0) {\r\n var map = self.$refs['listing-map-' + listing.id];\r\n gmap = new google.maps.Map(map[0], {\r\n center: {lat: parseFloat(listing.latitude), lng: parseFloat(listing.longitude) },\r\n zoom: parseFloat(listing.zoom)\r\n })\r\n }\r\n\r\n self.$nextTick(() => {\r\n var listingCarousel = self.$refs['listing-carousel-' + index];\r\n if (listingCarousel[0].classList.contains(\"js-listing-carousel\")){\r\n var carousel = new Swiper(listingCarousel[0], {\r\n loop:true,\r\n navigation: {\r\n nextEl: '.c-listing__carousel-btn--next',\r\n prevEl: '.c-listing__carousel-btn--prev',\r\n },\r\n })\r\n }\r\n })\r\n },\r\n submitRequest: function(){\r\n var self = this;\r\n var queryString = \"?\";\r\n if (self.Keyword != \"\"){\r\n queryString += \"&Keyword=\" + self.Keyword;\r\n }\r\n self.$http.get('/api/Listings/Get' + queryString)\r\n .then(response => {\r\n self.allListings = response.data.listings;\r\n self.allListings.forEach(function(listing, i){\r\n\r\n if (listing.categories != undefined){\r\n listing.categories.forEach(function(category, i){\r\n if (self.categories.indexOf(category) == -1){\r\n self.categories.push(category);\r\n }\r\n })\r\n }\r\n if (listing.services != undefined){\r\n listing.services.forEach(function(service, i){\r\n if (self.services.indexOf(service) == -1){\r\n self.services.push(service);\r\n }\r\n })\r\n }\r\n if (listing.peoples != undefined){\r\n listing.peoples.forEach(function(people, i){\r\n if (self.people.indexOf(people) == -1){\r\n self.people.push(people);\r\n }\r\n })\r\n }\r\n if (listing.locations != undefined){\r\n listing.locations.forEach(function(location, i){\r\n if (self.locations.indexOf(location) == -1){\r\n self.locations.push(location);\r\n }\r\n })\r\n }\r\n\r\n listing.shareableUrl = window.location.protocol + '//' + window.location.hostname + '/groups/' + listing.uRLSegment + '/' + listing.id;\r\n\r\n if (listing.photos != undefined && listing.photos.length > 0){\r\n listing.mainPhoto = \"https://groups.qldc.govt.nz/\" + listing.photos[0].filename;\r\n } else {\r\n listing.mainPhoto = null;\r\n }\r\n\r\n listing.cleanIntro = (listing.content != undefined) ? listing.content.replace(/<[^>]*>?/gm, '') : \"\";\r\n if (listing.cleanIntro.length > 187){\r\n listing.cleanIntro = listing.cleanIntro.slice(0,187) + '...';\r\n }\r\n listing.index = i;\r\n listing.open = false;\r\n })\r\n })\r\n },\r\n handleClick(e) {\r\n var self = this;\r\n if (!e.target.classList.contains(\"js-dropdown-area\")){\r\n self.locationDropdown = false;\r\n self.areaDropdown = false;\r\n self.serviceDropdown = false;\r\n self.peopleDropdown = false;\r\n }\r\n },\r\n hoverOutTimeout: function() {\r\n var self = this;\r\n\r\n setTimeout(() => {\r\n self.locationDropdown = false;\r\n self.areaDropdown = false;\r\n self.serviceDropdown = false;\r\n self.peopleDropdown = false;\r\n }, 1000);\r\n },\r\n },\r\n computed :{\r\n filteredListings(){\r\n var self = this;\r\n var filteredListings = [];\r\n self.update;\r\n\r\n if (self.allListings && self.allListings.length > 0) {\r\n self.allListings.forEach(listing => {\r\n\r\n // if (self.locationFilters.length && listing.services != undefined && listing.addressTown != null){\r\n // var searchableAddress = listing.addressTown.toLowerCase();\r\n // self.locationFilters.forEach(function(location, i){\r\n // if (searchableAddress.search(location.toLowerCase()) != -1){\r\n // filteredListings.push(listing);\r\n // }\r\n // })\r\n // }\r\n if (self.Keyword != \"\") {\r\n var re = new RegExp(self.Keyword, \"i\");\r\n if (listing.title.search(re) != -1) {\r\n filteredListings.push(listing);\r\n }\r\n }\r\n if (self.categoryFilters.length && listing.categories != undefined) {\r\n listing.categories.forEach(function(category, i) {\r\n if (self.categoryFilters.indexOf(category) != -1) {\r\n filteredListings.push(listing);\r\n }\r\n })\r\n }\r\n if (self.locationFilters.length && listing.locations != undefined) {\r\n listing.locations.forEach(function(location, i) {\r\n if (self.locationFilters.indexOf(location) != -1) {\r\n filteredListings.push(listing);\r\n }\r\n })\r\n }\r\n if (self.serviceFilters.length && listing.services != undefined) {\r\n listing.services.forEach(function(service, i) {\r\n if (self.serviceFilters.indexOf(service) != -1) {\r\n filteredListings.push(listing);\r\n }\r\n })\r\n }\r\n if (self.peopleFilters.length && listing.peoples != undefined) {\r\n listing.peoples.forEach(function(people, i) {\r\n if (self.peopleFilters.indexOf(people) != -1) {\r\n filteredListings.push(listing);\r\n }\r\n })\r\n }\r\n })\r\n }\r\n\r\n\r\n self.totalFilteredItems = filteredListings.length;\r\n return filteredListings.slice(0, self.countToReturn);\r\n }\r\n },\r\n watch: {\r\n allServices(newVal, oldVal){\r\n if (newVal){\r\n this.serviceFilters = [];\r\n }\r\n },\r\n allPeople(newVal, oldVal){\r\n if (newVal){\r\n this.peopleFilters = [];\r\n }\r\n },\r\n allLocations(newVal, oldVal){\r\n if (newVal){\r\n this.locationFilters = [];\r\n }\r\n },\r\n allCategories(newVal, oldVal){\r\n if (newVal){\r\n this.categoryFilters = [];\r\n }\r\n },\r\n locationFilters(newVal, oldVal) {\r\n if (newVal.length > 0){\r\n this.allLocations = false;\r\n }\r\n },\r\n categoryFilters(newVal, oldVal) {\r\n if (newVal.length > 0){\r\n this.allCategories = false;\r\n }\r\n },\r\n serviceFilters(newVal, oldVal) {\r\n if (newVal.length > 0){\r\n this.allServices = false;\r\n }\r\n },\r\n peopleFilters(newVal, oldVal) {\r\n if (newVal.length > 0){\r\n this.allPeople = false;\r\n }\r\n }\r\n },\r\n mounted: function()\r\n {\r\n var self = this;\r\n self.$http.get('/api/Listings/Get')\r\n .then(response => {\r\n self.allListings = response.data.listings;\r\n self.allListings.forEach(function(listing, i){\r\n\r\n if (listing.categories != undefined){\r\n listing.categories.forEach(function(category, i){\r\n if (self.categories.indexOf(category) == -1){\r\n self.categories.push(category);\r\n }\r\n })\r\n }\r\n if (listing.services != undefined){\r\n listing.services.forEach(function(service, i){\r\n if (self.services.indexOf(service) == -1){\r\n self.services.push(service);\r\n }\r\n })\r\n }\r\n if (listing.peoples != undefined){\r\n listing.peoples.forEach(function(people, i){\r\n if (self.people.indexOf(people) == -1){\r\n self.people.push(people);\r\n }\r\n })\r\n }\r\n if (listing.locations != undefined){\r\n listing.locations.forEach(function(location, i){\r\n if (self.locations.indexOf(location) == -1){\r\n self.locations.push(location);\r\n }\r\n })\r\n }\r\n\r\n listing.shareableUrl = window.location.protocol + '//' + window.location.hostname + '/groups/' + listing.uRLSegment + '/' + listing.id;\r\n\r\n if (listing.photos != undefined && listing.photos.length > 0){\r\n listing.mainPhoto = \"https://groups.qldc.govt.nz/\" + listing.photos[0].filename;\r\n } else {\r\n listing.mainPhoto = null;\r\n }\r\n\r\n listing.cleanIntro = (listing.content != undefined) ? listing.content.replace(/<[^>]*>?/gm, '') : \"\";\r\n if (listing.cleanIntro.length > 187){\r\n listing.cleanIntro = listing.cleanIntro.slice(0,187) + '...';\r\n }\r\n listing.index = i;\r\n listing.open = false;\r\n })\r\n self.loaded = true;\r\n })\r\n window.addEventListener('click', self.handleClick);\r\n\r\n self.$refs.locationDropdownArea.addEventListener(\"mouseleave\", self.hoverOutTimeout);\r\n self.$refs.areaDropdownArea.addEventListener(\"mouseleave\", self.hoverOutTimeout);\r\n self.$refs.serviceDropdownArea.addEventListener(\"mouseleave\", self.hoverOutTimeout);\r\n self.$refs.peopleDropdownArea.addEventListener(\"mouseleave\", self.hoverOutTimeout);\r\n },\r\n destroyed () {\r\n window.removeEventListener('click', this.handleClick);\r\n }\r\n});\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n"],"names":[],"sourceRoot":""}