{"version":3,"sources":["webpack://Unipol/./src/legacy/js/_/property/property-lookup.js"],"names":["window","addEventListener","spinnerVisible","spiner","document","querySelector","$","on","e","preventDefault","val","alert","directoryUrl","classList","add","data","hide","html","fadeIn","remove"],"mappings":"uHAEAA,OAAOC,iBAAiB,oBAAoB,KACxC,IAAIC,GAAiB,EACrB,MAAMC,EAASC,SAASC,cAAc,eAiBtCC,IAAEF,UAAUG,GAAG,SAAU,mBAAoBC,IAIzC,GAHAA,EAAEC,kBACeH,IAAE,aAAaI,MAK5B,YAFAC,MAAM,oDAKV,MAAMC,EAAe,yBAA2BN,IAAE,aAAaI,MAzB1DP,IACAD,IACDC,EAAOU,UAAUC,IAAI,gBACrBZ,GAAiB,IA0BrBI,QAAMM,GAAeG,IACjBT,IAAE,sBAAsBU,OAAOC,KAAKF,GAAMG,OAAO,QAtBhDf,GACDD,IACAC,EAAOU,UAAUM,OAAO,gBACxBjB,GAAiB,c","file":"propertyLookup.0e6012527c4e8db1a031.js","sourcesContent":["import $ from 'jquery';\n\nwindow.addEventListener('DOMContentLoaded', () => {\n let spinnerVisible = false;\n const spiner = document.querySelector('.js-spinner');\n function showProgress() {\n if (!spiner) return;\n if (!spinnerVisible) {\n spiner.classList.add('spinner-show');\n spinnerVisible = true;\n }\n }\n\n function hideProgress() {\n if (!spiner) return;\n if (spinnerVisible) {\n spiner.classList.remove('spinner-show');\n spinnerVisible = false;\n }\n }\n\n $(document).on('submit', '#codeSearchForm', (e) => {\n e.preventDefault();\n const postcode = $('#postcode').val();\n\n if (!postcode) {\n alert('Please enter a postcode, building or street name');\n\n return;\n }\n\n const directoryUrl = '/the-code/code-search/' + $('#postcode').val();\n\n showProgress();\n\n $.get(directoryUrl, (data) => {\n $('#codeSearchResults').hide().html(data).fadeIn('slow');\n hideProgress();\n });\n });\n});\n"],"sourceRoot":""}