1var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{ 2let window = _____WB$wombat$assign$function_____("window"); 3let self = _____WB$wombat$assign$function_____("self"); 4let document = _____WB$wombat$assign$function_____("document"); 5let location = _____WB$wombat$assign$function_____("location"); 6let top = _____WB$wombat$assign$function_____("top"); 7let parent = _____WB$wombat$assign$function_____("parent"); 8let frames = _____WB$wombat$assign$function_____("frames"); 9let opens = _____WB$wombat$assign$function_____("opens"); 10function isReachedTotalVisits(expectedVisits) { 11 const userVisitsCookie = getCookie('dm_total_visits'); 12 let userVisits = parseInt(userVisitsCookie); 13 if (!userVisitsCookie) { 14 // if cookie hasn't been set, yet it will be null 15 const lastView = getCookie('dm_this_page_view'); // data & time of last visit in site 16 const now = new Date(); 17 if (now.getTime() - lastView > window.visitLength) { 18 userVisits++; // this counts as a new visit 19 } 20 } 21 return userVisits === expectedVisits; 22} 23 24function shouldShowRuleObjectForUserVisit(ruleObjName, settings, actionType) { 25 const expectedTotalVisits = parseInt(settings.user_visits_number); 26 27 if (expectedTotalVisits) { 28 const cookieName = getSmartRuleCookieName(ruleObjName, actionType); 29 return ( 30 isReachedTotalVisits(expectedTotalVisits) && // all the times after the first one you go to the site after the condition was applied 31 // but the configured period of time didn't meet, the action shouldn't be applied 32 getCookie(cookieName) === null && 33 // there is no cookie of the same action type - site visitor already saw this action 34 !hasCookieOfType(actionType) 35 ); 36 } 37 38 //if there is no user_visits_number in settings it means 39 // that the condition is not user_visits, and we need to disregard this conditions 40 return true; 41} 42 43}
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.