Path: blob/master/sites/Zomato-Phishing/index_files/fh-e7f8dbb5f68b7d510fefe4d3aab46267_003
739 views
; !function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var o=window.webpackJsonp;window.webpackJsonp=function(n,a){for(var s,r,l=0,c=[];l<n.length;l++)r=n[l],i[r]&&c.push.apply(c,i[r]),i[r]=0;for(s in a)e[s]=a[s];for(o&&o(n,a);c.length;)c.shift().call(null,t)};var n={},i={33:0};return t.e=function(e,o){if(0===i[e])return o.call(null,t);if(void 0!==i[e])i[e].push(o);else{i[e]=[o];var n=document.getElementsByTagName("head")[0],a=document.createElement("script");a.type="text/javascript",a.charset="utf-8",a.async=!0,a.src=t.p+""+{3:"ff98d56e8b073e656141",4:"df47cd783b9243e56352",89:"8dc06e99006a74bab20d"}[e]+".js",n.appendChild(a)}},t.m=e,t.c=n,t.p="",t(0)}([function(e,t,o){function n(e){$(".auto-detect").removeClass("loading"),$(".location-errors").show()}function i(){$(".snippet-restaurant").on("click",".res_name, .res_image",function(e){sendToJumbo("jevent",{ename:"resPage_browsed_location",var1:"homepage_feed"})}),$(".res-review-body").on("click",".js-btn-thank",function(e){sendToJumbo("jevent",{ename:"like_review_source",var1:"homepage_feed"})}),$(".res-review-body").on("click",".review-comment-submit",function(e){sendToJumbo("jevent",{ename:"comment_review_source",var1:"homepage_feed"})})}function a(){$(".home-cnd").on("click",function(e){e.preventDefault();var t=$(this).data("cid");$(".home-cnd-tabs li.selected").removeClass("selected"),$(".home-cnd-"+t).parents("li:first").addClass("selected"),$(".home-cnd-sections.selected").removeClass("selected"),$(".home-cnd-sections-"+t).addClass("selected")})}o.p=window.JS_CDN_PATH;var s=window.zomato||{},r=function(){for(var e={},t=window.location.search,o=t.substring(1).split("&"),n=0;n<o.length;n++){var i=o[n].split("=");e[i[0]]=decodeURIComponent(i[1])}return e};$(document).on("zreadyPageScripts",function(){initiateLaziness(),i();var e=r();e.login_required&&$(".header-login-button").trigger("click"),$(".zomaland-banner").off("click").on("click",function(){sendToJumbo("jevent",{ename:"home_page_zomaland_button_click_web",var1:"web_home",var3:USER_ID,var4:CITY_ID})}),$(".auto-detect").off("click").on("click",function(){$(".go-location").hasClass("homepage")&&sendToJumbo("jevent",{ename:"o2WidgetHomeAutoDetect"}),$(this).addClass("loading");var e=this;if(navigator.geolocation){var t=setTimeout(function(){n()},1e4);navigator.geolocation.getCurrentPosition(function(i){clearTimeout(t);var a=i.coords;$.ajax({url:HOST+"php/o2_handler.php",type:"POST",data:{case:"getClosestSubzoneLinkFromCoordinates",lat:a.latitude,long:a.longitude,skipResId:!0,getParams:{cuisine:window.cuisineId,offers:window.order_offers},csrfToken:s.csrft},success:function(t){"success"==t.status?($(e).removeClass("loading"),o.e(3,function(e){var t=[e(12)];(function(){$(".location.prompt").popup("hide"),$(".auto-detect").popup("hide")}).apply(null,t)}),$(".ui.input .prompt").val(t.deliverySubzone.name),$(".go-location").data({name:t.deliverySubzone.delivery_subzone_name,url:t.redirectUrl})):n()}})},function(e){clearTimeout(t),n()},{timeout:1e4})}else n()}),o.e(4,function(e){var t=[e(16)];(function(){e.e(89,function(e){var t=[e(17)];(function(){var t="",o=1,n=[];window.USER_ADDRESS.forEach(function(e){var t=stripHTMLTags(e.alias)+" - "+e.address+", "+e.delivery_subzone_name;n.push({entity_id:e.id,entity_type:"address",delivery_subzone:e.delivery_subzone_id,title:t,city_url:e.city_url})}),$(".ui.order.search").search({apiSettings:{url:HOST+"php/liveSuggest.php?type=delivery-area&city_id="+CITY_ID+"&cuisine="+window.cuisineId+"&offers="+window.order_offers+"&address_search=1&q={query}",throttle:200,onResponse:function(e){return Object.keys(e).length||(e.results=n),e}},searchFields:["title"],minCharacters:0,maxResults:4,bypassEnterKey:!0,type:"customTemplate",templates:{customTemplate:function(e){var t="",o="",i="",a=[];e.results.forEach(function(e){"address"==e.entity_type?a.indexOf(e.entity_id)==-1&&(a.push(e.entity_id),t+='<a class="result"><div class="content"><div class="title">',t+=e.title,t+="</div></div></a>"):(o+='<a class="result"><div class="content"><div class="title">',o+=e.title,o+="</div></div></a>")});for(var s=0,r=n.length,s=0;s<r;s++)a.indexOf(n[s].entity_id)===-1&&(t+='<a class="result"><div class="content"><div class="title">',t+=n[s].title,t+="</div></div></a>");return i+='<div class="results">',t.length&&o.length&&(i+='<a class="result header result_header">Suggested Locations</a>'),i+=o,t.length&&(i+='<div class="result header result_header">Saved Addresses</div>',i+=t),i+="</div>"}},onSearchQuery:function(e){t=e,o&&(sendToJumbo("jevent",{ename:"O2LocationSearchStartedTyping",var1:e,var2:"StartPage"}),o=1)},onResults:function(e){var o=0;o=Object.keys(e.results).length,sendToJumbo("jevent",{ename:"O2LocationSearchResultsShown",var1:o,var2:t,var3:"StartPage"})},onSelect:function(e,o){if(sendToJumbo("jevent",{ename:"O2LocationSearchResultSelected",var1:e.entity_id,var2:t,var3:e.id,var4:"StartPage"}),$(".not-available-errors").hide(),"google_place"==e.entity_type)$(".ui.order.search").addClass("loading"),$.ajax({url:HOST+"php/liveSuggest.php?type=get-google-delivery-area&google_place_id="+e.entity_id,type:"GET",success:function(t){$(".ui.order.search").removeClass("loading"),"success"==t.status?($(".go-location").data({name:e.title,url:t.redirectUrl}),$(".go-location").hasClass("homepage")&&sendToJumbo("jevent",{ename:"o2WidgetHomeManualSearchGoogle"})):$(".not-available-errors").show()}});else if("address"==e.entity_type){var n=e.city_url+"order-food-online?delivery_subzone="+e.delivery_subzone;$(".go-location").data({name:stripHTMLTags(e.title),url:n}),$(".go-location").hasClass("homepage")&&sendToJumbo("jevent",{ename:"o2WidgetHomeManualSearch"}),setCookie("selectedAddressId",e.entity_id,s.O2_SELECTED_ADDRESS_REMEMBER_DURATION)}else $(".go-location").data({name:e.title,url:e.redirectUrl}),$(".go-location").hasClass("homepage")&&sendToJumbo("jevent",{ename:"o2WidgetHomeManualSearch"});"address"!=e.entity_type&&setCookie("selectedAddressId",0,-1)},onResultsOpen:function(){e.e(3,function(e){var t=[e(12)];(function(){$(".location.prompt").popup("hide")}).apply(null,t)})}})}).apply(null,t)})}).apply(null,t)}),$(".go-location").on("click",function(){if(!$(this).data("url")||$(this).data("name")!=$(".location.prompt").val())return $(this).hasClass("homepage")?($(this).addClass("loading"),void(window.location=HOST+"order")):(o.e(3,function(e){var t=[e(12)];(function(){$(".location.prompt").popup({position:"bottom left",content:"Please enter and select a delivery location",on:"manual"}).popup("show"),setTimeout(function(){$(".location.prompt").popup("hide")},3e3)}).apply(null,t)}),void $(".ui.input .prompt").focus());if($(this).addClass("loading"),$(this).hasClass("homepage"))var e="o2PageFindButtonHomePage";else var e="o2PageFindButton";sendToJumbo("jevent",{ename:e}),window.location=$(this).data("url")}),$(".ui.order.search").on("click",function(){var e=$(this),t=$("input.location.prompt").val();t.length<2&&e.search("search remote","").search("show result")}),$(".start-o2-item").on("click",function(e){var t=$(this).find("div").text();sendToJumbo("jevent",{ename:"o2Homepage",var1:t})}),$(".start-user-snippet").on("click",function(e){var t=$(this).data("href");if(t&&!$(".zs-follow-btn-container").is(e.target)&&!$(".zs-follow-btn-container").has(e.target).length)return window.location.href=t,!1}),$(".hp-countries").on("mouseenter",".hp-city-list",function(e){var t=$(e.currentTarget);t.prop("offsetHeight")<t.prop("scrollHeight")&&(document.body.style.overflow="hidden")}).on("mouseleave",".hp-city-list",function(){document.body.style.overflow="scroll"}),$(".city-search-inp").on("keyup",function(e){var t=$(this).val(),o=e.keyCode,n=$(".country_city_list a:visible"),i=$(".country_city_list a:visible.selected:first"),a=n.index(i);if("37"==o);else{if("38"==o)return e.stopPropagation(),e.preventDefault(),n.removeClass("selected"),a>=0&&n.eq(a-1)?n.eq(a-1).addClass("selected").focus():$(".country_city_list a:visible:last").addClass("selected").focus(),$(".city-search-inp").focus(),!1;if("39"==o);else{if("40"==o)return e.stopPropagation(),e.preventDefault(),n.removeClass("selected"),a>=0&&n.eq(a+1%n.length)?n.eq((a+1)%n.length).addClass("selected").focus():$(".country_city_list a:visible:first").addClass("selected").focus(),$(".city-search-inp").focus(),!1;if("13"==o){e.stopPropagation(),e.preventDefault();var s=$(".country_city_list a:visible.selected:first").attr("href");if(s)return window.location.href=s,!1}else{if(27==e.keyCode)return!1;n.removeClass("selected")}}}t.length>0?($(".city-link").hide(),$(".country").hide(),search=make_pattern(t),$(".city-link").each(function(e){$(this).text().match(search)&&($(this).show(),$(this).parents(".country").show())}),$(".country").each(function(e){var t=$(this).find(".country_id_list").text();t.match(search)&&($(this).show(),$(this).find(".city-link").show())})):($(".city-link").show(),$(".country").show())}).on("keydown",function(e){if([13,38,40].indexOf(e.keyCode)>=0)return e.stopPropagation(),e.preventDefault(),!1}),a(),"#detect"==window.location.hash&&$("#location-auto").trigger("mousedown"),$("#js-mobile-hp-city-selector").change(function(){location.href=$(this).val()}),$(".hp-foodies").find(".view-all").click(function(){var e=$(this).parents(".hp-foodies").data("type");sendToJumbo("jevent",{ename:e+"-all"})}),$(".hp-foodies .top-food-section").find("a").click(function(){var e=$(this).parents(".hp-foodies").data("type"),t=$(this).parents(".top-user-rev-a").index(),o=this.href;sendToJumbo("jevent",{ename:e,var1:t,var2:o})}),$(".see-more-btn").click(function(){sendToJumbo("jevent",{ename:"sece-more-friends"})})}),$(".hp-neighbourhoods-load").on("click",function(e){e.stopPropagation(),e.preventDefault(),$(".neighbourhoods-list-big").show(),$(".neighbourhoods-list-small").remove(),$(this).remove()}),$(document).on("zready",function(){"undefined"!=typeof window._B?window._B.__currentPage="start":null}),"undefined"!=typeof Auth&&Auth.google.loadSDK()}]);; $(document).on("zready",function(){function bindConnectButton(){$("#connect-instagram-ac").click(function(a){$("#instagram-ac-details").addClass("load"),a.preventDefault();var t=screen.width/2-700/2,e=screen.height/2-450/2,n=$(this).data("login-url"),i=window.open(n,"instapopup","height=360,width=600, top="+e+", left="+t+", menubar=0, toolbar=no");window.focus&&i.focus();var s=setInterval(function(){i.closed&&(clearInterval(s),"undefined"!=typeof connectionWindowLoaded&&getUserInstagramDataFromRelay())},200)})}function getUserInstagramDataFromRelay(){$.ajax({type:"POST",url:HOST+"php/instagram_tag_relay?csrf_token="+zomato.csrft,data:{tag:"zomato",timeout:1},success:function(a){if(a.user.user_id&&a.user.access_token){var t=$("#instagram-ac-details");t.addClass("load"),t.empty();var e='<div class="sj-user-sub-section sj-has-icon inst-ac-details bb pbot0">'+'<button class="ui instagram icon button left"><i class="instagram icon" data-icon="4"></i></button>'+'<div class="cntcted-uinstagramsr-data left ml5">Connected as'+"<br>"+'<a href="'+"http://instagram.com/"+a.user.username+'" target="_blank">'+a.user.username+"</a>"+"</div>"+'<div class="right disconnect-btn-holder ta-right"><a href="#" id="disconnect-instagram-ac" class="inline-block tooltip disconnect-btn" data-icon="X" data-user-id="'+a.user.user_id+'" data-email="'+a.user.email+'"></a></div>'+'<div class="clear"></div>'+"</div>"+"<div class='sj-user-sm pt5'>Add <strong>#zomato</strong> to your food photos on Instagram for them to show up in your friends' food feeds on Zomato.</div>";t.append(e),bindDisconnectButton()}},error:function(a,t,e){},complete:function(){$("#instagram-ac-details").removeClass("load")},dataType:"jsonp"})}function bindDisconnectButton(){$("#instagram-ac-details").addClass("load"),$("#disconnect-instagram-ac").click(function(event){event.preventDefault();var me=$(this),parent=me.parents(".inst-ac-details"),user_id=me.data("user-id");me.html(""),me.addClass("load"),$("#instagram-ac-details").addClass("load"),$.ajax({type:"POST",url:HOST+"php/instagram_connect.php",data:{user_id:user_id,profile_action:"disconnect_instagram_account",csrf_token:zomato.csrft},success:function(response){me.removeClass("load");var resp=eval("("+response+")");if(resp.status="success"){var newHTML='<div class="sj-user-sub-section no-border"> <a class="instagram-connect" id="connect-instagram-ac" data-login-url="'+$("#inst-data-holder").data("loginurl")+'" href="#"><button class="ui instagram button fluid"><i class="instagram icon left" data-icon="4"></i>Connect with Instagram</button></a></div>';$("#instagram-ac-details").empty().append(newHTML),$(".tipsy-inner").parent().hide(),bindConnectButton()}else me.html('<img src="'+CDN+'images/cross.gif" alt="close">'),alert("Could Not disconnect with instagram. Please try later.")},complete:function(){parent.removeClass("load"),$("#instagram-ac-details").removeClass("load")}})})}bindConnectButton(),bindDisconnectButton(),$("#instagram-next,#instagram-prev").on("click",function(event){event.preventDefault();var parent=$(this).parent(),entity_id=parent.data("entity_id"),profile_action=parent.data("profile_action");if("instagram-prev"==$(this).attr("id"))var page=parseInt(parent.data("page"))-2;else var page=parent.data("page");var limit=parent.data("limit"),that=$(this);$.ajax({type:"POST",url:HOST+"php/instagram_connect.php",data:{user_id:entity_id,profile_action:profile_action,page:page,limit:limit},success:function(response){var m=eval("("+response+")");if("success"==m.status){var container=$(that).parents(".instagram-load-more-container").find(".zs-following-list #instagram-images"),output=m.html;""!=output&&container.empty(),$(output).hide().appendTo($(container)).fadeIn().css("display","inline-block"),$(parent).data("page",m.page),0==m.more&&$(that).fadeOut("300").remove()}else 0==m.status&&$("#create-list-error").html(m.message).fadeIn().delay(5e3).fadeOut();1==$(parent).data("page")?parent.html('<a id="instagram-next" href="#" style="text-decoration:none; display:inline-block; height: 150px; background-image: url('+CDN+'images/inext.png); background-position: center center; background-repeat: no-repeat;"> </a>'):$(parent).data("page")>1&&0!=m.more?parent.html('<a id="instagram-next" href="#" style="text-decoration:none; display:inline-block; height: 150px; background-image: url('+CDN+'images/inext.png); background-position: center center; background-repeat: no-repeat;"> </a><a id="instagram-prev" href="#" style="text-decoration:none; display:inline-block; height: 150px; background-image: url('+CDN+'images/iprev.png); background-position: center center; background-repeat: no-repeat;"> </a>'):$(parent).data("page")>1&&0==m.more&&parent.html('<a id="instagram-prev" href="#" style="text-decoration:none; display:inline-block; height: 150px; background-image: url('+CDN+'images/iprev.png); background-position: center center; background-repeat: no-repeat;"> </a>')}})}),$(".instagram-load-more").on("click",function(event){event.preventDefault(),$(this).find(".load-more").html('<img class="zs-loading-img" src="'+FLOADING_IMG_SRC+'"/>');var user_id=$(this).data("entity_id"),next_max_id=$(this).data("next-max-id"),profile_action=$(this).data("profile_action"),page=$(this).data("page"),limit=$(this).data("limit"),data="next_max_id="+next_max_id+"&user_id="+user_id+"&profile_action="+profile_action+"&page="+page+"&limit="+limit,that=$(this);$.ajax({type:"POST",url:HOST+"php/instagram_connect.php",data:data,success:function(response){var m=eval("("+response+")");if("success"==m.status){var container=$(that).parents(".instagram-load-more-container").find(".zs-following-list");if("user-instagram-add-more"==profile_action){var output=m.html;$(output).hide().appendTo($(container)).fadeIn().css("display","inline-block"),$(that).data("next-max-id",m.next_max_id)}else{var output="<div>"+m.html+'<div class="clear"></div></div>';$(output).hide().appendTo($(container)).fadeIn()}$(that).data("page",m.page);var left_str="";0!=m.left_count&&(left_str=" ("+m.left_count+")"),0==m.more?$(that).fadeOut("300").remove():$(that).find(".load-more").html(zomato.language.replaceVars("Load More $1",left_str)+'<span class="caret"></span>')}else 0==m.status&&$("#create-list-error").html(m.message).fadeIn().delay(5e3).fadeOut()}})})});; window.instagramZomato={cache:{},pageSize:9,get:function(e,t){var i="review_"+e.data("review_id");if(t=t||!1,"undefined"!=typeof this.cache[i])return this.cache[i];var a={init:function(e,t){this.id="",this.token="",this.ready=!1;var i=parseInt($("#instagram_page_size").val());i?this.pageSize=i:this.pageSize=instagramZomato.pageSize,this.tagPageSize=100,this.fetchTaggedImgs=!1,this.tag="zomato",this.apiURL="https://api.instagram.com/v1/users/",this.tagApiTimeout=10,this.tagApiBackgroundTimeout=1,this.tagApiURL=HOST+"php/instagram_tag_relay?timeout="+this.tagApiTimeout+"&csrf_token="+zomato.csrft,this.tagApiBackgroundURL=HOST+"php/instagram_tag_relay?timeout="+this.tagApiBackgroundTimeout+"&csrf_token="+zomato.csrft,this.loadedImgs=[],this.loadedImgIDs=[],this.prevURL=[],this.nextURL=[],this.previous_selected_insta_img_ids=[],this.offset=0,this.stash=[],this.stashedPrev=-1,this.selectedImgIDs=[],this.selectedImgURLs=[],this.numSelected=0,this.more=!1,this.prev=!1,this.ajaxData={data:[]},this.loadingTimeout=750,this.loadingTimedout=!1,this.imgsLoaded=!1,this.reviewed=!1,this.parent_obj=t||$(".review-photos").first(),this.responseCache={},this.setCounter(),this.setImgsFromResponse([],[]),this.id=a.parent_obj.find(".inst").data("instagram-id"),this.token=a.parent_obj.find(".inst").data("instagram-token"),this.ready=!!this.id&&!!this.token,this.tag=a.parent_obj.find(".inst-photo-tag-select").is(":checked")?"zomato":"all",this.tagApiURL+="&count="+this.pageSize+"&tag="+this.tag+"&callback=something",this.tagApiBackgroundURL+="&count="+this.pageSize+"&tag=zomato"+"&callback=something",this.fetchTaggedImgs="all"!=this.tag,this.apiURL+=this.id+"/media/recent/?access_token="+this.token+"&count="+(this.fetchTaggedImgs?this.tagPageSize:this.pageSize),"undefined"!=typeof a.parent_obj.find("#previous_selected_insta_img_ids").val()&&(this.previous_selected_insta_img_ids=a.parent_obj.find("#previous_selected_insta_img_ids").val().split(",")),this.ready&&(e?this.fetchImages():this.ready&&this.callTagApiInBackground())},callTagApiInBackground:function(){$.ajax({type:"POST",url:a.tagApiBackgroundURL,success:function(e){},error:function(e,t,i){},complete:function(){},dataType:"jsonp"})},addToAjaxData:function(e){return!!this.ajaxData&&(this.ajaxData.data||(this.ajaxData.data=[]),e.pagination&&(this.ajaxData.pagination=e.pagination),e.meta&&(this.ajaxData.meta=e.meta),void $(e.data).each(function(e,t){a.ajaxData.data.push(t)}))},cleanupAjaxData:function(){var e=[];$(this.ajaxData.data).each(function(t,i){var n=i.id;-1==jQuery.inArray(n,a.selectedImgIDs)&&delete a.ajaxData.data[t],-1!=jQuery.inArray(n,e)&&delete a.ajaxData.data[t],e.push(n)});var t=[];$(this.ajaxData.data).each(function(e,i){return"undefined"==typeof i||void t.push(i)}),this.ajaxData.data=t},setCounter:function(){this.numSelected?(a.parent_obj.find("#inst-img-ctr").text(this.numSelected+" selected"),a.parent_obj.find("#inst-img-ctr").fadeIn()):a.parent_obj.find("#inst-img-ctr").fadeOut()},showLoading:function(){a.loadingTimedout=!1,a.parent_obj.addClass("loading"),this.loadingTimeoutID=setTimeout(function(){a.loadingTimedout=!0,a.imgsLoaded&&a.parent_obj.removeClass("loading")},a.loadingTimeout)},fetchImages:function(){if(a.showLoading(),a.imgsLoaded=!1,!this.ready)return"ERR:NOT_READY";var e=this.fetchTaggedImgs?this.tagApiURL:this.apiURL+"&callback=something";this.stash.push(e),this.stashedPrev++,$.ajax({type:"POST",url:e,success:function(e){e.pagination.next_url?(a.nextURL=e.pagination.next_url,a.more=!0):a.more=!1,a.parseImgJSON(e)},error:function(e,t,i){},complete:function(){a.setBrowseButtons()},dataType:"jsonp"})},parseImgJSON:function(e){0==e.data.length?(a.parent_obj.find("#inst-li-noimg").fadeIn(),a.parent_obj.find(".inst-li-noimg-loader").hide(),a.parent_obj.find(".select-photos").hide()):(a.parent_obj.removeClass("loading"),a.parent_obj.find("#inst-li-noimg").hide(),a.parent_obj.find(".inst-li-noimg-loader").hide()),a.imgsLoaded=!0,a.addToAjaxData(e),this.offset++;var t=[],i=[];$(e.data).each(function(e,n){t.push(n.images.thumbnail.url),i.push(n.id),-1==jQuery.inArray(n.images.thumbnail.url,a.loadedImgs)&&(a.loadedImgs.push(n.images.thumbnail.url),a.loadedImgIDs.push(n.id))}),this.setImgsFromResponse(t,i)},callAPI:function(e,t){a.imgsLoaded=!1,a.showLoading(),$.ajax({type:"POST",url:e,success:function(e){e.pagination.next_url?(a.nextURL=e.pagination.next_url,a.more=!0):(a.nextURL=null,a.more=!1),a.parseImgJSON(e)},complete:function(){a.setBrowseButtons()},dataType:"jsonp"}),1==t&&-1==jQuery.inArray(e,this.stash)&&this.stash.push(e),1==t&&(this.stashedPrev=Math.min(this.stash.length-1,this.stashedPrev+1)),-1==t&&(this.stashedPrev=Math.max(-1,this.stashedPrev-1))},setBrowseButtons:function(){a.prev?a.parent_obj.find("#instagram-selection-container .prev").removeClass("hidden"):a.parent_obj.find("#instagram-selection-container .prev").addClass("hidden"),a.more?a.parent_obj.find("#instagram-selection-container .next").removeClass("hidden"):a.parent_obj.find("#instagram-selection-container .next").addClass("hidden")},fetchNextImages:function(){var e=(a.loadedImgIDs.length>0?a.loadedImgIDs[a.loadedImgIDs.length-1]:null,this.fetchTaggedImgs?this.tagApiURL:this.apiURL);return a.nextURL?(e=a.nextURL,a.more=!0,this.setImgsFromResponse([],[]),a.prev=!0,void this.callAPI(e,1)):(a.more=!1,!1)},fetchPrevImages:function(){var e=this.stashedPrev-1;a.prev=!(e<1),a.setBrowseButtons(),e<0||this.callAPI(this.stash[e],-1)},setImgs:function(){},setImgsFromResponse:function(e,t){a.parent_obj.find("#instagram-selection-container .choose-photos-ul img").css({opacity:0}).off("load.anim").attr("src",CDN+"images/pixel.gif"),0==e.length&&(a.parent_obj.find("#instagram-selection-container .prev").addClass("hidden"),a.parent_obj.find("#instagram-selection-container .next").addClass("hidden"));for(var i=0;i<a.pageSize;i++){var n="#inst-img-"+i,s=".inst-li-"+i;i<e.length?(a.parent_obj.find(s).show(),a.parent_obj.find(n).on("load.anim",function(){a.loadingTimedout&&a.parent_obj.removeClass("loading"),$(this).animate({opacity:1},500)}),a.parent_obj.find(n).attr("src",e[i]),a.parent_obj.find(s).data("id",t[i]),-1!=jQuery.inArray(t[i],this.selectedImgIDs)?(a.parent_obj.find(s).addClass("selected"),a.parent_obj.find(s+" a").removeClass("hidden")):(a.parent_obj.find(s).removeClass("selected"),a.parent_obj.find(s+" a").addClass("hidden")),this.previous_selected_insta_img_ids.indexOf(t[i])>-1?(a.parent_obj.find(s).addClass("previously_selected selected"),a.parent_obj.find(s).find("#insta-selected-tick").removeClass("hidden")):a.parent_obj.find(s).removeClass("previously_selected"),a.parent_obj.find(s).data("url",e[i])):a.parent_obj.find(s).hide()}},getElemIndex:function(e,t){var i=-1;if(Array.prototype.indexOf)i=e.indexOf(t);else for(;i<e.length&&t!=e[i];i++);return i==e.length?-1:i},toggleSelection:function(e){a.parent_obj.find(e).toggleClass("selected"),a.parent_obj.find(e).find(".sprite-tick").toggleClass("hidden");var t=a.parent_obj.find(e).data("id"),i=a.parent_obj.find(e).data("url");-1==jQuery.inArray(a.parent_obj.find(e).data("id"),a.selectedImgIDs)?(this.selectedImgIDs.push(t),this.selectedImgURLs.push(i),this.numSelected++):(delete this.selectedImgIDs[this.getElemIndex(this.selectedImgIDs,t)],delete this.selectedImgURLs[this.getElemIndex(this.selectedImgURLs,i)],this.numSelected--),this.setCounter(),this.numSelected?a.parent_obj.find(".photo-confirm-btn").fadeIn("fast"):a.parent_obj.find(".photo-confirm-btn").hide("fast"),a.numSelected?a.parent_obj.find("#review-submit").data("reviewed","false"):a.parent_obj.find("#review-submit").data("reviewed","true")},beginPhotoReview:function(){this.reviewed=!0,a.parent_obj.parents(".review-form-item").next(".review-form-item").find("#review-submit").data("reviewed","true"),a.numSelected&&(a.parent_obj.find("#selected-instagram").empty(),$(a.selectedImgURLs).each(function(e,t){if("undefined"==typeof t)return!0;var i="<li class='left' style='padding:5px;' id='"+a.selectedImgIDs[e]+"'><img src='"+a.selectedImgURLs[e]+"' style='width:100px;' /></li>";a.parent_obj.find("#selected-instagram").append(i)}),a.parent_obj.find("#photo-review").fadeIn(),a.parent_obj.find("#instagram-selection-container .choose-photos").hide(),a.parent_obj.find(".edit-selected-inst").off("click"),a.parent_obj.find(".edit-selected-inst").on("click",function(e){e.preventDefault(),a.endPhotoReview()}),a.parent_obj.find("#instagram-selection-container").hide())},beginSimplePhotoReview:function(){this.reviewed=!0;var e=a.parent_obj.parents(".photo-upload-form-container");a.numSelected&&(e.find("#selected-instagram").empty(),$(a.selectedImgURLs).each(function(t,i){if("undefined"==typeof i)return!0;var n="<li class='ui item' id='"+a.selectedImgIDs[t]+"'> <div class='ui small image'> <img src='"+a.selectedImgURLs[t]+"' /> </div> <div class='middle aligned content'> <div contenteditable='true' class='img_caption photo-form-caption-area' placeholder='Write a Caption... Use #dishname to tag a dish...'></div> </div> </li>";e.find("#selected-instagram").append(n)}),e.find("#photo-review").fadeIn(),e.find("#instagram-selection-container .choose-photos").hide(),e.find(".edit-selected-inst").off("click"),e.find(".edit-selected-inst").on("click",function(t){t.preventDefault(),e.find("#photo-review").hide(),e.find("#selected-instagram").empty(),e.find(".uploaded_photo_details").addClass("hidden"),e.find(".upload_submit_btn").addClass("hidden"),a.endPhotoReview()}),e.find("#instagram-selection-container").hide(),e.find(".uploaded_photo_details").removeClass("hidden"),e.find(".upload_submit_btn").removeClass("hidden"))},endPhotoReview:function(){this.ready?(this.reviewed=!1,a.parent_obj.find("#review-submit").data("reviewed","false"),a.parent_obj.find("#photo-review").hide(),a.parent_obj.find("#instagram-selection-container .select-photos").show(),a.parent_obj.find("#instagram-selection-container .photo-confirm-btn").show(),a.parent_obj.find("#instagram-selection-container .choose-photos").fadeIn(),a.parent_obj.find("#instagram-selection-container .photo-confirm-btn").click(function(){a.beginPhotoReview()}),a.parent_obj.find("#instagram-selection-container").fadeIn()):(a.parent_obj.find("#photo-review").css("display","none"),zomato.reviews.promptForInstagramConnection(a.parent_obj))},getSubmissionData:function(e){this.cleanupAjaxData();var t=this.ajaxData;return e&&(t=JSON.stringify(t)),t},getSimplePhotosSubmissionData:function(e){this.cleanupAjaxData();var t=this.ajaxData;return $.each(t.data,function(e,i){t.data[e].caption={text:$(".photo-upload-form-container #selected-instagram li#"+i.id+" .img_caption").text(),created_time:Date.now()}}),e&&(t=JSON.stringify(t)),t}};return this.cache[i]=a,a.init(t,e),a}};; $(document).on("zready",function(){function e(e){var a=e.indexOf("@"),i=e.lastIndexOf(".");return!(a<1||i<a+2||i+2>=e.length)}$("#send-email").on("click",function(){var a=$("#email-id").val(),i=!1,s=e(a);if(!s){i=!0;var o="Please enter a valid email address"}if(""==a){i=!0;var o="Please enter your email address"}return i?($(".error-message").html(o),$("#email-error-message").show(),setTimeout(function(){$("#email-error-message").hide()},5e3),$("#email-id").on("click",function(){$("#email-error-message").hide(),$("#email-id").off("click")}),!1):($("#send-email").addClass("loading"),void $.ajax({url:HOST+"php/email_handler.php",type:"POST",dataType:"json",data:{email_id:a,type:"download_app"},success:function(e){"success"==e.status?($("#email-success-message").show(),setTimeout(function(){$("#email-success-message").hide()},5e3)):(o=e.message,$(".error-message").html(o),$("#email-error-message").show(),setTimeout(function(){$("#email-error-message").hide()},5e3))},complete:function(e){$("#send-email").removeClass("loading")}}))})});; !function(e){function t(o){if(n[o])return n[o].exports;var a=n[o]={exports:{},id:o,loaded:!1};return e[o].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var o=window.webpackJsonp;window.webpackJsonp=function(n,i){for(var d,s,l=0,r=[];l<n.length;l++)s=n[l],a[s]&&r.push.apply(r,a[s]),a[s]=0;for(d in i)e[d]=i[d];for(o&&o(n,i);r.length;)r.shift().call(null,t)};var n={},a={70:0};return t.e=function(e,o){if(0===a[e])return o.call(null,t);if(void 0!==a[e])a[e].push(o);else{a[e]=[o];var n=document.getElementsByTagName("head")[0],i=document.createElement("script");i.type="text/javascript",i.charset="utf-8",i.async=!0,i.src=t.p+""+{3:"ff98d56e8b073e656141"}[e]+".js",n.appendChild(i)}},t.m=e,t.c=n,t.p="",t(0)}([function(e,t,o){function n(){$(".newstoriesahead").off("click").html("Loading...");var e=$("#nFeed").data("type");$.ajax({url:HOST+"php/feeder.php",type:"POST",data:{STAMP:maxstamp,TORB:1,type:e},dataType:"json",success:function(e){$(".newstoriesahead").hide().on("click",n),$.each(e.groups,function(){$(".feedroot[data-groupid='"+this+"']").remove()}),$(".inactivegroup").remove(),maxstamp=e.maxstamp,displayZSFollowButtons(),initiateLaziness(),FeedActivity.init(),zomato.common.events.bindEvents(),m=0},error:function(){$(".newstoriesahead").hide().on("click",n)}})}function a(e){var t=$("#nFeed").data("type"),o=$("#nFeed").attr("data-data_type"),n=$("#nFeed").data("user_id"),a=$("#nFeed").data("res_id"),i=$("#nFeed").data("city_id");return void 0===typeof minstamp&&(minstamp=0),_=0,0!=$("#nFeed").data("active")&&($("#nFeed").data("active",0),0!=v?($("#nFeed .loading").remove(),$("#nFeed").append(v),initiateLaziness(),zomato.common.events.bindEvents(),FeedActivity.init(),0==g&&$(".load-more-feed").hide(),$(".load-more-feed").html("load more"),d=$("#nFeed > .masonry-item").length,s=d-2,l=$(".masonry-item:nth-child("+s+")"),l.length>0&&(r=l.offset().top),p=$("#footer"),p.length>0&&(f=p.offset().top),v=0,w=!1,u=0,y=0,void $("#nFeed").data("active",1)):void $.ajax({url:HOST+"php/feeder.php",type:"POST",data:{STAMP:minstamp,TORB:0,type:t,data_type:o,user_id:n,res_id:a,city_id:i},dataType:"json",complete:function(){$("#nFeed").data("active",1)},success:function(t){0==u&&1==y||0==y?($("#nFeed .loading").remove(),$("#nFeed").append(t.output),e&&$(".load-more-feed").show(),displayZSFollowButtons(),initiateLaziness(),zomato.common.events.bindEvents(),FeedActivity.init(),minstamp=t.minstamp,$(".load-more-feed").html("load more"),0==t.more&&$(".load-more-feed").hide(),w=!1,d=$("#nFeed > .masonry-item").length,s=d-2,l=$(".masonry-item:nth-child("+s+")"),l.length>0&&(r=l.offset().top),p=$("#footer"),p.length>0&&(f=p.offset().top),y=0):(w=!1,minstamp=t.minstamp,v=t.output,g=t.more,$(".load-more-feed").html("load more")),$(".temp-feed-loading").hasClass("hidden")||$(".temp-feed-loading").addClass("hidden")}}))}function i(){$(".homepage-feed-container").on("click",function(e){(!USER_ID||USER_ID&&h>0)&&(sendToJumbo("jevent",{ename:"viewed_feed",var1:USER_ID}),$(".homepage-feed-container").off("click"))})}o.p=window.JS_CDN_PATH;var d,s,l,r,c,p,f,m=0,h=0,u=0,v=0,g=0,y=0,_=0,w=!1,F=0,x=0;$(document).on("zready",function(){i(),o.p=window.JS_CDN_PATH,o.e(3,function(e){var t=[e(12)];(function(){$("#user-blog-widget").popup({on:"hover",hoverable:!0,position:"bottom center",distanceAway:0})}).apply(null,t)}),$(".activate-city-feed").off("click").on("click",function(e){e.preventDefault(),e.stopPropagation(),$("#nFeed").html('<div class="temp-feed-loading"><div class="ui active loader"></div></div>'),$("#nFeed").attr("data-data_type","city_feed"),minstamp=0,$(this).removeClass("inverted");var t=$("#nFeed");$(".load-more-feed").length||t.parent().append('<div class="load-more-feed hidden">load more</div>'),$(".load-more-feed").trigger("click"),$(".load-more-feed").hide(),$(".activate-my-feed").addClass("inverted");var o=$(".feed-title").attr("data-city_name");$(".feed-title-field").text(o)}),$(".activate-my-feed").off("click").on("click",function(e){e.preventDefault(),e.stopPropagation(),$("#nFeed").html('<div class="temp-feed-loading"><div class="ui active loader"></div></div>'),$("#nFeed").attr("data-data_type","newsfeed"),minstamp=0,$(this).removeClass("inverted");var t=$("#nFeed");$(".load-more-feed").length||t.parent().append('<div class="load-more-feed hidden">load more</div>'),$(".load-more-feed").trigger("click"),$(".load-more-feed").hide(),$(".activate-city-feed").addClass("inverted"),$(".feed-title-field").text("My Feed")}),$(".close-feed-tour").on("click",function(e){$(this).fadeOut(300),$(".feed-tour-hero").slideUp(600),$.ajax({url:HOST+"php/set_cookie_handler",type:"POST",dataType:"json",success:function(e){"success"==e.status},error:function(e){}})}),"undefined"!=typeof feed_is_empty&&1==feed_is_empty&&$(document.body).on("click",".zs-follow-user-button",function(e){1==feed_is_empty&&(F++,F>0&&$.ajax({url:HOST+"php/news_feed_count_handler",type:"POST",dataType:"json",success:function(e){"success"==e.status&&e.news_feed_stories_count>5&&(x=e.news_feed_stories_count,F>=3&&x>5&&(feed_is_empty=!1,$("#refresh-feed").fadeIn()))},complete:function(e){},error:function(e){}}))}),$("#refresh-feed").on("click",function(e){e.preventDefault(),window.location.reload()}),$(".container").on("click",".load-more-feed",function(e){_||(y=0);var t=!1;$(".temp-feed-loading").hasClass("hidden")?$(this).html('<div class="mtop0 mbot0"><div class="ui active loader"></div></div>'):t=!0,a(t),e.preventDefault(),e.stopPropagation()}),$(".container").on("click",".nfo-expand",function(e){e.preventDefault(),$(this).siblings(".nfo-expand-loader").show();var t=$(this),o=$(this).parents(".nfo-expand-cont"),n=$(this).data("nfo-type"),a=$(this).data("page-no"),i=$(this).parents(".feedroot").data("groupid");$.ajax({url:HOST+"php/feeder_group.php",type:"POST",data:{nfo_type:n,group_id:i,page_no:a},dataType:"json",success:function(e){$(t).siblings(".nfo-expand-loader").remove(),$(t).data("page-no",a+1),$(t).parents(".feedroot").find(".nfo-cont").append(e.html),0==e.more&&($(t).hide(),$(o).hide()),initiateLaziness(),zomato.common.events.bindEvents(),reloadZSFollowButtons(e),reloadZSFollowHoverButtons(e),FeedActivity.init()}})}),$(".container").on("click",".expand-list",function(e){e.preventDefault(),$(this).parents(".multiple").find(".hidden").show(),$(this).hide()}),$(".nf-tab-link a").on("click",function(e){if($(this).parent(".nf-tab-link").hasClass("selected"))return!1;e.preventDefault();var t=$(this).data("type");$(".newstoriesahead").hide(),m=0,$("#nFeed").html('<div class="ta-center" style="border-left:1px solid #e4e4e2;border-right: 1px solid #e4e4e2; background-color: white;padding-top: 100px;padding-bottom: 100px;"><img src="'+CDN+'images/ajax_spinner.gif"/><div class="clear"></div></div><div class="clear"></div>'),$(".load-more-feed").hide(),$.ajax({url:HOST+"php/feeder.php",type:"POST",data:{type:t},dataType:"json",context:this,success:function(e){$(".nf-tab-link.selected").removeClass("selected"),$(this).parents(".nf-tab-link").addClass("selected"),e.more&&$(".load-more-feed").show(),$("#nFeed").html(e.output),$("#nFeed").data("type",t),displayZSFollowButtons(),initiateLaziness(),zomato.common.events.bindEvents(),FeedActivity.init(),minstamp=e.minstamp,maxstamp=e.maxstamp}})}),d=$("#nFeed > .masonry-item").length,s=d-2,l=$(".masonry-item:nth-child("+s+")"),l.length>0&&(r=l.offset().top);var e=$("#footer");e.length>0&&(f=e.offset().top);var t=window.innerHeight,p=$(".load-more-feed"),v=$(".load-more");$(window).scroll(function(){return 0==h&&"undefined"!=typeof USER_ID&&0!==USER_ID&&""!==USER_ID&&$(window).scrollTop()>150?(w=!0,p.trigger("click"),void h++):(e.length>0&&(f=e.offset().top),$(window).scrollTop()+t<f?u=0:(u=1,y&&p.html("load more")),l.length>0&&(c=$(window).scrollTop()+t,c>=r&&0==w&&h<20&&0==u&&(y=1,_=1,h++,p.length>0&&p.is(":visible")?(w=!0,p.trigger("click")):v.length>0&&v.is(":visible")&&(w=!0,v.trigger("click")))),void 0)}),$(".newstoriesahead").on("click",n)})}]);; $("*[data-homepage_ui_tracking_active]").on("mousedown",function(){"function"==typeof window.sendToJumbo&&window.sendToJumbo("jevent",{ename:"homepage_ui_tracking",var1:$(this).data("homepage_ui_tracking_element_id"),var2:$(this).data("homepage_ui_tracking_element_group")})});; !function(e){"use strict";function t(){var t=this;t.reads=[],t.writes=[],t.raf=a.bind(e),u("initialized",t)}function n(e){e.scheduled||(e.scheduled=!0,e.raf(i.bind(null,e)),u("flush scheduled"))}function i(e){u("flush");var t,i=e.writes,s=e.reads;try{u("flushing reads",s.length),r(s),u("flushing writes",i.length),r(i)}catch(o){t=o}if(e.scheduled=!1,(s.length||i.length)&&n(e),t){if(u("task errored",t.message),!e["catch"])throw t;e["catch"](t)}}function r(e){u("run tasks");for(var t;t=e.shift();)t()}function s(e,t){var n=e.indexOf(t);return!!~n&&!!e.splice(n,1)}function o(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}var u=0?console.log.bind(console,"[fastdom]"):function(){},a=e.requestAnimationFrame||e.webkitRequestAnimationFrame||e.mozRequestAnimationFrame||e.msRequestAnimationFrame||function(e){return setTimeout(e,16)};t.prototype={constructor:t,measure:function(e,t){u("measure");var i=t?e.bind(t):e;return this.reads.push(i),n(this),i},mutate:function(e,t){u("mutate");var i=t?e.bind(t):e;return this.writes.push(i),n(this),i},clear:function(e){return u("clear",e),s(this.reads,e)||s(this.writes,e)},extend:function(e){if(u("extend",e),"object"!=typeof e)throw new Error("expected object");var t=Object.create(this);return o(t,e),t.fastdom=this,t.initialize&&t.initialize(),t},"catch":null};var c=e.fastdom=e.fastdom||new t;"function"==typeof define?define(function(){return c}):"object"==typeof module&&(module.exports=c)}("undefined"!=typeof window?window:this);; window.AllWebJumboTrack={tracking_elements:{},JumboEventType:{CLICK_EVENT:0,IMPRESSION_EVENT:1},init:function(){$(document).on("DOMContentLoaded scroll resize",AllWebJumboTrack.track_impression),$(document).on("click",".all_web_jumbo_click_track",AllWebJumboTrack.track_click)},is_element_visible:function(e,t){if(!e||1!==e.nodeType)return!1;var o=e.getBoundingClientRect(),a=document.documentElement;return vWidth=window.innerWidth||a.clientWidth,vHeight=window.innerHeight||a.clientHeight,o.top+o.height>=0&&o.left+o.width>=0&&o.bottom-o.height<=vHeight+t&&o.right-o.width<=vWidth+t},track_impression:function(){$.each($(".all_web_jumbo_impr_track"),function(e,t){"undefined"!=typeof t.jumbo_is_visible&&t.jumbo_is_visible!==!1||(t.jumbo_is_visible=!1,fastdom.measure(function(){this.jumbo_is_visible=AllWebJumboTrack.is_element_visible(this,0),this.jumbo_is_visible&&($(this).removeClass("all_web_jumbo_impr_track"),AllWebJumboTrack.send_jumbo_event(this,AllWebJumboTrack.JumboEventType.IMPRESSION_EVENT))},t))})},track_click:function(){AllWebJumboTrack.send_jumbo_event(this,AllWebJumboTrack.JumboEventType.CLICK_EVENT)},send_jumbo_event:function(e,t){t==AllWebJumboTrack.JumboEventType.IMPRESSION_EVENT?total_jumbo_payload=e.getAttribute("data-total_jumbo_impr_payload"):t==AllWebJumboTrack.JumboEventType.CLICK_EVENT&&(total_jumbo_payload=e.getAttribute("data-total_jumbo_click_payload")),"undefined"!==total_jumbo_payload&&null!==total_jumbo_payload?(_jumbo_objs=JSON.parse(total_jumbo_payload),$.each(_jumbo_objs,function(e,t){table=t.table,payload=t.payload,"undefined"!=typeof table&&sendToJumbo(table,payload)})):(table=$(e).data("jumbo_table").toString(),payload={},t===AllWebJumboTrack.JumboEventType.IMPRESSION_EVENT?payload.ename=$(e).data("impr_ename").toString():t===AllWebJumboTrack.JumboEventType.CLICK_EVENT&&(payload.ename=$(e).data("click_ename").toString()),$.each(["var1","var2","var3","var4","var5","var6"],function(t,o){"undefined"!=typeof $(e).data(o)&&(payload[o]=$(e).data(o).toString())}),"undefined"!=typeof table&&sendToJumbo(table,payload))}},$(document).on("zreadyPageScripts",function(){AllWebJumboTrack.init()});; !function(t){"undefined"!=typeof $&&(t._loadedScripts++,!1&&window&&window.zomato&&window.zomato.csrft&&$.ajaxSetup({headers:{"X-ZOMATO-CSRFT":t.csrft},xhrFields:{withCredentials:!0},crossDomain:!0}),$(document).trigger("zready").off("zready"),"undefined"!=typeof t._totalScripts&&t._totalScripts==t._loadedScripts&&$(document).trigger("zreadyPageScripts"))}(zomato);