PageSourceSearch

https://www.tuli.sk/includes/js/shop/CsSearch.min.js?309558

js tuli.sk collected 2026-09-24 13:07:28 UTC 18,604 bytes, 1 lines download raw bytes

1var CsSearch={csu:!1,dev:!1,types:[],pingcode:"",_xhr:null,_body:{},_window:{},_wrap:{},_btn:{},_msg:{},_result:{},_content:{},_selected:null,_input:{},_close:{},_timeout:0,_data:{},_stats:{},_cache:{},_vars:{placeholder:"",recommend_idx:0,recommend_char:0,window_height:0,search_offset:0,window_orientation:"",ping_rendered:""},_timeouts:{prevent_hide:null,search_hide:null,typing_timeout:null,recommends:null,recommends_start:null,message_showed:null},_actions:{search_clicked:!1,body_clicked:!1},_flags:{prevent_hide:!1,stop_recommend:!1,done_recommend:!1},options:{mid:0,lang:"",keyword:"",search_url:{products:""},browse_url:"",shgid:5,currency:{},recommends:[],config:{show_old_price:0},layout:{name:"",options:{show_default_results:!0,min_chars:1,hide_results_delay:50,search_typing_delay:200,recommend:{enabled:!0}},structure:[]}},langs:{min_chars:"Please enter at least {char} characters",no_match:"No match"},init:function(e){CsSearch.csu=is_cs_user(),CsSearch.dev=is_cs_user("searchdev"),CsSearch.dev&&csstack("init"),CsSearch.options=jQuery.extend(!0,CsSearch.options,e),"object"==typeof window.search_options&&(CsSearch.options=jQuery.extend(!0,CsSearch.options,window.search_options)),CsSearch._body=jQuery("body"),CsSearch._window=jQuery(window),CsSearch._menu=CsSearch._body.find("#menu_div"),CsSearch._wrap=CsSearch._body.find("#cssearch_autocomplete_wrap"),CsSearch._btn=CsSearch._wrap.find(".cssearch-btn"),CsSearch._msg=CsSearch._wrap.find(".cssearch-msg"),CsSearch._input=CsSearch._wrap.find(".cssearch-input"),CsSearch._close=CsSearch._wrap.find(".cssearch-result-close"),CsSearch._result=CsSearch._wrap.find(".cssearch-result"),CsSearch._content=CsSearch._result.find(".cssearch-result-content"),CsSearch._selected=null,window.MutationObserver&&new MutationObserver(function(e){for(let c of e)"attributes"===c.type&&"class"===c.attributeName&&(CsSearch._vars.window_height=0,CsSearch._updateWindow())}).observe(document.body,{attributes:!0,attributeFilter:["class"]}),CsSearch._window.on("resize",function(){CsSearch._updateWindow()}),CsSearch._wrap.on("click",function(){CsSearch._preventHideSearch()}),CsSearch._close.on("click",function(){CsSearch._hideResults()}),CsSearch._btn.on("click",function(e){e.preventDefault(),CsSearch.searchPage(e)}),CsSearch._input.on("click",function(e){CsSearch._searchClick(e)}),CsSearch._input.on("keyup",function(e){CsSearch._command(e)}),CsSearch._input.on("focus",function(e){CsSearch._searchFocus(e)}),CsSearch._content.on("click",".cssearch-show-all",function(e){CsSearch.searchAll(this,e)}),CsSearch._content.on("click",".cssearch-item.product .cssearch-link",function(e){CsSearch._dispatchSelectItem(jQuery(this).closest(".cssearch-item.product"))}),CsSearch._body.on("click",function(e){CsSearch._actions.body_clicked||(CsSearch._actions.body_clicked=!0,setTimeout(function(){CsSearch._actions.body_clicked=!1},100),CsSearch._hideSearch())}),CsSearch.recommend()},getWindowOrientation:function(){return window.innerWidth>window.innerHeight?"landscape":"portrait"},_updateWindow:function(){let e=CsSearch._window.height(),c=0;c=CsSearch._body.is(".fixed_header, .g_fixed_header")?CsSearch._result[0].offsetTop+15:CsSearch._result.offset().top,(CsSearch._vars.window_height!==e||CsSearch._vars.search_offset!==c)&&(CsSearch._vars.window_height=e,CsSearch._vars.search_offset=c,CsSearch._result.css("--cs-search-max-height",CsSearch._vars.window_height-c));let a=CsSearch.getWindowOrientation();if(CsSearch._vars.window_orientation!==a){let r="portrait"===CsSearch._vars.window_orientation?"landscape":"landscape"===CsSearch._vars.window_orientation?"portrait":"";CsSearch._vars.window_orientation=a,""!==r&&CsSearch._result.removeClass(r),CsSearch._result.addClass(a)}},_searchClick:function(e){CsSearch.dev&&csstack("_searchClick"),CsSearch._actions.search_clicked=!0,setTimeout(function(){CsSearch._actions.search_clicked=!1},100)},_searchFocus:function(e){CsSearch.dev&&csstack("_searchFocus"),CsSearch._stopRecommend(),CsSearch._preventHideSearch(),CsSearch._command(e)},_command:function(e){if(CsSearch.dev&&csstack("_command"),27===e.ke
1yCode){CsSearch._hideResults();return}40===e.keyCode||38===e.keyCode||39===e.keyCode&&null!=CsSearch._selected||37===e.keyCode&&null!=CsSearch._selected||13===e.keyCode&&null!=CsSearch._selected&&CsSearch._selected.click();let c=CsSearch.getKeyword();if(CsSearch._checkCache(c)){CsSearch._showSearch();return}(""!==c||CsSearch.getLayoutOption("show_default_results"))&&(CsSearch.setKeyword(),CsSearch._clearTimeout("typing_timeout"),CsSearch._selected=null,CsSearch._timeouts.typing_timeout=setTimeout(function(){CsSearch.search()},CsSearch.getLayoutOption("search_typing_delay")))},_checkCache:function(e){return CsSearch.dev&&csstack("_checkCache"),void 0!==CsSearch._cache[e]&&(CsSearch.pingcode=CsSearch._cache[e].pingcode,CsSearch._setData(CsSearch._cache[e]),CsSearch._vars.ping_rendered!==CsSearch.pingcode&&CsSearch._render(),!0)},_showSearch:function(){if(CsSearch.dev&&csstack("_showSearch"),CsSearch._clearTimeout("search_hide"),CsSearch._checkDataError()){CsSearch._hideResults();return}CsSearch._checkViewport(),CsSearch._wrap.addClass("csseach-opened")},_hideSearch:function(){CsSearch.dev&&csstack("_hideSearch"),CsSearch._clearTimeout("search_hide"),CsSearch._actions.search_clicked||CsSearch._flags.prevent_hide||(CsSearch._timeouts.search_hide=setTimeout(function(){CsSearch._hideSearchDelayed()},CsSearch.getLayoutOption("hide_results_delay")||50))},_hideSearchDelayed:function(){CsSearch._actions.search_clicked||CsSearch._flags.prevent_hide||CsSearch._hideResults()},_hideResults:function(){CsSearch.dev&&csstack("_hideResults"),CsSearch._wrap.removeClass("csseach-opened"),""===CsSearch.getKeyword()&&null===CsSearch._timeouts.recommends&&CsSearch.recommend()},_checkViewport:function(){let e=jQuery(document).scrollTop();CsSearch.getLayoutOption("scroll_offset")>e&&CsSearch._scrollViewport(),CsSearch._updateWindow()},_scrollViewport:function(){},_preventHideSearch:function(){CsSearch._clearTimeout("prevent_hide"),CsSearch._clearTimeout("search_hide"),CsSearch._flags.prevent_hide=!0,CsSearch._timeouts.prevent_hide=setTimeout(function(){CsSearch._flags.prevent_hide=!1},300)},_clearTimeout:function(e){CsSearch.dev&&csstack("_clearTimeout",[e]),null!=CsSearch._timeouts[e]&&(clearTimeout(CsSearch._timeouts[e]),CsSearch._timeouts[e]=null)},_setLoading:function(e){e?CsSearch._wrap.addClass("cssearch-loading"):CsSearch._wrap.removeClass("cssearch-loading")},_checkDataError:function(){return!1},recommend:function(){CsSearch.dev&&csstack("recommend",[]),CsSearch.getLayoutOption("recommend.enabled")&&(""===CsSearch._vars.placeholder&&(CsSearch._vars.placeholder=CsSearch._input.attr("placeholder")),CsSearch._input.is(":focus")||""!==CsSearch._input.val()||(CsSearch.options.recommends.length?CsSearch._startRecommend():CsSearch.loadRecommends()))},_startRecommend:function(){if(CsSearch.dev&&csstack("_startRecommend",[]),!CsSearch.options.recommends.length)return;let e=CsSearch._vars.recommend_idx,c=0,a=CsSearch._vars.recommend_char,r=0;CsSearch._clearTimeout("recommends"),CsSearch._clearTimeout("recommends_clear"),CsSearch._flags.stop_recommend=!1;let s=CsSearch.getLayoutOption("recommend.cursor")||"",t=CsSearch.getLayoutOption("recommend.end_delay")||1500,n=CsSearch.getLayoutOption("recommend.start_delay")||2e3,o=CsSearch.getLayoutOption("recommend.char_delay")||"random",i=isNaN(o);i||(r=o);let h=function(e){let o=CsSearch.options.recommends[e],d=o.length;i&&(r=Math.round(170*Math.random())+30),!CsSearch._flags.stop_recommend&&(CsSearch._timeouts.recommends=setTimeout(function(){a++,CsSearch._vars.recommend_char=a;let r=o.substring(0,a);CsSearch._input.attr("placeholder",r+s),a===d?(a=0,CsSearch._vars.recommend_char=a,c=e+1,void 0===CsSearch.options.recommends[c]&&(c=0),CsSearch._timeouts.recommends=setTimeout(function(){CsSearch._clearTimeout("recommends_clear"),CsSearch._clearRecommend(function(){CsSearch._timeouts.recommends_start=setTimeout(function(){CsSearch._vars.recommend_idx=c,h(c)},n)})},t)):h(e)},r))};CsSearch._timeouts.recommends_start=setTimeout(function(){CsSearch._input.attr("placeholder",s),h(e)},n)},_clearRecommend:function(e){CsSearch.dev&&csstack("_clearRecommend");let c=0,a=CsSearch.getLayoutOption("recommend.cursor")||"";CsSearch._timeouts.recommends_clear=setInterval(function(){c++;let r=CsSearch._input.attr("placeholder"),s=(a.length?r.slice(0,-a.length):r).slice(0,-1);""===s||c>100?(CsSearch._input.attr("placeholder",a),clearInterval(CsSearch._timeouts.recommends_clear),CsSearch._timeouts.recommends_clear=null,e()):CsSearch._input.attr("placeholder",s+a)},100)},_stopRecommend:function(){CsSearch.dev&&csstack("_stopRecommend"),CsSearch._clearTimeout("recommends"),CsSearch._clearTimeout("recommends_clear"),CsSearch._flags.stop_recommend=!0,CsSearch._vars.recommend_idx=0,CsSearch._vars.recommend_char=0,CsSearch._input.attr("placeholder",CsSearch._vars.placeholder)},searchPage:function(e){if(CsSearch.dev&&csstack("searchPage"),"keyup"===e.type&&13!==e.keyCode)return;CsSearch.setKeyword();let c=CsSearch.getLayoutOption("min_chars");if(CsSearch.options.keyword.length<c){void 0===window.js_lang_luigibox_min_chars&&(window.js_lang_luigibox_min_chars="Please enter at least {char} characters"),CsSearch.message(CsSearch._lang("min_chars").replace("{char}",c));return}document.location.href=CsSearch.options.search_url.products+js_vm_search_encodeURIchars(CsSearch.options.keyword)+"/"},searchAll:function(e,c){CsSearch.dev&&csstack("searchAll");let a=jQuery(e).closest(".cssearch-row").data("type"),r=void 0!==CsSearch.options.search_url[a]?CsSearch.options.search_url[a]:CsSearch.options.search_url.products;document.location.href=r+js_vm_search_encodeURIchars(CsSearch.options.keyword)+"/"},setKeyword:function(){CsSearch.options.keyword=CsSearch.getKeyword()},getKeyword:function(){let e=CsSearch._input.val();return null==e&&(e=""),e.trim()},loadRecommends:function(){if(CsSearch.dev&&csstack("loadRecommends"),CsSearch._flags.done_recommend)return;let e=function(){let e={layout:CsSearch.options.layout.name};CsSearch._xhr=new AjaxRequest({request:e}).setController("Search").setAction("loadRecommends").onSuccess(function(e){CsSearch._flags.done_recommend=!0,void 0!==e.data&&(CsSearch.options.recommends=e.data,CsSearch._startRecommend())}).send()};"undefined"!=typeof _accountIndex&&"function"==typeof _accountIndex.waitForLogin?_accountIndex.waitForLogin().then(function(){e()}):e()},search:function(){CsSearch.dev&&csstack("search"),CsSearch.createPing(),CsSearch.setKeyword(),CsSearch._showSearch(),CsSearch._set
1Loading(!0);var e={};e.href=window.location.href,e.keyword=CsSearch.options.keyword,e.pingcode=CsSearch.pingcode,e.layout=CsSearch.options.layout.name,e=CsSearch.beforeSearchRequest(e),CsSearch._xhr=new AjaxRequest({request:e}).setController("Search").setAction("search").onSuccess(function(c){CsSearch.dev&&csstack("onSuccess"),void 0!==c.data&&(CsSearch._setCache(e.keyword,c.data),c.data.pingcode===CsSearch.pingcode&&(CsSearch._setData(c.data),CsSearch._render()))}).onError(function(e){CsSearch.dev&&csstack("onError"),CsSearch._setLoading(!1),CsSearch._hideResults()}).send()},_setData:function(e){CsSearch.dev&&csstack("_setData"),"object"==typeof e&&(CsSearch._data={},CsSearch._data.pingcode=e.pingcode,CsSearch._data.analytics=void 0!==e.analytics?e.analytics:"",CsSearch._stats=void 0!==e.stats?e.stats:{},jQuery.each(CsSearch.options.layout.structure,function(c,a){jQuery.each(a,function(c,a){void 0!==a.src&&(CsSearch._data[a.src]=void 0!==e[a.src]?e[a.src]:[])})}))},_setCache:function(e,c){CsSearch._cache[e]=c},_render:function(){CsSearch.dev&&csstack("_render"),CsSearch._data=CsSearch.afterSearchRequest(CsSearch._data),CsSearch._contentRender(),CsSearch._setLoading(!1),CsSearch._injectAnalytics(),CsSearch.afterContentRender()},_dispatchSelectItem:function(e){var c=CsSearch._data.products?CsSearch._data.products.data:[],a=e.index(),r=c[a];r&&window.dispatchEvent(new CustomEvent("cs:autocomplete:select_item",{detail:{items:[{item_id:r.id,item_name:r.title,index:a,item_list_name:"Autocomplete"}],item_list_name:"Autocomplete",search_term:CsSearch.options.keyword}}))},_injectAnalytics:function(){var e=CsSearch._data.analytics;if(e){var c=document.createElement("div");c.innerHTML=e,c.querySelectorAll("script").forEach(function(e){var c=document.createElement("script");c.text=e.textContent||e.innerText||"",document.head.appendChild(c),document.head.removeChild(c)})}},_contentRender:function(){CsSearch.dev&&csstack("_contentRender"),CsSearch._vars.ping_rendered=CsSearch._data.pingcode,CsSearch._content.empty(),jQuery.each(CsSearch.options.layout.structure,function(e,c){let a=jQuery("<div>").addClass("cssearch-col");jQuery.each(c,function(e,c){let r=CsSearch.getSrcData(c.src),s=CsSearch.customRender(r,c);null===s&&(s=CsSearch._sectionRender(r,c)),a.append(s)}),CsSearch._content.append(a)}),CsSearch._content.attr("data-ping",CsSearch._vars.ping_rendered)},_sectionRender:function(e,c){CsSearch.dev&&csstack("_sectionRender");let a=jQuery("<div>").addClass("cssearch-row "+c.src).data("type",c.src);return void 0!==c.show_title&&c.show_title&&a.append('<div class="cssearch-title">'+c.title+"</div>"),a.append(CsSearch._itemRender(e.data,c)),a},_itemRender:function(e,c){CsSearch.dev&&csstack("_itemRender",[c.src]);let a=jQuery("<div>").addClass("cssearch-content");void 0!==c.top_result&&c.top_result&&void 0!==e[0]&&e[0]&&a.addClass("has_top_result");let r=CsSearch.parseTemplate(c.template);return e&&e.length?(void 0!==c.data_process&&c.data_process.length&&jQuery.each(c.data_process,function(c,a){"function"==typeof CsSearch[a]&&(value=CsSearch[a](e)),"function"==typeof window[a]&&(value=window[a](e))}),jQuery.each(e,function(e,c){a.append(CsSearch._item(c,r))}),void 0!==c.show_button_all&&c.show_button_all&&CsSearch.options.keyword.length>1&&a.append(c.template_button_all)):a.append('<div class="cssearch-nomatch">'+CsSearch._lang("no_match")+"</div>"),a},_item:function(e,c){CsSearch.dev&&csstack("_item");let a=c.template;return jQuery.each(c.replacements,function(c,r){let s="getData"+CsSearch._capitalizeFirst(r),t=CsSearch.getData(r,e);"function"==typeof CsSearch[s]&&(t=CsSearch[s](e)),a=a.replaceAll("{"+r+"}",t)}),a},_enhanceTitleDuplicities:function(e){CsSearch.dev&&csstack("_enhanceTitleDuplicities");let c={};jQuery.each(e,function(e,a){void 0===c[a.title]&&(c[a.title]=[]),c[a.title].push(e)}),jQuery.each(c,function(c,a){a.length>1&&jQuery.each(a,function(c,a){void 0!==e[a].src_data.category_parent_title&&(e[a].title=e[a].src_data.category_parent_title+" | "+e[a].title,void 0!==e[a]._highlight&&void 0!==e[a]._highlight.title&&jQuery.each(e[a]._highlight.title,function(c,r){e[a]._highlight.title[c]=e[a].src_data.category_parent_title+" | "+r}))})})},parseTemplate:function(e){CsSearch.dev&&csstack("parseTemplate");let c={};return c.template=e,c.replacements=[],e.matchAll(/(\{([a-zA-Z0-9_\.|]+)\})/g).forEach(function(e){-1===c.replacements.indexOf(e[2])&&c.replacements.push(e[2])}),c},createPing:function(){CsSearch.dev&&csstack("createPing");for(var e=[],c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=0;a<6;
1a++)e.push(c.charAt(Math.floor(Math.random()*c.length)));CsSearch.pingcode=e.join("")},getSrcData:function(e){return CsSearch.dev&&csstack("getSrcData",[e]),void 0!==CsSearch._data[e]?CsSearch._data[e]:{}},getData:function(e,c){let a=e.split("|");if(a.length>1)return e=a[0],CsSearch["_"+a[1]](e,c);{let r=e.split("."),s=null;if(r.length>1)for(let t=0;t<r.length;t++)0===t&&void 0!==c[r[t]]?s=c[r[t]]:null!==s&&void 0!==s[r[t]]&&(s=s[r[t]]);else s=void 0!==c[e]?c[e]:null;return null!==s&&("string"==typeof s||"number"==typeof s)?s:""}},getDataPrice:function(e){let c="",a="price_"+CsSearch.options.shgid,r="old_price_"+CsSearch.options.shgid,s=void 0!==e.src_data.prices[a]?e.src_data.prices[a]:0,t=void 0!==e.src_data.prices[r]?e.src_data.prices[r]:0;if(void 0!==e.src_data.promotion_price&&(void 0!==e.src_data.promotion_price.product_price&&(s=e.src_data.promotion_price.product_price),void 0!==e.src_data.promotion_price.product_old_price&&(t=e.src_data.promotion_price.product_old_price)),void 0!==e.src_data.user_price&&(s=e.src_data.user_price),s>0&&(CsSearch.options.config.show_old_price&&t>0&&(c+='<span class="old-price">'+js_format_Money(t,CsSearch.options.currency.decimals,CsSearch.options.currency.symbol,CsSearch.options.currency["1000_symbol"],CsSearch.options.currency.dec_symbol)+"</span>"),c+='<span class="akcia-cena">'+js_format_Money(s,CsSearch.options.currency.decimals,CsSearch.options.currency.symbol,CsSearch.options.currency["1000_symbol"],CsSearch.options.currency.dec_symbol)+"</span>",CsSearch.options.config.show_old_price>1&&CsSearch.getLayoutOption("show_sale_tag")&&t>0)){let n=js_round((t-s)/t*100,0);c+='<span class="saving-price"><span class="save_lbl">'+CsSearch._lang("saving_price_label")+'</span><span class="save_val">'+n+"&nbsp;%</span></span>"}return e.src_data?.dual_price&&(c+=e.src_data.dual_price),c},beforeSearchRequest:function(e){return e},afterSearchRequest:function(e){return e},afterContentRender:function(){},customRender:function(e,c){return null},message:function(e){let c=CsSearch.getLayoutOption("message_show_duration")||5e3,a=function(){CsSearch._msg.removeClass("showed"),CsSearch._clearTimeout("message_showed")};CsSearch._timeout>0&&a(),CsSearch._msg.html(e).addClass("showed"),CsSearch._timeouts.message_showed=setTimeout(function(){a()},c)},getLayoutOption:function(e){let c=e.split("."),a=null;return c.forEach(function(e,c){0===c&&void 0!==CsSearch.options.layout.options[e]?a=CsSearch.options.layout.options[e]:c>0&&null!==a&&void 0!==a[e]&&(a=a[e])}),a},_lang:function(e){let c="js_lang_cssearch_"+e;return void 0!==window[c]?window[c]:(c="js_lang_"+e,void 0!==window[c])?window[c]:void 0!==CsSearch.langs[e]?CsSearch.langs[e]:"!"+e},_capitalizeFirst:function(e){return String(e).charAt(0).toUpperCase()+String(e).slice(1)},_encode:function(e,c){let a=void 0!==c[e]?c[e]:"!"+e;var r=document.createElement("p");return r.appendChild(document.createTextNode(a)),r.innerHTML.replace('"',"&quot;")},_inlineImage:function(e,c){let a=void 0!==c[e]?c[e]:"!"+e;return""!==a?" style=\"background-image: url('"+a+"')\"":""},_highlight:function(e,c){let a=void 0!==c[e]?c[e]:"!"+e;return void 0!==c._highlight&&(void 0!==c._highlight[e]&&c._highlight[e].length?a=c._highlight[e].join("..."):"short_desc"===e&&void 0!==c._highlight.long_desc&&c._highlight.long_desc.length&&(a="..."+c._highlight.long_desc.join("..."))),a}};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.