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4DAAAA,EAAkBC,wBAAuBC,mBACrCA,iBAAiBb,aAAenC,KAAKmC,aACrCa,iBAAiBd,WAAalC,KAAKkC,WACnCc,iBAAiBf,eAAiBjC,KAAKiC,cAAc,IAGzDgB,OAAOC,SAASC,KAAOzB,OAAOc,MAAMY,iBAAiBC,OACzD,GAEJC,QAAS,WACL,IAAIC,YAAcT,4DAAAA,EAAkBU,sBACpCxD,KAAKmC,aAAeoB,YAAYpB,aAChCnC,KAAKkC,WAAaqB,YAAYrB,WAC9BlC,KAAKiC,eAAiBsB,YAAYtB,cACtC,IAGUwB,GAClB,CA3CAC,UAAUC,8BAA8BrC,kDAAAA,EAAUC,WAAWC,YAAY,WACrEH,kBAAkBJ,WAAWQ,iBACjC,G","sources":["webpack://RdoWeb/./ResourcePackages/Main/assets/src/scripts/functions/element-enumerator.js","webpack://RdoWeb/./ResourcePackages/Main/assets/src/scripts/functions/widget-initializer.js","webpack://RdoWeb/./ResourcePackages/Main/assets/src/scripts/widgets/branch-cta.js"],"sourcesContent":["export var ElementsEnumerator = function (elementsClass) {\r\n this.elementsClass = elementsClass;\r\n};\r\n\rElementsEnumerator.prototype.getElements = function () {\r var elements = document.getElementsByClassName(this.elementsClass);\r\n var elementIdPrefix = this.elementsClass + \"-\";\r\n for (var i = 0; i < elements.length; i++) {\r\n var element = elements[i];\r\n element.setAttribute(\"id\", (elementIdPrefix + (i + 1)));\r\n }\r return elements;\r};","import { widgetInitialisation } from \"./widget-init\";\r\nimport { ElementsEnumerator } from \"./element-enumerator\";\r\n\r\nconst initializedVueAppAttrName = \"data-vue-initialized\";\r\n\r\nexport var WidgetInitializer = function (elementsClass) {\r\n this.elementsClass = elementsClass;\r\n};\r\n\r\nWidgetInitializer.prototype.initialize = function (initializationCallback) {\r\n var that = this;\r\n widgetInitialisation(function () {\r\n return innerInitialization.call(that, initializationCallback);\r\n });\r\n};\r\n\r\nfunction innerInitialization(initializationCallback) {\r\n var elementsEnumerator = new ElementsEnumerator(this.elementsClass);\r\n var notInitializedElements = elementsEnumerator.getElements();\r\n for (var i = 0; i < notInitializedElements.length; i++) {\r\n var element = notInitializedElements[i];\r\n if (element.hasAttribute(initializedVueAppAttrName))\r\n return;\r\n\r\n var newElement = initializationCallback(element);\r\n if (newElement)\r\n { element = newElement; }\r\n\r\n element.setAttribute(initializedVueAppAttrName, '');\r\n }\r\n};","import { WidgetInitializer } from \"../functions/widget-initializer\";\r\nimport { ConfigUtils } from \"../functions/config-utils\";\r\nimport { LocalStorageUtils } from \"../functions/local-storage-utils\";\r\nimport { Constants } from \"../functions/constants\";\r\n\r\nvar widgetInitializer = new WidgetInitializer(Constants.COMPONENTS.BRANCH_CTA);\r\nGlobalApp.registerInitializationHandler(Constants.COMPONENTS.BRANCH_CTA, function () {\r\n widgetInitializer.initialize(initBranchCtaApp);\r\n});\r\n\r\nfunction initBranchCtaApp(element) {\r\n\r\n var config = ConfigUtils.getConfigFor(element);\r\n\r\n var vueApp = new Vue({\r\n el: '#' + element.id,\r\n data: {\r\n equipmentTypes: [],\r\n searchTerm: '',\r\n searchRadius: Constants.LOCAL_STORAGE.DEFAULT_RADIUS\r\n },\r\n computed: {\r\n type_filters: function type_filters() {\r\n return config.model.EquipmentTypes;\r\n },\r\n radius_options: function radius_options() {\r\n return config.model.RadiusOptions;\r\n }\r\n },\r\n methods: {\r\n search: function goToLocations() {\r\n LocalStorageUtils.updateLocalStorageData(otherPreferences => {\r\n otherPreferences.searchRadius = this.searchRadius;\r\n otherPreferences.searchTerm = this.searchTerm;\r\n otherPreferences.equipmentTypes = this.equipmentTypes;\r\n });\r\n\r\n window.location.href = config.model.BranchFinderLink.LinkUrl;\r\n }\r\n },\r\n created: function () {\r\n var stored_data = LocalStorageUtils.getLocalStorageData();\r\n this.searchRadius = stored_data.searchRadius;\r\n this.searchTerm = stored_data.searchTerm;\r\n this.equipmentTypes = stored_data.equipmentTypes;\r\n }\r\n });\r\n\r\n return vueApp.$el;\r\n}"],"names":["ElementsEnumerator","elementsClass","this","prototype","getElements","elements","document","getElementsByClassName","elementIdPrefix","i","length","setAttribute","WidgetInitializer","innerInitialization","initializationCallback","notInitializedElements","element","hasAttribute","newElement","initialize","that","widgetInitialisation","call","widgetInitializer","Constants","COMPONENTS","BRANCH_CTA","initBranchCtaApp","config","ConfigUtils","getConfigFor","Vue","el","id","data","equipmentTypes","searchTerm","searchRadius","LOCAL_STORAGE","DEFAULT_RADIUS","computed","type_filters","model","EquipmentTypes","radius_options","RadiusOptions","methods","search","LocalStorageUtils","updateLocalStorageData","otherPreferences","window","location","href","BranchFinderLink","LinkUrl","created","stored_data","getLocalStorageData","$el","GlobalApp","registerInitializationHandler"],"sourceRoot":""}