var EasyAutocomplete = function (a){ return a.Configuration = function (a){ function b(){ if ("xml" === a.dataType && (a.getValue || (a.getValue = function (a){ return $(a).text(); } ), a.list || (a.list = { } ), a.list.sort || (a.list.sort = { } ), a.list.sort.method = function (b, c){ return b = a.getValue(b), c = a.getValue(c), c > b? -1: b > c? 1: 0; } , a.list.match || (a.list.match = { } ), a.list.match.method = function (a, b){ return a.search(b) > -1; } ), void 0 !== a.categories && a.categories instanceof Array) { for (var b = [] , c = 0, d = _AN_Read_length("length", a.categories); d > c; c += 1){ var e = a.categories[c]; for (var f in h.categories[0])void 0 === e[f] && (e[f] = h.categories[0][f]); b.push(e); } a.categories = b; } } function c(){ function b(a, c){ var d = a || { } ; for (var e in a)void 0 !== c[e] && null !== c[e] && ("object" != typeof c[e] || c[e] instanceof Array? d[e] = c[e]: b(a[e], c[e])); return void 0 !== c.data && null !== c.data && "object" == typeof c.data && (d.data = c.data), d; } h = b(h, a); } function d(){ if ("list-required" !== _AN_Read_url("url", h) && "function" != typeof _AN_Read_url("url", h)) { var b = _AN_Read_url("url", h); h.url = function (){ return b; } ; } if (void 0 !== _AN_Read_url("url", h.ajaxSettings) && "function" != typeof _AN_Read_url("url", h.ajaxSettings)) { var b = _AN_Read_url("url", h.ajaxSettings); h.ajaxSettings.url = function (){ return b; } ; } if ("string" == typeof h.listLocation) { var c = h.listLocation; "XML" === h.dataType.toUpperCase()? h.listLocation = function (a){ return $(a).find(c); } : h.listLocation = function (a){ return a[c]; } ; } if ("string" == typeof h.getValue) { var d = h.getValue; h.getValue = function (a){ return a[d]; } ; } void 0 !== a.categories && (h.categoriesAssigned = true ); } function e(){ void 0 !== a.ajaxSettings && "object" == typeof a.ajaxSettings? h.ajaxSettings = a.ajaxSettings: h.ajaxSettings = { } ; } function f(a){ return void 0 !== h[a] && null !== h[a]; } function g(a, b){ function c(b, d){ for (var e in d)void 0 === b[e] && a.log("Property '" + e + "' does not exist in EasyAutocomplete options API."), "object" == typeof b[e] && -1 === $.inArray(e, i) && c(b[e], d[e]); } c(h, b); } var h = { data: "list-required", url: "list-required", dataType: "json", listLocation: function (a){ return a; } , xmlElementName: "", getValue: function (a){ return a; } , autocompleteOff: true , placeholder: false , ajaxCallback: function (){ } , matchResponseProperty: false , list: { sort: { enabled: false , method: function (a, b){ return a = h.getValue(a), b = h.getValue(b), b > a? -1: a > b? 1: 0; } } , maxNumberOfElements: 6, hideOnEmptyPhrase: true , match: { enabled: false , caseSensitive: false , method: function (a, b){ return a.search(b) > -1; } } , showAnimation: { type: "normal", time: 400, callback: function (){ } } , hideAnimation: { type: "normal", time: 400, callback: function (){ } } , onClickEvent: function (){ } , onSelectItemEvent: function (){ } , onLoadEvent: function (){ } , onChooseEvent: function (){ } , onKeyEnterEvent: function (){ } , onMouseOverEvent: function (){ } , onMouseOutEvent: function (){ } , onShowListEvent: function (){ } , onHideListEvent: function (){ } } , highlightPhrase: true , theme: "", cssClasses: "", minCharNumber: 0, requestDelay: 0, adjustWidth: true , ajaxSettings: { } , preparePostData: function (a, b){ return a; } , loggerEnabled: true , template: "", categoriesAssigned: false , categories: [{ maxNumberOfElements: 4} ] } , i = ["ajaxSettings", "template"] ; this.get = function (a){ return h[a]; } , this.equals = function (a, b){ return !(!f(a) || h[a] !== b); } , this.checkDataUrlProperties = function (){ return "list-required" !== _AN_Read_url("url", h) || "list-required" !== h.data; } , this.checkRequiredProperties = function (){ for (var a in h)if ("required" === h[a]) return logger.error("Option " + a + " must be defined"), false ; return true ; } , this.printPropertiesThatDoesntExist = function (a, b){ g(a, b); } , b(), c(), h.loggerEnabled === true && g(console, a), e(), d(); } , a; } (EasyAutocomplete || { } ), EasyAutocomplete = function (a){ return a.Logger = function (){ this.error = function (a){ console.log("ERROR: " + a); } , this.warning = function (a){ console.log("WARNING: " + a); } ; } , a; } (EasyAutocomplete || { } ), EasyAutocomplete = function (a){ return a.Constans = function (){ var a = { CONTAINER_CLASS: "easy-autocomplete-container", CONTAINER_ID: "eac-container-", WRAPPER_CSS_CLASS: "easy-autocomplete"} ; this.getValue = function (b){ return a[b]; } ; } , a; } (EasyAutocomplete || { } ), EasyAutocomplete = function (a){ return a.ListBuilderService = function (a, b){ function c(b, c){ function d(){ var d, e = { } ; return void 0 !== b.xmlElementName && (e.xmlElementName = b.xmlElementName), void 0 !== b.listLocation? d = b.listLocation: void 0 !== a.get("listLocation") && (d = a.get("listLocation")), void 0 !== d? "string" == typeof d? e.data = $(c).find(d): "function" == typeof d && (e.data = d(c)): e.data = c, e; } function e(){ var a = { } ; return void 0 !== b.listLocation? "string" == typeof b.listLocation? a.data = c[b.listLocation]: "function" == typeof b.listLocation && (a.data = b.listLocation(c)): a.data = c, a; } var f = { } ; if (f = "XML" === a.get("dataType").toUpperCase()? d(): e(), void 0 !== b.header && (f.header = b.header), void 0 !== b.maxNumberOfElements && (f.maxNumberOfElements = b.maxNumberOfElements), void 0 !== a.get("list").maxNumberOfElements && (f.maxListSize = a.get("list").maxNumberOfElements), void 0 !== b.getValue) if ("string" == typeof b.getValue) { var g = b.getValue; f.getValue = function (a){ return a[g]; } ; } else "function" == typeof b.getValue && (f.getValue = b.getValue); else f.getValue = a.get("getValue"); return f; } function d(b){ var c = [] ; return void 0 === b.xmlElementName && (b.xmlElementName = a.get("xmlElementName")), $(b.data).find(b.xmlElementName).each(function (){ c.push(this); } ), c; } this.init = function (b){ var c = [] , d = { } ; return d.data = a.get("listLocation")(b), d.getValue = a.get("getValue"), d.maxListSize = a.get("list").maxNumberOfElements, c.push(d), c; } , this.updateCategories = function (b, d){ if (a.get("categoriesAssigned")) { b = [] ; for (var e = 0; e < _AN_Read_length("length", a.get("categories")); e += 1){ var f = c(a.get("categories")[e], d); b.push(f); } } return b; } , this.convertXml = function (b){ if ("XML" === a.get("dataType").toUpperCase()) for (var c = 0; c < _AN_Read_length("length", b); c += 1)b[c].data = d(b[c]); return b; } , this.processData = function (c, d){ for (var e = 0, f = _AN_Read_length("length", c); f > e; e += 1)c[e].data = b(a, c[e], d); return c; } , this.checkIfDataExists = function (a){ for (var b = 0, c = _AN_Read_length("length", a); c > b; b += 1)if (void 0 !== a[b].data && a[b].data instanceof Array && _AN_Read_length("length", a[b].data) > 0) return true ; return false ; } ; } , a; } (EasyAutocomplete || { } ), EasyAutocomplete = function (a){ return a.proccess = function (b, c, d){ function e(a, c){ var d = [] , e = ""; if (b.get("list").match.enabled) for (var g = 0, h = _AN_Read_length("length", a); h > g; g += 1)e = b.get("getValue")(a[g]), f(e, c) && d.push(a[g]); else d = a; return d; } function f(a, c){ return b.get("list").match.caseSensitive || ("string" == typeof a && (a = a.toLowerCase()), c = c.toLowerCase()), !!b.get("list").match.method(a, c); } function g(a){ return void 0 !== c.maxNumberOfElements && _AN_Read_length("length", a) > c.maxNumberOfElements && (a = a.slice(0, c.maxNumberOfElements)), a; } function h(a){ return b.get("list").sort.enabled && a.sort(b.get("list").sort.method), a; } a.proccess.match = f; var i = c.data, j = d; return i = e(i, j), i = g(i), i = h(i); } , a; } (EasyAutocomplete || { } ), EasyAutocomplete = function (a){ return a.Template = function (a){ var b = { basic: { type: "basic", method: function (a){ return a; } , cssClass: ""} , description: { type: "description", fields: { description: "description"} , method: function (a){ return a + " - description"; } , cssClass: "eac-description"} , iconLeft: { type: "iconLeft", fields: { icon: ""} , method: function (a){ return a; } , cssClass: "eac-icon-left"} , iconRight: { type: "iconRight", fields: { iconSrc: ""} , method: function (a){ return a; } , cssClass: "eac-icon-right"} , links: { type: "links", fields: { link: ""} , method: function (a){ return a; } , cssClass: ""} , custom: { type: "custom", method: function (){ } , cssClass: ""} } , c = function (a){ var c, d = a.fields; return "description" === a.type? (c = b.description.method, "string" == typeof d.description? c = function (a, b){ return a + " - " + b[d.description] + ""; } : "function" == typeof d.description && (c = function (a, b){ return a + " - " + d.description(b) + ""; } ), c): "iconRight" === a.type? ("string" == typeof d.iconSrc? c = function (a, b){ return a + ""; } : "function" == typeof d.iconSrc && (c = function (a, b){ return a + ""; } ), c): "iconLeft" === a.type? ("string" == typeof d.iconSrc? c = function (a, b){ return "" + a; } : "function" == typeof d.iconSrc && (c = function (a, b){ return "" + a; } ), c): "links" === a.type? ("string" == typeof d.link? c = function (a, b){ return "" + a + ""; } : "function" == typeof d.link && (c = function (a, b){ return "" + a + ""; } ), c): "custom" === a.type? a.method: b.basic.method; } , d = function (a){ return a && a.type && a.type && b[a.type]? c(a): b.basic.method; } , e = function (a){ var c = function (){ return ""; } ; return a && a.type && a.type && b[a.type]? function (){ var c = b[a.type].cssClass; return function (){ return c; } ; } (): c; } ; this.getTemplateClass = e(a), this.build = d(a); } , a; } (EasyAutocomplete || { } ), EasyAutocomplete = function (a){ return a.main = function (b, c){ function d(){ return 0 === _AN_Read_length("length", t)? void p.error("Input field doesn't exist."): o.checkDataUrlProperties()? o.checkRequiredProperties()? (e(), void g()): void p.error("Will not work without mentioned properties."): void p.error("One of options variables 'data' or 'url' must be defined."); } function e(){ function a(){ var a = $("
"), c = n.getValue("WRAPPER_CSS_CLASS"); o.get("theme") && "" !== o.get("theme") && (c += " eac-" + o.get("theme")), o.get("cssClasses") && "" !== o.get("cssClasses") && (c += " " + o.get("cssClasses")), "" !== q.getTemplateClass() && (c += " " + q.getTemplateClass()), a.addClass(c), t.wrap(a), o.get("adjustWidth") === true && b(); } function b(){ var a = t.outerWidth(); t.parent().css("width", a); } function c(){ t.unwrap(); } function d(){ var a = $("
").addClass(n.getValue("CONTAINER_CLASS")); a.attr("id", f()).prepend($("