PageSourceSearch

https://stylecaster.com/_static/??/wp-content/plugins/pmc-plugins/…/assets/js/main.js?m=1790864342j

js stylecaster.com collected 2026-10-02 02:24:24 UTC 64,953 bytes, 695 lines download raw bytes

1(()=>{"use strict";var e={251(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(i(291)),a=n(i(124)),r=i(418),l=window,d=l.document,s=function(){function e(t){var i=this;this.adq=this.adq||[],this.firstAdRenderedPromise=new Promise(function(e){if((0,r.isConcertAd)())document.body.addEventListener("first_ad_rendered",function(){return e()},{once:!0});else{var t=(0,o.default)();t.adq.push(function(){t.addEventListener("anchorSlotRendered",function(){return e()}),i.adEngine=t,i.adq.push=function(e){return t.adq.push(e)},i.adq.forEach(function(e){return t.adq.push(e)})})}}),Object.keys(t).forEach(function(n){/^\d+$/.test(n)||n in e.prototype||(i[n]=t[n])}),t.forEach(function(e){return i.push(e)})}return e.prototype.push=function(e){try{e.call(null)}catch(e){}},e.prototype.attachConnatix=function(e){if(d.documentElement.classList.contains("floatingplayer-nofloat"))e.disableFloatingMode();else{l.addEventListener("message",function(t){"pmcadm:floatingplayer=nofloat"===t.data&&e.disableFloatingMode()},!1);var t=(0,o.default)();t.adq.push(function(){t.trackVideoPlayerFloatingState&&t.trackVideoPlayerFloatingState(e)})}},e.prototype.sendAtlasMessage=function(e,t){a.default.send(l,e,t)},e.prototype.waitForFirstAdRendered=function(){return this.firstAdRenderedPromise},e.prototype.registerAd=function(e,t){var i;if((0,r.isAtlas)()){var n=(0,o.default)();n.adq.push(function(){var i=n.defineSlot(e.displayType,e.divId);"string"==typeof e.zone&&""!==e.zone&&i.setSubAdUnitPath(e.zone);var o=e.targeting;o&&"object"==typeof o&&Object.keys(o).forEach(function(e){var t=o[e];(null==t?void 0:t.key)&&(null==t?void 0:t.value)&&i.addTargeting(t.key,t.value)}),"string"==typeof e.lazyLoad&&"yes"===e.lazyLoad&&i.setLazyLoadMultiplier(e.lazyLoadMultiplier||2),Array.isArray(e.sizes)&&i.addSize(e.sizes),i.blockDisplay(t,!0),i.display()})}else if((0,r.isConcertAd)()){var a={divid:e.divId,st:e.displayType},l=e.targeting;l&&"object"==typeof l&&Object.keys(l).forEach(function(e){var t=l[e];(null==t?void 0:t.key)&&(null==t?void 0:t.value)&&(a[t.key]=t.value)});var d={name:null!==(i=e.zone)&&void 0!==i?i:"",id:e.divId,targeting:a};Array.isArray(e.sizes)&&(d.sizes=e.sizes),this.adq.push(function(e){e.registerSlot(d)})}},e.prototype.reloadAds=function(){var e,t;return!!(null===(t=null===(e=this.adEngine)||void 0===e?void 0:e.reloadAds)||void 0===t?void 0:t.call(e))},e.prototype.setPageMetaData=function(e){if((0,r.isConcertAd)())this.adq.push(function(t){var i;null===(i=null==t?void 0:t.setPageMetaData)||void 0===i||i.call(t,e)});else{var t=(0,o.default)();t.adq.push(function(){var i;null===(i=t.setPageMetaData)||void 0===i||i.call(t,e)})}},e.prototype.pauseAutoRefresh=function(){var e,t;if((0,r.isConcertAd)())this.adq.push(function(e){var t;null===(t=null==e?void 0:e.pauseAutoRefresh)||void 0===t||t.call(e)});else{var i=(0,o.default)();null===(e=i.getSlots)||void 0===e||e.call(i).forEach(function(e){return e.setAutoRefreshTime(0)}),null===(t=i.pauseAutoRefresh)||void 0===t||t.call(i)}},e}();t.default=s},886(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(i(291)),a=n(i(60)),r=i(418),l=window,d={init:function(){var e=(0,o.default)();void 0!==e&&((0,r.isConcertAd)()?(0,a.default)().adm.adq.push(function(){}):e.adq.push(function(){var t,i,n,o,a,r,d,s,u,p;if((!(null===(t=l.pmcadm_options)||void 0===t?void 0:t.suppress_option)||Array.isArray(null===(i=l.pmcadm_options)||void 0===i?void 0:i.suppress_option)||(e.disableAds("PMC Ads Suppression",l.pmcadm_options.suppress_option),!(null===(o=null===(n=l.pmcadm_options)||void 0===n?void 0:n.suppress_option)||void 0===o?void 0:o.all)))&&((null===(r=null===(a=l.pmcadm_options)||void 0===a?void 0:a.preview_suppression)||void 0===r?void 0:r.is_preview)&&(null===(s=null===(d=l.pmcadm_options)||void 0===d?void 0:d.preview_suppression)||void 0===s?void 0:s.disable_amazon_ads)&&(e.disableService("amazon"),e.disableService("amazon_video")),null===(p=null===(u=l.pmcadm_options)||void 0===u?void 0:u.suppress_entries)||void 0===p?void 0:p.query_string))for(var c=0,f=l.pmcadm_options.suppress_entries.query_string;c<f.length;c++){var _=f[c];if(!_.entry||!_.suppress_option)return;for(var v=0,y=_.entry.filter(function(e){return e});v<y.length;v++){var m=y[v];if((window.location.search&&window.location.search.includes(m)||window.location.hash&&window.location.hash.includes(m))&&(e.disableAds("PMC Ads Suppression - Query String",_.suppress_option),_.suppress_option.all))return}}}))}};t.default=d},835(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esMo
1dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(i(291)),a=window,r=(0,o.default)(),l=function(){r.adq.push(function(){var e;null===(e=r.hideAdhesion)||void 0===e||e.call(r)})},d=function(){r.adq.push(function(){var e;null===(e=r.showAdhesion)||void 0===e||e.call(r)})},s={init:function(){void 0!==r&&(a.document.addEventListener("pmc:bytes:expanded",l),a.document.addEventListener("pmc:bytes:collapsed",d),a.pmcBytesExpanded&&l())}};t.default=s},261(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=new(function(){function e(){this.player_main_div=".pmc-contextual-player",this.message_pattern="pmcadm:dfp:isdirect=true",this.pause_triggered=!1}return e.prototype.init=function(){this.bind_events()},e.prototype.bind_events=function(){var e=this;e.pause_triggered=!1,jQuery(window).on("message",function(t){var i,n,o=t.originalEvent;if("string"==typeof o.data)if(o.data.substring(0,e.message_pattern.length)===e.message_pattern)"object"==typeof window.pmcadm_options&&"string"==typeof(null===(i=window.pmcadm_options.contextual)||void 0===i?void 0:i.directSold)&&"show"===window.pmcadm_options.contextual.directSold||e.remove_contextual_player();else if("pmc_show_interrupt_ads"===o.data){if(window.contextual_player)try{if("playing"!==window.contextual_player.getState()){var a=window.contextual_player.getConfig();"viewable"===a.autostart&&a.viewable&&(e.pause_triggered=!0)}else e.pause_triggered=!0;e.pause_triggered&&window.contextual_player.pause()}catch(e){}}else"pmc_hide_interrupt_ads"===o.data&&e.pause_triggered&&(null===(n=window.contextual_player)||void 0===n||n.play(),e.pause_triggered=!1)}),"object"==typeof window.contextual_player&&(window.contextual_player.on("play",e.current_playing),window.contextual_player.on("adPlay",e.current_playing),window.contextual_player.on("relatedReady",function(){var t=window.contextual_player.getPlugin("related");"object"==typeof t&&t.on("feedShown",function(){e.create_playlist_nav(),jQuery(".pmc-contextual-player .jw-related-control").on("click",e.current_playing)})}),window.contextual_player.on("ready",function(){var t=window.contextual_player.getPlugin("related");"object"==typeof t&&t.on("feedShown",function(){e.create_playlist_nav(),jQuery(".pmc-contextual-player .jw-related-control").on("click",e.current_playing)})}))},e.prototype.remove_contextual_player=function(){var e=jQuery(this.player_main_div);0<e.length&&e.remove()},e.prototype.current_playing=function(){var e,t=null===(e=window.contextual_player)||void 0===e?void 0:e.getPlaylistIndex();jQuery(".pmc-contextual-player .jw-related-shelf-item.is-active").removeClass("is-active");var i=jQuery(".pmc-contextual-player .jw-related-shelf-item[data-jw-index="+t+"]"),n=jQuery('<div class="contextual-self-now-playing">VIEWING</div>');"object"==typeof i&&1===i.length&&i.addClass("is-active"),0===jQuery(".jw-related-shelf-item[data-jw-index="+t+"] .contextual-self-now-playing").length&&i.find(".jw-related-shelf-item-image").append(n)},e.prototype.create_playlist_nav=function(){if(0===jQuery(".pmc-contextual-player .l-adm-contextual-video__shadow").length){var e=jQuery('<div class="l-adm-contextual-video__shadow l-adm-contextual-video__shadow-left"></div>'),t=jQuery('<div class="l-adm-contextual-video__shadow l-adm-contextual-video__shadow-right"></div>');jQuery(".pmc-contextual-player .jw-related-control-left").prepend(e),jQuery(".pmc-contextual-player .jw-related-control-right").prepend(t)}},e}());t.default=i},225(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.renderIframePlayer=function(){var e=i.pmcadm_options.scheduled_ads.floating_video_preroll_ad,t=e.iframe_player_src,l=e.iframe_player_title;r(".harmony-preroll-floating-player"),i.pmcadm_floating_preroll_data={};var d=o("div","floating-preroll-ad cbs-et-floating-player-container live-stream"),s=a(l);d.appendChild(s);var u=o("div"),p=o("iframe","cbs-et-floating-player-iframe");p.title="cbs-et-iframe-player",p.src=t,p.allowFullscreen=!0,u.appendChild(p),d.appendChild(u),n.body.appendChild(d)},t.renderJwplayer=function(){var e,t,n=null===(t=null===(e=i.pmcadm_options)||void 0===e?void 0:e.sc
1heduled_ads)||void 0===t?void 0:t.floating_video_preroll_ad;r(".harmony-preroll-floating-player");var l=o("div","floating-preroll-ad live-stream harmony-preroll-floating-player"),d=o("div","floating-preroll-ad-container"),s=a("");d.appendChild(s);var u=o("div");u.id="jwplayer_floating_preroll_ad",d.appendChild(u),l.appendChild(d),document.body.appendChild(l),Object.assign(i.pmcadm_floating_preroll_data,{player_name:null==n?void 0:n.floating_player_name,channel_id:null==n?void 0:n.floating_player_channel_id,player_id:null==n?void 0:n.floating_player_id,media_id:null==n?void 0:n.floating_player_media_id,playlist_id:null==n?void 0:n.floating_player_playlist_id})};var i=window,n=i.document;function o(e,t,i){void 0===t&&(t=""),void 0===i&&(i="");var o=n.createElement(e);return o.className=t,i&&(o.textContent=i),o}function a(e){var t=o("div","floating-preroll-ad-header live"),n=o("div","floating-preroll-ad-live-tag","Live"),a=o("div","floating-preroll-ad-title",e),r=o("button","floating-preroll-ad-close");r.textContent="×";var l=o("span","visually-hidden","Close Player");return r.appendChild(l),"object"==typeof i.pmc_harmony_event_data&&"true"===i.pmc_harmony_event_data.is_live_campaign&&t.appendChild(n),t.appendChild(a),t.appendChild(r),t}function r(e){n.querySelectorAll(e).forEach(function(e){e.remove()})}},291(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=window;i.blogherads=i.blogherads||{adq:[]},t.default=function(){return i.blogherads}},124(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i,n=(i=1,{send:function(e,t,n){var o={type:"SKMBoomerangMessageRequest",requestId:i++,data:n,method:t};e.postMessage(o,"*")}});t.default=n},788(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){if(!(0,a.isAtlas)()){var e=(0,o.default)();["addEventListener","addTargeting","attachFloatAndScrollPlayer","blankAdServed","detachFloatAndScrollPlayer","disableAds","disableAllRefresh","disableAutoRefresh","disableAutoSlot","disableClsOptimization","disableService","enableService","excludeCreative","floatingPlayerNoFloat","floatingPlayerNoFloatUnload","hideAdhesion","interscrollerLoaded","mobileAdhesion","monetizeConnatixPlayer","monetizeJWPlayer","pauseAutoRefresh","pauseSlotAutoRefresh","refreshSlot","registerSyncedAd","reloadAds","renderAd","renderPrebidAd","resumeAutoRefresh","resumeSlotAutoRefresh","setAutoRefreshTime","setFirstSlot","setSponsored","setTargeting","showAdhesion","suppressExperience"].forEach(function(t){e[t]=l.bind(null,t)})}};var o=n(i(291)),a=i(418),r=window;function l(e){try{var t=r.pmcAdBridge;if(t&&t[e])return t[e].apply(t,[].slice.call(arguments,1))}catch(e){}}},567(e,t,i){var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(o,a){function r(e){try{d(n.next(e))}catch(e){a(e)}}function l(e){try{d(n.throw(e))}catch(e){a(e)}}function d(e){var t;e.done?o(e.value):(t=e.value,t instanceof i?t:new i(function(e){e(t)})).then(r,l)}d((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var i,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},r=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return r.next=l(0),r.throw=l(1),r.return=l(2),"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function l(l){return function(d){return function(l){if(i)throw new TypeError("Generator is already executing.");for(;r&&(r=0,l[0]&&(a=0)),a;)try{if(i=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],n=0}finally{i=o=0}
1if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,d])}}},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var r=i(418),l=a(i(291)),d=a(i(60)),s=window,u=s.document,p=function(){function e(){this.settings={interrupts_hide_container:"#container",redirect_interval:0,interrupt_counter:s.pmc_intertitial_ad_timer||0}}return e.prototype.show_interrupt_ads=function(){return n(this,void 0,void 0,function(){var e,t,i,n,a,p,c,f,_,v,y,m,h,g,w;return o(this,function(o){switch(o.label){case 0:if(void 0!==navigator.userAgent&&/googlebot|googlebot-news/i.test(navigator.userAgent))return[2];if(e=u.referrer,t=this,i=null,void 0!==e&&""!==e&&(n=e.match(/:\/\/(.[^/]+)/),"flipboard.com"===(null!==(f=null==n?void 0:n[1])&&void 0!==f?f:"")))return[2];if((0,r.isAdBlocked)())return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,null===(v=null===(_=s.pmc_onetrust)||void 0===_?void 0:_.ready)||void 0===v?void 0:v.call(_)];case 2:case 3:return o.sent(),[3,4];case 4:if(null===(y=s.pmc_onetrust_helpers)||void 0===y?void 0:y.otBannerDisplayed)return this.setGlobalTargeting("overlay","y"),this.hide_interrupt_ads(),[2];if(!t.apply_filters("pmc-adm-show-interrupt-ads",!0))return[2];if(t.settings.interrupt_counter=s.pmc_intertitial_ad_timer||0,this.settings.redirect_interval&&clearInterval(this.settings.redirect_interval),a=(0,l.default)(),p=null===(m=a.getSlotById)||void 0===m?void 0:m.call(a,(0,r.getInterruptAdId)()),c=(0,d.default)(),null!=(i=null===(h=c.cookie)||void 0===h?void 0:h.get(c.pmc_adm_interstitial_ck))&&""!==i||"object"!=typeof p)this.hide_interrupt_ads();else{this.setGlobalTargeting("overlay","y"),null===(g=c.cookie)||void 0===g||g.set(c.pmc_adm_interstitial_ck,1,c.pmc_adm_interstitial_interval,"/","strictly-necessary"),t.settings.redirect_interval=setInterval(function(){t.interrupt_timer()},1e3),u.body.classList.add("interrupt-ads"),(0,r.showElement)("pmc-adm-interrupts-container");try{s.postMessage("pmc_show_interrupt_ads","*"),null===(w=c.hooks)||void 0===w||w.do_action("show_interrupt_ads")}catch(e){}p.display(),t.interrupt_timer()}return[2]}})})},e.prototype.hide_interrupt_ads=function(){var e,t,i=(0,l.default)();clearInterval(this.settings.redirect_interval),this.settings.redirect_interval=0,u.body.classList.remove("interrupt-ads"),s.dispatchEvent(new Event("resize")),(0,r.hideElement)("pmc-adm-interrupts-container");var n=(0,r.getInterruptAdId)(),o=new CustomEvent("pmc-hide-interrupt-ads",{detail:"Fires when the interrupt ads are done."});u.dispatchEvent(o),null===(e=i.getSlots)||void 0===e||e.call(i).forEach(function(e){var t;n!==e.domId?e.display():null===(t=i.destroySlots)||void 0===t||t.call(i,[e.domId])});try{s.postMessage("pmc_hide_interrupt_ads","*"),null===(t=(0,d.default)().hooks)||void 0===t||t.do_action("hide_interrupt_ads")}catch(e){}},e.prototype.hide_interrupt=function(){this.hide_interrupt_ads()},e.prototype.interrupt_timer=function(){if(0===this.settings.interrupt_counter)this.hide_interrupt_ads();else{this.settings.redirect_interval&&this.settings.interrupt_counter--;var e=u.getElementById("pmc_ads_interrupts_timer");e&&(e.innerHTML=String(this.settings.interrupt_counter))}},e.prototype.apply_filters=function(e,t,i){var n,o=(0,d.default)();return(null===(n=o.hooks)||void 0===n?void 0:n.apply_filters)?o.hooks.apply_filters(e,t,i):t},e.prototype.setGlobalTargeting=function(e,t){var i=(0,l.default)();i.adq.push(function(){var n;null===(n=i.setTargeting)||void 0===n||n.call(i,e,t)})},e}();t.default=p},862(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(i(291)),a=i(418),r=window,l=document,d=function(){function e(){}return e.prototype.init=function(){r.addEventListener("message",function(e){var t,i=e.data,n=i.message,r=i.iframeId,d=(0,o.default)();if("pmcadm:disableCls=true"===n){var s=l.getElementById(r),u=(0,a.findSlotIdByIframe)(s);if("string"==typeof u){var p=null===(t=l.getElementById(u))||void 0===t?void 0:t.parentNode;p instanceof HTMLElement&&(p.style.setProperty("min-width",""),p.style.setProperty("min-height",""))}(0,a.isAtlasLoaded)()&&(null==d?void 0:d.disableClsOptimization)&&d.disableClsOptimization(s)}},!1)},e}();t.default=d}
1,201(e,t,i){Object.defineProperty(t,"__esModule",{value:!0});var n=i(225),o=i(418),a=window,r=a.document,l=function(){function e(){(0,o.logDebug)("pmcHarmony instance created.")}return e.prototype.init=function(){this.init_DOM()},e.prototype.init_DOM=function(){var e,t,i=r.querySelector(null!==(t=null===(e=a.pmc_harmony_player_settings)||void 0===e?void 0:e.target_container)&&void 0!==t?t:"body"),n=r.querySelector(".live-stream");if(n&&i){i.prepend(n),"object"==typeof a.pmc_meta&&"mobile"!==a.pmc_meta.env||(null!==r.querySelector(".floating-preroll-ad-container")?a.addEventListener("scroll",function(){var e,t=r.querySelector(".jw-float-bar.jw-reset");t&&t.remove();var i=r.querySelector(".live-stream"),n=r.querySelector(".live-stream .floating-preroll-ad-container");r.body.scrollTop>150||r.documentElement.scrollTop>150?(null==i||i.classList.add("harmony-floating-player"),n&&(n.style.top=(null===(e=a.pmc_harmony_player_settings)||void 0===e?void 0:e.top_offset)||"50px")):(null==i||i.classList.remove("harmony-floating-player"),n&&(n.style.top="0px"))}):null!==r.querySelector(".cbs-et-floating-player-container")&&a.addEventListener("scroll",function(){var e,t,i,n=r.querySelector(".csb-et-sticky-placeholder"),o=r.querySelector(".cbs-et-floating-player-container");if(n||o||((n=r.createElement("div")).classList.add("csb-et-sticky-placeholder"),o.parentNode.insertBefore(n,o)),a.scrollY>=300||r.documentElement.scrollTop>=300)null===(e=r.querySelector(".live-stream"))||void 0===e||e.classList.add("harmony-floating-player"),(l=r.querySelector(".cbs-et-floating-player-container.live-stream"))&&(l.style.top=(null===(t=a.pmc_harmony_player_settings)||void 0===t?void 0:t.top_offset)||"50px");else if(a.scrollY<=10||r.documentElement.scrollTop<=10){var l;null===(i=r.querySelector(".live-stream"))||void 0===i||i.classList.remove("harmony-floating-player"),(l=r.querySelector(".cbs-et-floating-player-container.live-stream"))&&(l.style.top="0px")}}));var o=r.querySelector(".live-stream .floating-preroll-ad-close");o&&o.addEventListener("click",function(){var e=r.querySelector(".live-stream");e&&e.remove()})}},e.prototype.isEventAdScheduledTime=function(){var e,t,i=null===(t=null===(e=a.pmcadm_options)||void 0===e?void 0:e.scheduled_ads)||void 0===t?void 0:t.floating_video_preroll_ad;if("object"==typeof i&&"number"==typeof i.start_timestamp&&"number"==typeof i.end_timestamp){var n=i.start_timestamp,o=i.end_timestamp,r=Math.floor(Date.now()/1e3);if(r>n&&o>r||window.location.hash.includes("debug-harmony"))return!0}return!1},e.prototype.switchToHarmonyPlayer=function(){var e,t,i;if("object"==typeof a.pmc_harmony_event_data){var o=Number.parseInt(a.pmc_harmony_event_data.start_time),r=Number.parseInt(a.pmc_harmony_event_data.end_time),l=Math.floor(Date.now()/1e3);if(l>o&&"off"!==a.pmc_harmony_event_data.is_enabled&&l<r||window.location.hash.includes("debug-harmony")){var d=null===(i=null===(t=null===(e=a.pmcadm_options)||void 0===e?void 0:e.scheduled_ads)||void 0===t?void 0:t.floating_video_preroll_ad)||void 0===i?void 0:i.floating_player_name;"iframe-player"===d?(0,n.renderIframePlayer)():"jwplayer"===d&&(0,n.renderJwplayer)()}}},e}();t.default=l},60(e,t){Object.defineProperty(t,"__esModule",{value:!0});var i=window;i.pmc=i.pmc||{adm:[]},i.pmc.adm=i.pmc.adm||[],t.default=function(){return i.pmc}},558(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(i(60)),a=function(){function e(){this.properties={dfpCreativeMarkup:void 0,dfpCreativeParameters:void 0,viewUrlTracked:!1}}return e.prototype.init=function(){this.init_DOM(),this.bind_GUI_events()},e.prototype.init_DOM=function(){this.dom={adSection:jQuery("#skin-ad-section"),leftRailContainer:jQuery("#skin-ad-left-rail-container"),rightRailContainer:jQuery("#skin-ad-right-rail-container")}},e.prototype.bind_GUI_events=function(){var e=this;jQuery(window).on("message",function(t){var i=t.originalEvent;if("string"==typeof i.data){if("pmcadm:dfp:skinad:markup"===i.data.substring(0,24))e.properties.dfpCreativeMarkup=i.data.substring(24)||"\x3c!-- NOOP --\x3e",e.run();else if("pmcadm:dfp:skinad:parameters"===i.data.substring(0,28)){var n=i.data.substring(28);e.properties.dfpCreativeParameters=jQuery.parseJSON(n),e.run()}}}),jQuery(window).on("resize",function(){e.refresh_skin_rails()}),jQuery(document).ready(function(){e.refresh_skin_rails()}),jQuery("body").on("prestitial-ad:stopped",function(){e.refresh_skin_rails()}),e.dom.leftRailContainer.on("click",function(){e.skin_clicked_EventHandler()}),e.dom.rightRailContainer.on("click",function(){e.skin_clicked_EventHandler()})},e.prototype.skin_clicked_EventHandler=function(){window.open(this.properties.dfpCreativeParameters.clickThroughURL,"_blank")},e.prototype.refresh_skin_rails=function(){var e,t,i=this;if(i.properties.dfpCreativeParameters){var n=null===(t=null===(e=window.pmcadm_options)||void 0===e?void 0:e.pmcSkin)||void 0===t?void 0:t.newBreakpoints;if(n&&window.innerWidth<1420)i.dom.adSection.addClass("hide");else{i.dom.adSection.removeClass("hide");var o,a=i.properties.dfpCreativeParameters.creative.image,r=i.compute_old_and_new_break_obj(a),l=r.oldBreakObj,d=r.newBreakObj,s=(o=function(e){return!e||!e.left||!e.right},n?o(d)?l:d:o(l)?d:l),u=i.properties.viewUrlTracked?s.left:i.properties.dfpCreativeParameters.viewURLPrefix+s.left,p=i.properties.dfpCreativeParameters.bodyBackgroun
1dColor&&jQuery.trim(i.properties.dfpCreativeParameters.bodyBackgroundColor)||null;jQuery("body").css("background-color",p),i.properties.viewUrlTracked=!0,i.dom.leftRailContainer.css("background-image",'url("'+u+'")'),i.dom.rightRailContainer.css("background-image",'url("'+s.right+'")');var c=s.right;jQuery('<img src="'+c+'" alt="" />').on("load",function(){var e,t=this.width,n=i.get_content_DOM();i.dom.leftRailContainer.width(t).offset({left:n.offset().left-t}),i.dom.rightRailContainer.width(t).offset({left:n.offset().left+(null!==(e=n.outerWidth())&&void 0!==e?e:0)})})}}},e.prototype.compute_old_and_new_break_obj=function(e){var t={LARGE:1900,MEDIUM:1350,SMALL:1260},i=this.compute_rail_size(t),n=this.compute_rail_size({LARGE:1900,MEDIUM:1420,SMALL:1340});return{oldBreakObj:e[t[i]],newBreakObj:e[n.toLowerCase()]}},e.prototype.compute_rail_size=function(e){var t,i=null!==(t=jQuery(window).width())&&void 0!==t?t:0;return i<e.MEDIUM?"SMALL":i<e.LARGE&&i>=e.MEDIUM?"MEDIUM":"LARGE"},e.prototype.get_content_DOM=function(){var e=["main-wrapper"],t=document.querySelector("#skin-ad-section");void 0!==t&&void 0!==t.dataset.contentContainer&&(e=t.dataset.contentContainer.split(",")),e=this.apply_filters("pmc-adm-dfp-skin-main-content",e);for(var i=0;i<e.length;i++){var n=jQuery("#"+e[i]);if(n&&n.width())return n}return jQuery("body")},e.prototype.get_available_rail_width=function(e){var t;return e||(e=jQuery("body")),((window.innerWidth?window.innerWidth:0!==document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth)-(null!==(t=e.outerWidth())&&void 0!==t?t:0))/2},e.prototype.run=function(){var e=this;e.properties.dfpCreativeMarkup&&e.properties.dfpCreativeParameters&&(e.dom.adSection.removeClass("hide"),e.dom.adSection.append(e.properties.dfpCreativeMarkup),e.refresh_skin_rails())},e.prototype.apply_filters=function(e,t,i){var n,a=(0,o.default)();return(null===(n=a.hooks)||void 0===n?void 0:n.apply_filters)?a.hooks.apply_filters(e,t,i):t},e}();t.default=a},772(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(i(60)),a=window,r=function(){return a.pmcadm_floating_preroll_data||{}},l=function(){return a.pmcFloatingVideoOptions||{}},d=function(e){var t=(0,o.default)();t.adm.push(function(){t.adm.sendAtlasMessage("FloatingVideoStateChange",e)})},s=function(){function e(){this.player_instance={},this.pmc_floating_ad_main_div=".floating-preroll-ad",this.pmc_floating_ad_docked_div="footer.footer",this.is_floating_ad_showed=!1,this.time_gap=0,this.cookie="",this.interval_id="",this.direct_slold=!1}return e.prototype.init=function(){var e,t,i,n,l,d,s,u=this,p=(0,o.default)(),c=r();if(void 0!==c&&c&&void 0!==c.time_gap&&void 0!==p&&(u.cookie=c.cookie_name,""!==u.cookie&&u.cookie)){var f=null===(e=p.cookie)||void 0===e?void 0:e.get(u.cookie);null==f||""===f||0===Number.parseInt(c.time_gap)?(document.body.classList.contains("interrupt-ads")?u.interval_id=setInterval(function(){var e;0===(null===(e=a.pmc_admanager)||void 0===e?void 0:e.settings.redirect_interval)&&u.show_floating_preroll_ad()},1e3):u.show_floating_preroll_ad(),null===(i=null===(t=p.hooks)||void 0===t?void 0:t.add_action)||void 0===i||i.call(t,"pmc_adm_dfp_direct_sold",function(){u.direct_slold=!0,u.remove_floating_player()}),a.addEventListener("message",function(e){"pmcadm:floatingplayer=nofloat"===e.data&&jQuery(u.pmc_floating_ad_main_div).hide()},!1),null===(l=null===(n=a.blogherads)||void 0===n?void 0:n.addEventListener)||void 0===l||l.call(n,"noFloat",function(){jQuery(u.pmc_floating_ad_main_div).hide()}),null===(s=null===(d=a.blogherads)||void 0===d?void 0:d.addEventListener)||void 0===s||s.call(d,"noFloatUnload",function(e){void 0!==e.noFloatCount&&e.noFloatCount<=0&&jQuery(u.pmc_floating_ad_main_div).show()})):u.remove_floating_player()}},e.prototype.apply_title=function(e){if("string"==typeof e&&""!==e){var t=jQuery(".floating-preroll-ad-title");t.empty();var i=jQuery("<span>").text(e);t.append(i)}},e.prototype.apply_connatix_video_title=function(){var e=this;jQuery("#connatix_floating_preroll_ad_div").on("cnxReady",function(t){if(t.detail&&t.detail.playerInstance){var i=t.detail.playerInstance.getVideoDetails();i&&i.title&&e.apply_title(i.title)}})},e.prototype.show_floating_preroll_ad=function(){var e;if(!window.pmc||!window.pmc.no_ads){var t=this,i=r(),n="connatix"===i.player_name,a=i.media_id,d=i.playlist_id,s=!1;if(d?s="https://cdn.jwplayer.com/v2/playlists/"+d:a&&(s="https://cdn.jwplayer.com/v2/media/"+a),s||n){var u=(0,o.default)(),p=400,c=225,f=i.backup_channel_id,_=i.channel_id,v=jQuery("[id ^=jwplayer_][id $=_div]"),y=i.player_id,m=jQuery(".l-pvm-video [id ^=jwplayer_][id $=_div]"),h=i.time_gap;if(""!==h&&(t.timegap=h),clearInterval(t.interval_id),1200>(null!==(e=jQuery(window).width())&&void 0!==e?e:0)&&(c=190,p=300,jQuery(".floating-preroll-ad-container").css("width","314px"),jQuery(".floating-preroll-ad-container").css("height","204px")),n&&jQuery("#connatix_floating_preroll_ad").children().length>0)this.apply_connatix_video_title(),this.show_floating_player(),jQuery(document).on("click",".floating-preroll-ad-close",function(){t.remove_floating_player()});else if(n||0!==v.length-m.length||"function"!=typeof window.pmc_jwplayer)jQuery(this.pmc_floating_ad_main_div).remove();else{var g={backupChannelId:f,channelId:_,playlist:s,autostart:!0,mute:!0,floating:!0,height:c,width:p};window.pmc_jwplayer("jwplayer_floating_preroll_ad",y).setup(g).whenReady(function(e){t.player_instance=e,!0===jQuery(t.pmc_floating_ad_main_div).hasClass("live-stream")&&t.show_floating_player(),t.player_instance.on("beforePlay",function(){var e;if(1===Number.parseInt(null!==(e=l().jwplayer_style_v2)&&void 0!==e?e:"")){var i=t.player_instance.getPlaylistItem().title;t.apply_title(i)}}),t.player_instance.on("firstFrame",function(){t.show_floating_player()}),t.player_instance.on("adImpression",function(){var e;null===(e=u.cookie)||void 0===e||e.set(t.cookie,1,t.time_gap,"/","functional"),t.is_floating_ad_showed=!0,t.show_floating_player()}),t.player_instance.on("adError",function(){var e;!0!==t.is_floating_ad_showed&&(1===Number.parseInt(null!==(e=l().preroll_not_required)&&void 0!==e?e:"")?t.show_floating_player():t.remove_floating_player())})}).whenNoFloat(function(){jQuery(t.pmc_floating_ad_main_div).length&&jQuery(t.pmc_floating_ad_docked_div).length&&!jQuery(".floating-preroll-ad-container").hasClass("no-float")&&!jQuery(t.pmc_floating_ad_main_div).hasClass("live-stream")&&(jQuery(t.pmc_floating_ad_main_div).insertBefore(jQuery(t.pmc_floating_ad_docked_div)),jQuery(".floating-preroll-ad-container").addClass("no-float"))}),jQuery(document).on("click",".floating-preroll-ad-close",function(){t.remove_floating_player()})}}}},e.prototype.show_floating_player=function(){!0!==this.is_floating_ad_showed&&(this.is_floating_ad_showed=!0,setTimeout(function(){jQuery(".floating-preroll-ad-close").show()},5e3),jQuery(this.pmc_floating_ad_main_div).show(),d("float"))},e.prototype.remove_floating_player=function(){"function"==typeof this.player_instance.remove&&this.player_instance.remove(),jQuery(this.pmc_floating_ad_main_div).remove(),!0===this.is_floating_ad_showed&&d("close"),this.is_floating_ad_showed=!1},e}();t.default=s},418(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esMo
1dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isAtlas=t.isConcertAd=t.findSlotIdByIframe=t.showElement=t.hideElement=t.setElementDisplay=t.isValidSlot=t.isAtlasLoaded=t.isAdBlocked=void 0,t.hasAdunitPath=function(e,t){return Boolean(e&&"object"==typeof e&&"string"==typeof e.subAdUnitPath&&e.subAdUnitPath.includes(t))},t.getInterruptAdId=function(){var e=document.querySelector("#pmc-adm-ad-interrupts div.pmc-adm-boomerang-pub-div div"),t="";return e&&(t=e.id),t},t.logDebug=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];console.debug.bind(null,e).apply(void 0,t)};var o=n(i(291)),a=window;t.isAdBlocked=function(){return!!a.pmc_is_adblocked},t.isAtlasLoaded=function(){return"function"==typeof(0,o.default)().reloadAds},t.isValidSlot=function(e){var t;return Boolean(null===(t=null==e?void 0:e.domId)||void 0===t?void 0:t.length)},t.setElementDisplay=function(e,t){var i=document.getElementById(e);(null==i?void 0:i.style)&&(i.style.display=t)},t.hideElement=function(e){return(0,t.setElementDisplay)(e,"none")},t.showElement=function(e){return(0,t.setElementDisplay)(e,"block")},t.findSlotIdByIframe=function(e){var t;if(!e||"object"!=typeof e||!e.contentWindow)return!1;for(var i=e.parentNode;i&&i!==document.body;){var n=(0,o.default)(),a=null===(t=n.getSlotById)||void 0===t?void 0:t.call(n,i.id);if(a)return a.domId;i=i.parentNode}return!1},t.isConcertAd=function(){var e,t;return null===(t=null===(e=a.pmcadm_options)||void 0===e?void 0:e.ads_platform_bootstrap)||void 0===t?void 0:t.includes("concert")},t.isAtlas=function(){return!(0,t.isConcertAd)()}},47(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),i(640),i(654),i(252);var o=n(i(251)),a=n(i(886)),r=n(i(291)),l=n(i(835)),d=n(i(261)),s=n(i(788)),u=n(i(567)),p=n(i(862)),c=n(i(201)),f=n(i(60)),_=n(i(558)),v=n(i(772)),y=i(418),m=window,h=(0,f.default)();if(Array.isArray(h.adm)){var g=h.adm;h.adm=new o.default(g)}m.pmc_admanager=new u.default,h.prerollPlayer=new v.default,h.harmony=new c.default,h.skinAds=new _.default,h.clsOptimization=new p.default,d.default.init(),l.default.init();var w=function(){a.default.init(),h.skinAds.init(),h.prerollPlayer.init(),h.harmony.init(),h.clsOptimization.init()};(0,y.isAtlas)()?(0,r.default)().adq.push(w):((0,s.default)(),h.adm.push(w))},640(e,t,i){i.r(t)},252(e,t,i){i.r(t)},654(e,t,i){i.r(t)}};const t={};function i(n){const o=t[n];if(void 0!==o)return o.exports;const a=t[n]={exports:{}};return e[n].call(a.exports,a,a.exports,i),a.exports}i.r=e=>{Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i(47)})();;
2// all coupons archive nav active
3/* eslint-disable */
4jQuery(document).ready(function ($) {
5    function wpcd_moreLessDescription(mLDElements) {
6        let num_words = Number(wpcd_main_js.word_count);
7
8        let full_description, more, less;
9        if(!mLDElements) {
10            full_description = $('.wpcd-full-description');
11            more = $('.wpcd-more-description');
12            less = $('.wpcd-less-description');
13        } else {
14            full_description = mLDElements.fullDescription;
15            more = mLDElements.more;
16            less = mLDElements.less;
17        }
18
19        full_description.each(function () {
20            $this = $(this);
21
22            var full_content = $this.html();
23            var check = full_content.split(' ').length > num_words;
24            if (check) {
25                var short_content = full_content.split(' ').slice(0, num_words).join(' ');
26                $this.siblings('.wpcd-short-description').html(short_content + '...');
27                $this.hide();
28                $this.siblings('.wpcd-less-description').hide();
29            } else {
30                $(this).siblings('.wpcd-more-description').hide();
31                $(this).siblings('.wpcd-more-description');
32                $(this).siblings('.wpcd-less-description').hide();
33                $(this).siblings('.wpcd-short-description').hide();
34            }
35        });
36        // more and less link
37        more.click(function (e) {
38            e.preventDefault();
39            $(this).siblings('.wpcd-full-description').show();
40            $(this).siblings('.wpcd-less-description').show();
41            $(this).siblings('.wpcd-short-description').hide();
42            $(this).hide();
43
44        });
45        less.click(function (e) {
46            e.preventDefault();
47            $(this).siblings('.wpcd-short-description').show();
48            $(this).siblings('.wpcd-more-description').show();
49            $(this).siblings('.wpcd-full-description').hide();
50            $(this).hide();
51        });
52    };
53    wpcd_moreLessDescription();
54
55    console.log("here")
56    $.each($('#wpcd_cat_ul > li'), function () {
57        if ($(this).children('a').attr('href') === window.location.href) {
58            $(this).children('a').addClass('active');
59        }
60    });
61    // $('#wpcd_cat_ul .wpcd_category').on('click', function (e) {
62    //     e.preventDefault();
63    //     if ($(this).attr('data-category') !== 'all') {
64    //         $('.wpcd_item').hide();
65    //         $('.' + $(this).attr('data-category')).fadeIn();
66    //     } else {
67    //         $('.wpcd_item').fadeIn();
68    //     }
69    // });
70
71    const CouponsNavigation = {
72        categoriesPaginationSetTimeout: '',
73        jsDataTax: 'data-category',
74        action: document.querySelector('#wpcd_coupon_pagination_wr') &&
75            document.querySelector('#wpcd_coupon_pagination_wr').getAttribute('wpcd-data-action') ?
76            document.querySelector('#wpcd_coupon_pagination_wr').getAttribute('wpcd-data-action') : '',
77        couponTemplate: $('#wpcd_coupon_template'),
78        infinityScrollInArchive: document.querySelector('#wpcd_coupon_template') &&
79            document.querySelector('#wpcd_coupon_template').getAttribute('wpcd-data-infinity_scroll_in_archive') ?
80            document.querySelector('#wpcd_coupon_template').getAttribute('wpcd-data-infinity_scroll_in_archive') : '',
81        wpcdCatUl: document.querySelector('#wpcd_cat_ul'),
82        wpcdDropbtn: document.querySelector('#wpcd_cat_ul .wpcd_dropbtn'),
83        searchInputField: $('.wpcd_searchbar_search input'),
84        searchText: '',
85        couponPaginationActiveRequest: false,
86        lastScroll: null,
87        // function for generation event
88        wpcdDocumentEventGenerate: function(eventName, element, details) {
89            if (eventName && element) {
90                if (!details) {
91                    details = true;
92                }
93                let event = new CustomEvent(eventName, {detail: details, bubbles: true});
94                element.dispatchEvent(event);
95            }
96        },
97        infinityScroll: function(event) {
98            if(CouponsNavigation.couponPaginationActiveRequest) return;
99            if(!CouponsNavigation.lastScroll && typeof CouponsNavigation.lastScroll === 'object') {
100                // let scrollTop = $('.wpcd_archive_section').offset().top;
101                // if($(window).scrollTop() > scrollTop - 150) {
102                //     //$('html, body').scrollTop(scrollTop - 150)
103                //     window.scroll(0, scrollTop - 150)
104                // }
105
106                CouponsNavigation.lastScroll = $(this).scrollTop();
107                return;
108            }
109
110            let currentScroll = $(this).scrollTop();
111            if (currentScroll <= CouponsNavigation.lastScroll){
112                CouponsNavigation.lastScroll = currentScroll;
113                return;
114            }
115            CouponsNavigation.lastScroll = currentScroll;
116
117            let wpcdCouponPaginationWr = document.querySelector('#wpcd_coupon_pagination_wr');
118            if(wpcdCouponPaginationWr) {
119                const scrollAmount = document.documentElement.scrollTop || document.body.scrollTop;
120                const pagWpCoordsY = wpcdCouponPaginationWr.getBoundingClientRect().top + window.pageYOffset;
121                const windowHeight = window.innerHeight;
122                if ((scrollAmount + windowHeight) >= pagWpCoordsY) {
123
124                    let hrefEl = wpcdCouponPaginationWr.querySelector('.current').nextElementSibling;
125                    if(hrefEl) {
126                        //window.removeEventListener('scroll', CouponsNavigation.infinityScroll);
127                        const href = hrefEl.getAttribute('href');
128                        const href_arr = CouponsNavigation.wpcd_getUrlVar(href);
129                        const wpcd_coupon_taxonomy = href_arr['wpcd_category'] ? href_arr['wpcd_category'] : href_arr['wpcd_vendor'];
130
131                        CouponsNavigation.couponPaginationActiveRequest = true;
132                        CouponsNavigation.wpcd_ajaxCouponCategoriesPagination(href_arr['wpcd_page_num'], wpcd_coupon_taxonomy);
133                    }
134                }
135            }
136        },
137        wpcd_ajaxCouponCategoriesPagination: function(wpcd_page_num, wpcd_coupon_taxonomy, sectionScrollTop = true) {
138            let wpcdCouponLoader = document.querySelector('.wpcd_coupon_loader');
139            if (!this.infinityScrollInArchive || wpcd_page_num == 1) {
140                if(sectionScrollTop) {
141                    let scrollTop = $('.wpcd_archive_section').offset().top;
142                    $('html, body').animate({scrollTop: scrollTop - 150}, 300);
143                }
144            } else {
145                wpcdCouponLoader.classList.add('wpcd_coupon_loader_infinite_scroll');
146            }
147
148            wpcdCouponLoader.classList.remove('wpcd_coupon_hidden_loader');
149            clearTimeout(this.categoriesPaginationSetTimeout);
150            this.categoriesPaginationSetTimeout = setTimeout(function () {
151                let coupon_template;
152                let coupon_items_count;
153                let coupon_sortby;
154                let coupon_exclude_cat;
155                let wpcd_data_coupon_page_url;
156                let wpcd_data_category_coupons;
157                let wpcd_data_vendor_coupons;
158                let wpcd_data_ven_cat_id;
159                let wpcd_coupon_taxonomy_category;
160                let wpcd_coupon_taxonomy_vendor;
161                if ( CouponsNavigation.jsDataTax == 'data-category' ) {
162                    wpcd_coupon_taxonomy_category = wpcd_coupon_taxonomy;
163                } else if ( CouponsNavigation.jsDataTax == 'data-vendor' ) {
164                    wpcd_coupon_taxonomy_vendor = wpcd_coupon_taxonomy;
165                }
166                let wpcd_coupon_template = $( '#wpcd_coupon_template' );
167                if ( wpcd_coupon_template.length > 0 ) {
168                    coupon_template = wpcd_coupon_template.attr( 'wpcd-data-coupon_template' );
169                    coupon_items_count = wpcd_coupon_template.attr( 'wpcd-data-coupon_items_count' );
170                    coupon_sortby = wpcd_coupon_template.attr( 'wpcd-data-coupon_sortby' );
171                    coupon_exclude_cat = wpcd_coupon_template.attr( 'wpcd-data-coupon_exclude_cat' );
172                    wpcd_data_coupon_page_url = wpcd_coupon_template.attr( 'wpcd-data-coupon_page_url' );
173                    wpcd_data_category_coupons = wpcd_coupon_template.attr( 'wpcd-data_category_coupons' );
174                    wpcd_data_vendor_coupons = wpcd_coupon_template.attr( 'wpcd-data_vendor_coupons' );
175                    wpcd_data_ven_cat_id = wpcd_coupon_template.attr( 'wpcd-data_ven_cat_id' );
176                }
177                if (!coupon_template) {
178                    coupon_template = undefined;
179                }
180                if (!wpcd_page_num) {
181                    wpcd_page_num = undefined;
182                }
183                const search_text = CouponsNavigation.searchText ? CouponsNavigation.searchText : undefined;
184
185                $.ajax({
186                    type: 'post',
187                    dataType: 'json',
188                    url: wpcd_object.ajaxurl,
189                    data: {
190                        action: CouponsNavigation.action,
191                        security: wpcd_object.security,
192                        wpcd_category: wpcd_coupon_taxonomy_category,
193                        wpcd_vendor: wpcd_coupon_taxonomy_vendor,
194                        coupon_template: coupon_template,
195                        coupon_items_count: coupon_items_count,
196                        coupon_sortby: coupon_sortby,
197                        coupon_exclude_cat: coupon_exclude_cat,
198                        wpcd_data_coupon_page_url: wpcd_data_coupon_page_url,
199                        wpcd_data_category_coupons: wpcd_data_category_coupons,
200                        wpcd_data_vendor_coupons: wpcd_data_vendor_coupons,
201                        wpcd_data_ven_cat_id: wpcd_data_ven_cat_id,
202                        wpcd_page_num: wpcd_page_num,
203                        search_text: search_text
204                    },
205                    success: function (response) {
206                        if (response) {
207                            const coupon_container = $('.wpcd_coupon_archive_container');
208                            if (coupon_container.length > 0) {
209                                let count_down_span;
210                                let masterTooltip;
211                                let mLDElements;
212                                let wpcdCouponUl = coupon_container.find('#wpcd_coupon_ul');
213                                if (!CouponsNavigation.infinityScrollInArchive) {
214                                    coupon_container.html(response);
215
216                                    $('#wpcd_coupon_pagination_wr a.page-numbers').off('click');
217                                    $('#wpcd_coupon_pagination_wr a.page-numbers').on('click', function (e) {
218                                        e.preventDefault();
219                                        const href = $(this).attr('href');
220                                        const href_arr = CouponsNavigation.wpcd_getUrlVar(href);
221                                        CouponsNavigation.wpcd_ajaxCouponCategoriesPagination(href_arr['wpcd_page_num'], wpcd_coupon_taxonomy, true);
222                                    });
223
224                                    masterTooltip = $('.masterTooltip');
225                                } else {
226                                    $('#wpcd_coupon_pagination_wr').remove();
227
228                                    if(wpcdCouponUl.length) {
229                                        if(wpcd_page_num == 1) {
230                                            wpcdCouponUl.html(response);
231                                            wpcdCouponUl.prepend('<li class="boundaryBetweenOldAndNewItems" style="height: 1px"></li>');
232                                        } else {
233                                            wpcdCouponUl.append('<li class="boundaryBetweenOldAndNewItems" style="height: 1px"></li>');
234                                            wpcdCouponUl.append(response);
235                                        }
236                                    } else {
237                                        if(wpcd_page_num == 1) {
238                                            coupon_container.html(response);
239                                            wpcdCouponUl.prepend('<div class="boundaryBetweenOldAndNewItems" style="height: 1px"></div>');
240                                        } else {
241                                            coupon_container.append('<div class="boundaryBetweenOldAndNewItems" style="height: 1px"></div>');
242                                            coupon_container.append(response);
243                                        }
244                                    }
245
246                                    let boundaryBetweenOldAndNewItems = $('.boundaryBetweenOldAndNewItems');
247
248                                    wpcdCouponLoader.classList.remove('wpcd_coupon_loader_infinite_scroll');
249                                    //window.addEventListener('scroll', CouponsNavigation.infinityScroll);
250
251
252                                    let newItems = boundaryBetweenOldAndNewItems.nextAll('.wpcd_item');
253                                    if(!newItems.length) {
254                                        newItems = boundaryBetweenOldAndNewItems.nextAll('.wpcd_coupon_li');
255                                    }
256                                    count_down_span = newItems.find('[data-countdown_coupon]');
257                                    masterTooltip = newItems.find('.masterTooltip');
258
259                                    mLDElements = {};
260                                    mLDElements.fullDescription = newItems.find('.wpcd-full-description');
261                                    mLDElements.more = newItems.find('.wpcd-more-description');
262                                    mLDElements.less = newItems.find('.wpcd-less-description');
263
264                                    boundaryBetweenOldAndNewItems.remove();
265                                }
266
267                                wpcdCouponLoader.classList.add('wpcd_coupon_hidden_loader');
268
269                                wpcd_countDownFun(count_down_span);
270
271                                masterTooltip.hover(function () {
272                                    var title = $(this).attr('title');
273                                    $(this).data('tipText', title).removeAttr('title');
274                                    $('<p class="wpcd-copy-tooltip"></p>')
275                                        .text(title)
276                                        .appendTo('body')
277                                        .fadeIn('slow');
278                                }, function () {
279                                    $(this).attr('title', $(this).data('tipText'));
280                                    $('.wpcd-copy-tooltip').remove();
281                                }).mousemove(function (e) {
282                                    var mousex = e.pageX + 20;
283                                    var mousey = e.pageY + 10;
284                                    $('.wpcd-copy-tooltip')
285                                        .css({top: mousey, left: mousex})
286                                });
287
288                                if(!wpcd_coupon_taxonomy) wpcd_coupon_taxonomy = 'all';
289                                $.each($('#wpcd_cat_ul  li'), function () {
290                                    if ($(this).children('a').attr(CouponsNavigation.jsDataTax) == wpcd_coupon_taxonomy) {
291                                        $(this).children('a').addClass('active');
292                                    } else {
293                                        $(this).children('a').removeClass('active');
294                                    }
295                                });
296
297                                wpcd_moreLessDescription(mLDElements);
298                            }
299                        } else {
300                            //wpcdCouponLoader.classList.add('wpcd_coupon_hidden_loader');
301                        }
302                    },
303                    complete: function (data) {
304                        CouponsNavigation.couponPaginationActiveRequest = false;
305                    }
306                });
307            }, 500);
308
309        },
310        dropDownContDisplayBlock: function() {
311            $(".wpcd_categories_in_dropdown > div").css('display', 'block');
312        },
313        dropDownContDisplayNone: function() {
314            $(".wpcd_categories_in_dropdown > div").css('display', 'none');
315        },
316        wpcdCategoriesDropdown: function() {
317            var sw = jQuery(".wpcd_div_nav_block").width();
318            if (sw < 850) {
319                $(".wpcd_categories_in_dropdown > div").addClass('wpcd_dropdown-content');
320                $(".wpcd_categories_in_dropdown > a").css('display', 'inline');
321                //jQuery(".wpcd_categories_full").css('display', 'none');
322
323                this.wpcdCatUl.addEventListener('mouseenter', this.dropDownContDisplayBlock, false);
324
325                this.wpcdCatUl.addEventListener('mouseleave', this.dropDownContDisplayNone, false);
326
327                this.wpcdDropbtn.addEventListener('click', this.dropDownContDisplayBlock, false);
328            } else {
329                $(".wpcd_categories_in_dropdown > div").removeClass('wpcd_dropdown-content');
330                $(".wpcd_categories_in_dropdown > a").css('display', 'none');
331
332                this.wpcdCatUl.removeEventListener('mouseenter', this.dropDownContDisplayBlock, false);
333
334                this.wpcdCatUl.removeEventListener('mouseleave', this.dropDownContDisplayNone, false);
335
336                this.wpcdDropbtn.removeEventListener('click', this.dropDownContDisplayBlock, false);
337            }
338        },
339        wpcd_getUrlVar: function(urlVar) {
340            if(!urlVar) urlVar = '';
341            let arrayVar = [];
342            let valueAndKey = [];
343            let resultArray = [];
344            arrayVar = (urlVar.substr(1)).split('&');
345            if (arrayVar[0] == "") return false;
346            for (let i = 0; i < arrayVar.length; i++) {
347                valueAndKey = arrayVar[i].split('=');
348                resultArray[valueAndKey[0]] = valueAndKey[1];
349            }
350            return resultArray;
351        },
352
353        init: function () {
354            console.log(this.action)
355            console.log(this.infinityScrollInArchive)
356
357            // getting wpcdJsDataTax value
358            if ($('#wpcd_cat_ul .wpcd_category').attr('data-category')) {
359                this.jsDataTax = 'data-category';
360            } else if ($('#wpcd_cat_ul .wpcd_category').attr('data-vendor')) {
361                this.jsDataTax = 'data-vendor';
362            }
363
364            if(this.infinityScrollInArchive) {
365                window.addEventListener('scroll', this.infinityScroll);
366            }
367
368            if (this.wpcdCatUl) {
369                $('#wpcd_cat_ul .wpcd_category').on('click', function (e) {
370                    e.preventDefault();
371
372                    CouponsNavigation.wpcdDocumentEventGenerate('mouseleave', CouponsNavigation.wpcdCatUl);
373
374                    const wpcd_coupon_taxonomy = $(this).attr(CouponsNavigation.jsDataTax);
375                    CouponsNavigation.searchInputField.val('');
376                    CouponsNavigation.searchText = '';
377                    CouponsNavigation.couponPaginationActiveRequest = true;
378                    CouponsNavigation.wpcd_ajaxCouponCategoriesPagination('1', wpcd_coupon_taxonomy, false);
379                });
380
381                this.wpcdCategoriesDropdown();
382            }
383
384            $('#wpcd_coupon_pagination_wr a.page-numbers').on('click', function (e) {
385                e.preventDefault();
386                const href = $(this).attr('href');
387                const href_arr = CouponsNavigation.wpcd_getUrlVar(href);
388                const wpcd_coupon_taxonomy = href_arr['wpcd_category'] ? href_arr['wpcd_category'] : href_arr['wpcd_vendor'];
389                CouponsNavigation.wpcd_ajaxCouponCategoriesPagination(href_arr['wpcd_page_num'], wpcd_coupon_taxonomy, true);
390            });
391
392            let delayTimer;
393            this.searchInputField.on('input', function (e) {
394                clearTimeout(delayTimer);
395                delayTimer = setTimeout(() => {
396                    CouponsNavigation.searchText = $(this).val();
397                    CouponsNavigation.couponPaginationActiveRequest = true;
398                    CouponsNavigation.wpcd_ajaxCouponCategoriesPagination('1', 'all', false);
399                }, 800);
400            })
401
402        }
403    }
404
405    CouponsNavigation.init();
406
407
408    /*
409    $('.wpcd_search2 .wpcd_searchbar_search input').hide();
410    $('.wpcd_search2 #wpcd_searchbar_search_close').hide();
411    $('#wpcd_searchbar_search_icon').on('click', function (e) {
412        $('.wpcd_search2 .wpcd_searchbar_search input').fadeIn();
413        $('.wpcd_search2 #wpcd_searchbar_search_close').fadeIn();
414    });
415    $('.wpcd_search2 #wpcd_searchbar_search_close').on('click', function (e) {
416        $('.wpcd_search2 .wpcd_searchbar_search input').fadeOut();
417        $('.wpcd_search2 #wpcd_searchbar_search_close').fadeOut();
418        $('.wpcd_item').fadeIn();
419        $('.wpcd_searchbar_search input').val('');
420    });*/
421
422    // $('#wpcd_searchbar_search_icon').on('click', function (e) {
423    //     $('.wpcd_searchbar_search input').fadeIn();
424    //     $('#wpcd_searchbar_search_close').fadeIn();
425    // });
426    // $('#wpcd_searchbar_search_close').on('click', function (e) {
427    //     $('.wpcd_searchbar_search input').fadeOut();
428    //     $('#wpcd_searchbar_search_close').fadeOut();
429    //     $('.wpcd_item').fadeIn();
430    //     $('.wpcd_searchbar_search input').val('');
431    // });
432
433    function wpcd_countDownFun(count_down_span) {
434        if(!count_down_span) {
435            count_down_span = $('[data-countdown_coupon]');
436        }
437
438        count_down_span.each(function () {
439            var $this = $(this), finalDate = $(this).data('countdown_coupon');
440            $this.countdown(finalDate, function (event) {
441                var format = '%M ' + wpcd_main_js.minutes + ' %S ' + wpcd_main_js.seconds;
442                if (event.offset.hours > 0) {
443                    format = '%H ' + wpcd_main_js.hours + ' %M ' + wpcd_main_js.minutes + ' %S ' + wpcd_main_js.seconds;
444                }
445                if (event.offset.totalDays > 0) {
446                    format = '%-d ' + wpcd_main_js.day + '%!d ' + format;
447                }
448                if (event.offset.weeks > 0) {
449                    format = '%-w ' + wpcd_main_js.week + '%!w ' + format;
450                }
451                if (event.offset.weeks == 0 && event.offset.totalDays == 0 && event.offset.hours == 0 && event.offset.minutes == 0 && event.offset.seconds == 0) {
452                    jQuery(this).parent().addClass('wpcd-countdown-expired').html(wpcd_main_js.expired_text);
453                } else {
454                    jQuery(this).html(event.strftime(format));
455                }
456            }).on('finish.countdown', function (event) {
457                jQuery('.wpcd-coupon-two-countdown-text').hide();
458                jQuery(this).html(wpcd_main_js.expired_text).parent().addClass('disabled');
459            });
460        });
461    }
462
463    wpcd_countDownFun();
464
465    function wpcd_couponCountingFun() {
466        $('.wpcd-coupon-click-link').click(function (e) {
467            var $this = $(this),
468                coupon_id = $this.data('id');
469
470            var data = {
471                'action': 'wpcd_coupon_clicked_action',
472                'security': wpcd_object.security,
473                'coupon_id': coupon_id,
474            };
475            jQuery.post(wpcd_object.ajaxurl, data, function (response) {
476                console.log('response', response)
477            });
478        });
479    }
480
481    wpcd_couponCountingFun();
482});
483
484jQuery(document).ready(function ($) {
485
486    // For social share
487    $('.fb-share,.tw-share,.go-share').click(function (e) {
488        e.preventDefault();
489        window.open($(this).attr('href'), 'fbShareWindow', 'height=450, width=550, top='
490            + ($(window).height() / 2 - 275) + ', left=' + ($(window).width() / 2 - 225)
491            + ', toolbar=0, location=0, menubar=0, directories=0, scrollbars=0');
492        return false;
493    });
494
495    /*
496     * Vote System
497     */
498    $('a[class^=wpcd-vote]').click(function (e) {
499        e.preventDefault();
500        var $this = $(this),
501            coupon_id = $this.data('id'),
502            meta = "up",
503            el_sibling_percentage = $this.siblings(".wpcd-vote-percent"),
504            el_percentage = $('.wpcd-vote-percent[data-id=' + coupon_id + ']');
505
506        if ($this.hasClass("wpcd-vote-down")) {
507            meta = "down";
508        }
509        var data = {
510            'action': 'wpcd_vote',
511            'security': wpcd_object.security,
512            'meta': meta,
513            'coupon_id': coupon_id,
514        };
515
516        jQuery.post(wpcd_object.ajaxurl, data, function (response) {
517            if (response === "Failed") {
518                wpcd_displayMsg(wpcd_main_js.vote_failed, el_percentage, 2000);
519            } else if (response === "voted") {
520                wpcd_displayMsg(wpcd_main_js.vote_already, el_sibling_percentage, 2000);
521            } else {
522                wpcd_displayMsg(wpcd_main_js.vote_success, el_percentage, 2000);
523                setTimeout(function () {
524                    wpcd_displayMsg(response, el_percentage, 0);
525                }, 2000);
526
527            }
528        });
529
530        /*
531         * This function dispaly msg in a specific element for a little time
532         *
533         * @param string 'Msg' is the message that will be displayed in the element
534         * @param object 'el' is the element
535         * @param int 'Time' is the time in milliSecond or 0 if this will be the text for ever
536         */
537        function wpcd_displayMsg(Msg, el, Time = 0) {
538
539            if (typeof (el) === "object") {
540                if (Time === 0) {
541                    el.html(Msg);
542                } else {
543                    var old_text = el.html();
544                    el.html(Msg);
545                    setTimeout(function () {
546                        el.html(old_text);
547                    }, Time);
548                }
549            }
550        }
551    });
552});
553
554jQuery(document).ready(function ($) {
555    $(document).ready(function () {
556        $('.masterTooltip').hover(function () {
557            var title = $(this).attr('title');
558            $(this).data('tipText', title).removeAttr('title');
559            $('<p class="wpcd-copy-tooltip"></p>')
560                .text(title)
561                .appendTo('body')
562                .fadeIn('slow');
563        }, function () {
564            $(this).attr('title', $(this).data('tipText'));
565            $('.wpcd-copy-tooltip').remove();
566        }).mousemove(function (e) {
567            var mousex = e.pageX + 20;
568            var mousey = e.pageY + 10;
569            $('.wpcd-copy-tooltip')
570                .css({top: mousey, left: mousex})
571        });
572    });
573
574    
575
576    
577
578});
579
580jQuery(document).ready(function ($) {
581
582    $(window).resize(wpcd_updateCouponClassRan);
583
584    function wpcd_updateCouponClassRan() {
585        wpcd_updateCouponClass('.wpcd-coupon-default', 'wpcd-template-default-mobile', 'wpcd-mobile-mini', 510, 380);
586        wpcd_updateCouponClass('.wpcd-coupon-one', 'wpcd-template-one-mobile', 'wpcd-mobile-mini', 530, 380);
587        wpcd_updateCouponClass('.wpcd-coupon-two', 'wpcd-template-two-mobile', 'wpcd-mobile-mini', 530, 380);
588        wpcd_updateCouponClass('.wpcd-coupon-three', 'wpcd-template-three-mobile', 'wpcd-mobile-mini', 400, 380);
589        wpcd_updateCouponClass('.wpcd-coupon-four', 'wpcd-template-four-mobile', 'wpcd-mobile-mini', 530, 380);
590        wpcd_updateCouponClass('.wpcd-template-five', 'wpcd-template-five-mobile', 'wpcd-mobile-mini', 510, 380);
591        wpcd_updateCouponClass('.wpcd-coupon-six', 'wpcd-template-six-mobile', 'wpcd-mobile-mini', 530, 380);
592        wpcd_updateCouponClass('.wpcd_seven_couponBox', 'wpcd-template-seven-mobile', 'wpcd-mobile-mini', 540, 380);
593        wpcd_updateCouponClass('.wpcd-new-grid-container', 'wpcd-template-eight-mobile', 'wpcd-mobile-mini', 500, 380);
594    }
595
596    function wpcd_updateCouponClass(class_box, class1, class2, width1, width2) {
597        $.each($(class_box), function () {
598            if ($(this).width() > width1) {
599                $(this).removeClass(class1);
600            } else {
601                $(this).addClass(class1);
602            }
603            if ($(this).width() > width2) {
604                $(this).removeClass(class2);
605            } else {
606                $(this).addClass(class2);
607            }
608        });
609    }
610
611    wpcd_updateCouponClassRan();
612});
613
614
615
616function wpcd_copyToClipboard(element) {
617    var $temp = jQuery("<input>");
618    jQuery("body").append($temp);
619    $temp.val(jQuery(jQuery(element)[0]).text()).select();
620    document.execCommand("copy");
621    $temp.remove();
622}
623
624function wpcd_openCouponAffLink(objectThis, CoupenId, wpcd_dataTaxonomy, numCoupon) {
625    var a = jQuery(objectThis);
626    var oldLink = a.attr('href');
627
628    var wpcd_couponTaxonomy;
629    var wpcdPageNum;
630
631    var oldLinkArrPrepare = oldLink.replace("?", "");
632    var oldLinkArr = oldLinkArrPrepare.split('&');
633    for (var i = 0; i < oldLinkArr.length; i++) {
634        if (oldLinkArr[i].indexOf(wpcd_dataTaxonomy + '=') > -1) {
635            wpcd_couponTaxonomy = oldLinkArr[i].split('=')[1];
636        }
637        if (oldLinkArr[i].indexOf('wpcd_page_num=') > -1) {
638            wpcdPageNum = oldLinkArr[i].split('=')[1];
639        }
640    }
641
642    if (window.location.href.indexOf('wpcd_coupon') > -1) { // check if there's wpcd_coupon in the url
643        var wpcd_id = jQuery.wpcd_urlParam('wpcd_coupon');
644        oldLink = window.location.href.replace("wpcd_coupon=" + wpcd_id, "wpcd_coupon=" + CoupenId);
645
646        if (window.location.href.indexOf('wpcd_num_coupon') > -1) {
647            var num_coupon = jQuery.wpcd_urlParam('wpcd_num_coupon');
648            if (numCoupon) {
649                oldLink = oldLink.replace("wpcd_num_coupon=" + num_coupon, "wpcd_num_coupon=" + numCoupon);
650            } else {
651                oldLink = oldLink.replace("&wpcd_num_coupon=" + num_coupon, "");
652            }
653
654        } else if (numCoupon) {
655            oldLink = oldLink + "&wpcd_num_coupon=" + numCoupon;
656        }
657
658        if (window.location.href.indexOf(wpcd_dataTaxonomy) > -1) {
659            var wpcd_coupon_taxonomy = jQuery.wpcd_urlParam(wpcd_dataTaxonomy);
660            if (wpcd_couponTaxonomy) {
661                oldLink = oldLink.replace(wpcd_dataTaxonomy + "=" + wpcd_coupon_taxonomy, wpcd_dataTaxonomy + "=" + wpcd_couponTaxonomy);
662            } else {
663                oldLink = oldLink.replace("&" + wpcd_dataTaxonomy + "=" + wpcd_coupon_taxonomy, "");
664            }
665
666        } else if (wpcd_couponTaxonomy) {
667            oldLink = oldLink + "&" + wpcd_dataTaxonomy + "=" + wpcd_couponTaxonomy;
668        }
669
670        if (window.location.href.indexOf('wpcd_page_num') > -1) {
671            var wpcd_page_num = jQuery.wpcd_urlParam('wpcd_page_num');
672            if (wpcdPageNum) {
673                oldLink = oldLink.replace("wpcd_page_num=" + wpcd_page_num, "wpcd_page_num=" + wpcdPageNum);
674            } else {
675                oldLink = oldLink.replace("&wpcd_page_num=" + wpcd_page_num, "");
676            }
677
678        } else if (wpcdPageNum) {
679            oldLink = oldLink + "&wpcd_page_num=" + wpcdPageNum;
680        }
681
682    } else if (window.location.href.indexOf('?') > -1 && window.location.href.indexOf('?wpcd_coupon') === -1) {// check if there's paramater in the url
683        oldLink = window.location.href + oldLink.replace("?", "&");
684    }
685    a.attr('href', oldLink);
686    //the affiliate link
687    var theLink = a.attr("data-aff-url");
688    window.open(a.attr('href'), '_blank');
689    window.location = theLink;
690    return false;
691}
692
693
694
695;

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.