(()=>{var t={65017(t){!function(e){const i={};let a,o=!1;function n(t,e){const i=e?t.parents(".safari-ios-decoration-fix"):t.parents(".safari-ios-decoration-fix-none");t.toggleClass("tcb-no-perspective",e),i.toggleClass("safari-ios-decoration-fix",!e).toggleClass("safari-ios-decoration-fix-none",e)}function r(t,e){const i=t.parents(".tve_ea_thrive_animation");i.length&&i.toggleClass("tcb-no-transform",e)}i.init=function(){a=i.videoScrolled.bind(this),document.addEventListener("scroll",a),e(".tcb-float-close-button").each((t,e)=>{e.addEventListener("click",i.closeFloatVideo.bind(this,e),!1)})},i.destroyFloating=function(){document.removeEventListener("scroll",a),e(".tcb-float-close-button").each((t,e)=>{e.removeEventListener("click",i.closeFloatVideo.bind(this,e))})},i.closeFloatVideo=function(t){e(t).parent(".tcb-video-float-container").addClass("tcb-float-closed"),i.videoScrolled()},i.videoScrolled=function(){e('.thrv_responsive_video[data-float="true"] .tcb-video-float-container iframe, .thrv_responsive_video[data-float="true"] .tcb-video-float-container video, .thrv_responsive_video[data-float="true"] .tcb-video-float-container .tve_responsive_video-no_video').each((t,i)=>{const a=e(i),s=a.parents(".tcb-video-float-container"),c=a.parents(".thrv_responsive_video"),d=c.attr("data-float-position"),l=c.find(".video_overlay_image").attr("style")||"";let u=TCB_Front.getDisplayType()[0],p=parseInt(e("#wpadminbar").height());if(s.hasClass("tcb-float-closed")||!function(t){if(t.parents(".tcb-post-list").length)return!1;const e="true"===t.attr("data-float"),i=t.attr("data-float-visibility");if(e&&!i)return!0;const a=TCB_Front.getDisplayType();return-1===i.indexOf(a)}(c)||TCB_Front.isInViewport(a.parents(".thrv_responsive_video"),parseInt(a.width))){if(s.removeClass(d).css({width:"",height:"","margin-top":""}).parents(".tcb-col,.thrv-content-box,.thrv-page-section,#content,.theme-section").css("z-index",""),c.find(".video_overlay_image").removeClass(d).css({cssText:l,height:"",width:""}),!o){const t=c.position().left,e={left:t,right:t+c.width()};d.includes("top")||d.includes("keep")?(e.top=-parseInt(c.attr(`data-float-width-${u}`)),s.css(e)):d.includes("bottom")&&(e.bottom=parseInt(TCB_Front.Utils.windowWidth()),s.css(e)),c.find(".video_overlay_image").css({top:"",left:"",bottom:"",right:"","margin-top":""}),o=!0}n(c,!1),r(c,!1)}else{void 0===c.attr(`data-float-width-${u}`)&&("m"===u&&(c.attr("data-float-width-m",TCB_Front.$window.width()+"px;"),c.attr("data-float-padding1-m",0),c.attr("data-float-padding2-m",0),p=0),"t"===u&&(u="d"));const t="height: "+function(t){const e=parseFloat(t.height()/t.width()).toFixed(2),i=TCB_Front.getDisplayType()[0],a=t.attr(`data-float-width-${i}`)||t.attr("data-float-width-d"),o=parseInt(a)*e;return a.includes("px")?o+"px":o*TCB_Front.$body.width()/100+"px"}(c)+" !important;",e="width: "+c.attr(`data-float-width-${u}`)+" !important;";let i="";if(d.includes("keep-original")){const t=c.attr(`data-float-padding1-${u}`);TCB_Front.Utils.hasAdminBar()&&p&&(i+=`margin-top: ${p}px;`),i+=`top: ${t} !important; `}else d.split("-").forEach((t,e)=>{const a=c.attr(`data-float-padding${e+1}-${u}`);TCB_Front.Utils.hasAdminBar()&&t.includes("top")&&p&&(i+=`margin-top: ${p}px;`),i+=`${t}: ${a} !important; `});d&&(s.addClass(d).css({cssText:e+t+i}).parents(".tcb-col,.thrv-content-box,.thrv-page-section,#content,.theme-section").css("z-index",(TCB_Front.highestZIndex||0)+10),a.css("height",""),c.find("video").length&&function(t){t.find("video").css({"object-fit":"cover",height:"100%"})}(c),c.find(".video_overlay_image").addClass(d).css({cssText:l+e+t+"z-index:100000 !important; top:inherit; left:inherit; bottom:inherit; right: inherit; margin-top: inherit;"}),n(c,!0),r(s,!0),o=!1)}})},i.restoreFloatingVideos=function(){e(".thrv_responsive_video").each((t,i)=>{const a=e(i),o=a.find(".tcb-video-float-container"),n=a.attr("data-float-position"),r=a.find(".video_overlay_image").attr("style")||"";o.removeClass(n).css({width:"",height:""}),a.find(".video_overlay_image").removeClass(n).css({cssText:r,height:"",width:"",top:"",left:"",bottom:"",right:"","margin-top":""})})},t.exports=i}(ThriveGlobal.$j)},93890(t,e,i){t.exports=(t,e)=>{const a='.tcb-video-cover:not([data-preload="1"]) .tcb-video-cover-image',o=i(82368)(t,e),n=i(23814),r=[];class s{static initVideoLazyLoad(e){const i=e.find(".thrv_responsive_video.tcb-lazy-load");0!==i.length&&(TCB_Front.add_scroll_callback(e=>{e>0&&i.each((e,i)=>{const o=t(i);if(s.hasVideoCover(o)){const t=o.find(a);t.length>0&&s.lazyLoadThumbnail(t)}else s.lazyLoadVideo(o,"external"===i.dataset.type)})}),i.each((e,i)=>{const a=t(i);a.off("click").on("pointerover",()=>s.preconnectAssets(a)).on("click",()=>s.lazyLoadVideo(a,"external"===i.dataset.type,!0))}))}static preventIframeLoad(e,i,a){const o=t(i).closest(".thrv_responsive_video");return a&&!TCB_Front.Utils.isEditorPage()&&s.shouldLazyLoad(o)&&(e=!0),e}static shouldLazyLoad(t){return t.hasClass("tcb-lazy-load")&&(s.hasVideoCover(t)||!TCB_Front.isInViewport(t,-150)||s.isInsideScreenFiller(t))}static isInsideScreenFiller(t){return"hidden"===t.closest(".tve-leads-screen-filler").css("visibility")}static hasVideoCover(t){return t.find(".video_overlay_image, .tcb-video-cover").length>0}static lazyLoadVideo(e,i=!1,a=!1){const o=e.find(i?"source":"iframe"),n=o.attr("src");if(o.hasClass("tcb-video-lazy-loaded")||n&&n.length>0||!e.is(":visible")||s.isInsideScreenFiller(o)||!TCB_Front.isInViewport(e,-150)&&!a)return;o.hasClass("vooplayer")&&!TCB_Front.vooplayerScriptsLoaded&&(t.getScript("https://s3.spotlightr.com/assets/vooplayer.js"),TCB_Front.vooplayerScriptsLoaded=1);let r=o.attr("data-src");r&&"null"!==r&&(r=TCB_Front.Hooks.applyFilters("tcb.video.lazy_load.src",r,e),o.attr("src",r),i&&o.closest("video")[0].load()),o.removeAttr("data-src").addClass("tcb-dr-done tcb-video-lazy-loaded"),a&&TCB_Front.onVideoClick(e)}static lazyLoadThumbnails(e){e.find(a).each((e,i)=>{const a=t(i);a.closest(".tcb-lazy-load").length>0&&s.lazyLoadThumbnail(a)})}static lazyLoadThumbnail(t){if(!TCB_Front.Utils.isEditorPage()&&(t.hasClass("tcb-src-loaded")||!t.is(":visible")||!TCB_Front.isInViewport(t.closest(".thrv_responsive_video"),-250)))return;const e=t.attr("data-src");e&&"null"!==e&&t.attr("src",e),t.removeAttr("data-src"),TCB_Front.Utils.isEditorPage()||t.addClass("tcb-src-loaded")}static preconnectAssets(t){const e=t.attr("data-type");if(r.includes(e))return;let i=[];switch(e){case"youtube":i=o.getAssetsToPreconnect();break;case"vimeo":i=s.getVimeoAssetsToPreconnect();break;case"wistia":i=s.getWistiaAssetsToPreconnect();break;case"external":const e=t.find("source").attr("data-src");void 0!==e&&(i=[new URL(e).origin]);break;case"vooplayer":i=n.getAssetsToPreconnect()}i.forEach(t=>s.addPreconnectLink(t)),r.push(e)}static addPreconnectLink(t){const e=document.createElement("link");e.rel="preconnect",e.href=t,document.head.append(e)}static getVimeoAssetsToPreconnect(){return["https://f.vimeocdn.com","https://player.vimeo.com","https://i.vimeocdn.com"]}static getWistiaAssetsToPreconnect(){return["https://fast.wistia.net"]}}return s}},49814(t,e,i){t.exports=(t,e)=>{const a=i(42166),o=i(82368)(t,e),n=i(23814),r=i(70025)(t,e),s=i(93890)(t,e);class c{static get identifier(){return".thrv_responsive_video"}static init(){c.initHooks()}static initHooks(){t(e).on("tcb_after_dom_ready",()=>c.onDomReady()).on("tcb_after_lightbox_open",(e,i)=>{t(i).find(`${c.identifier}:not([data-type="dynamic"])`).each((e,i)=>c.autoplayVideo(t(i)))}).on("tcb_before_lightbox_close",(e,i)=>c.pauseVideos(t(i))).on("tcb_on_content_hide",(e,i)=>c.pauseVideos(t(i))).on("tve-content-revealed",(e,i)=>c.maybeAutoplayVideo(t(i))).on("tcb_toggle_open",(e,i)=>c.maybeAutoplayVideo(t(i))).on("tcb_toggle_close",(e,i)=>c.pauseVideos(t(i))).on("tcb_on_content_show",(e,i)=>c.maybeAutoplayVideo(t(i))).on("tve_after_content_toggle",(t,e,i)=>{i&&s.lazyLoadThumbnails(e)}),TCB_Front.Hooks.addFilter("tcb.is_iframe_load_prevented",s.preventIframeLoad)}static onDomReady(){const e=t("body");c.pauseVideos(t(".tve_p_lb_content")),c.pauseVideos(t(`${c.identifier}:hidden`)),o.onDomReady(),TCB_Front.Utils.isEditorPage()||(r.init(),c.maybeAutoplayVideo(e),c.initOnClickEvent(),s.initVideoLazyLoad(e)),n.onDOMReady(),t(".tcb-video-background-el").each((t,e)=>e.parentNode.classList.add("tcb-video-background-parent"))}static initOnClickEvent(){t(c.identifier).off("click.thumbnail").on("click.thumbnail",e=>c.onClick(t(e.currentTarget),e)),TCB_Front.$document.off("click.tcb-video-delegate").on("click.tcb-video-delegate",`${c.identifier}, ${c.identifier} *`,e=>{if(e.tcbVideoHandled)return;const i=t(e.target).closest(c.identifier);i.length&&(e.tcbVideoHandled=!0,c.onClick(i,e))})}static onClick(t,e){const i=t.find(c.overlaySelector),n=t.find(".tcb-video-float-container.tcb-float-closed").length>0,r=i.length>0&&i.is(":visible");let s=c.detectProvider(t);if(TCB_Front.Hooks.doAction("tcb.video.before_autoplay",t,s),a.isCustomProvider(s)){if(!r)return;if(n)return void(i.length>0&&i.fadeOut());switch(s){case"youtube":o.play(t);break;case"vimeo":a.playIframeVideo(t,i,c.vimeoAutoplayString);break;case"wistia":t.find("iframe").length>0?a.playIframeVideo(t,i,c.wistiaAutoplayString):c.playWistiaScriptEmbed(t);break;case"bunnynet":a.playIframeVideo(t,i,`${c.bunnynetAutoplayString}&${c.bunnynetMutedString}`)}const e=t.find('[data-reporting-enabled="1"]');e.length>0&&TCB_Front.Hooks.doAction("tcb.video.init_reporting",e)}else a.isSelfHosted(s)&&c.toggleHtmlVideoPlay(t,e);i.length>0&&i.fadeOut()}static toggleHtmlVideoPlay(e,i){if((e.find(".tcb-video-cover:visible").length>0||!TCB_Front.browser.safari)&&(void 0===i||0===t(i.target).closest(".tcb-float-close-button").length)){const a=e.find("video").get(0);function o(t){setTimeout(function(){a[t]()})}o(a.paused?"play":"pause")}}static maybeAutoplayVideo(e){let i;i=void 0===e?t(`${c.identifier}:not([data-type="dynamic"])`):e.find(`${c.identifier}:not([data-type="dynamic"])`),i.each((e,i)=>{const a=t(i);0===a.parents(".tve_p_lb_content").length&&c.autoplayVideo(a)})}static autoplayVideo(t){if(1!==parseInt(t.attr("data-autoplay")))return;const e=t.attr("data-type");let i="";switch(e){case"youtube":i=`&${o.autoplayString}&${o.mutedString}`;break;case"vimeo":i=`&${c.vimeoAutoplayString}&${c.vimeoMutedString}`;break;case"wistia":i=`&${c.wistiaAutoplayString}&${c.wistiaMutedString}`;break;case"bunnynet":i=`&${c.bunnynetAutoplayString}&${c.bunnynetMutedString}`}if(a.isCustomProvider(e)){const e=t.find("iframe");let a=e.attr("src")||e.attr("data-src");a&&0!==a.length&&-1===a.indexOf(i)&&(a.includes("?")?"?"===a.slice(-1)&&(i=i.substring(1)):i=`?${i.substring(1)}`,a+=i,e.attr({src:a,"data-src":a}))}else if(a.isSelfHosted(e)){const e=t.find("video").get(0);e&&(e.muted=!0,e.paused&&e.play())}}static pauseVideos(t){t.find("video").each((t,e)=>e.pause()),c.pauseProviderIframes(t)}static pauseProviderIframes(t){t.find("iframe").each((t,e)=>{try{const t=(e.getAttribute("src")||"").toLowerCase();(t.includes("youtube.com/embed")||t.includes("youtu.be"))&&e.contentWindow&&e.contentWindow.postMessage(JSON.stringify({event:"command",func:"pauseVideo",args:""}),"*")}catch(t){}}),t.find("iframe").each((t,e)=>{try{(e.getAttribute("src")||"").toLowerCase().includes("vimeo.com")&&e.contentWindow&&e.contentWindow.postMessage('{"method":"pause"}',"*")}catch(t){}}),t.find('.wistia_embed,[class*="wistia_async_"]').each((t,i)=>{try{const t=i.getAttribute("class")||"";let a=null;const o=t.match(/wistia_async_([a-zA-Z0-9]+)/);if(o&&(a=o[1]),!a){const t=(i.getAttribute("data-url")||"").match(/\/iframe\/([a-zA-Z0-9]+)/);t&&(a=t[1])}if(!a)return;if(e.Wistia&&"function"==typeof e.Wistia.api){let t;try{t=e.Wistia.api(a)}catch(t){}if(!t){const a=i.getAttribute("id");if(a)try{t=e.Wistia.api(a)}catch(t){}}if(t&&"function"==typeof t.pause){try{t.pause()}catch(t){}return}}e._wq=e._wq||[],e._wq.push({id:a,onReady:function(t){try{t.pause()}catch(t){}}})}catch(t){}});try{t.find(".wistia_embed video").each((t,e)=>{try{e.pause()}catch(t){}})}catch(t){}}static get vimeoAutoplayString(){return"autoplay=1"}static get vimeoMutedString(){return"muted=1"}static get wistiaAutoplayString(){return"autoPlay=true"}static get wistiaMutedString(){return"muted=true"}static get bunnynetAutoplayString(){return"autoplay=true"}static get bunnynetMutedString(){return"muted=false"}static get overlaySelector(){return".video_overlay_image, .tcb-video-cover"}static detectProvider(t){let e=t.find(".tcb-responsive-video").attr("data-provider")||t.attr("data-type");if(e&&"dynamic"!==e)return e;const i=(t.find("iframe").attr("src")||t.find("source").attr("src")||"").toLowerCase();return i.includes("youtube")||i.includes("youtu.be")?"youtube":i.includes("vimeo")?"vimeo":i.includes("wistia")?"wistia":i.includes("bunnycdn")||i.includes("mediadelivery")?"bunnynet":t.find('.wistia_embed,[class*="wistia_async_"]').length>0?"wistia":e}static playWistiaScriptEmbed(t){const i=t.find('.wistia_embed,[class*="wistia_async_"]').first();if(0!==i.length){e._wq=e._wq||[];try{const a=i.attr("class")||"";let o=null;const n=a.match(/wistia_async_([a-zA-Z0-9]+)/);if(n&&(o=n[1]),!o){const e=(i.attr("data-url")||t.attr("data-url")||"").match(/\/iframe\/([a-zA-Z0-9]+)/);e&&(o=e[1])}if(o&&e.Wistia&&"function"==typeof e.Wistia.api){let t;try{t=e.Wistia.api(o)}catch(t){}if(!t){const a=i.attr("id");if(a)try{t=e.Wistia.api(a)}catch(t){}}if(t){try{"function"==typeof t.unmute?t.unmute():"function"==typeof t.volume&&t.volume(1)}catch(t){}try{t.play()}catch(t){}return}}o&&e._wq.push({id:o,onReady:function(t){try{"function"==typeof t.unmute?t.unmute():"function"==typeof t.volume&&t.volume(1)}catch(t){}try{t.play()}catch(t){}}})}catch(t){}}}}return window.TCB_Front.playBackgroundYoutube=o.playBackgroundVideos,window.TCB_Front.refreshBackgroundYoutube=o.refreshBackgroundVideos,window.TCB_Front.onVideoClick=c.onClick,window.TCB_Front.changeAutoplayVideo=c.maybeAutoplayVideo,window.TCB_Front.makeAutoplayVideo=c.autoplayVideo,window.TCB_Front.Video=c,window.TCB_Front.floating=i(65017),c}},70025(t,e,i){t.exports=(t,e)=>{const a=i(82368)(t,e);let o=null;class n{static init(){t('div[data-reporting-enabled="1"], iframe[data-reporting-enabled="1"]').each((e,i)=>n.initVideo(t(i))),TCB_Front.Hooks.addAction("tcb.video.init_reporting",t=>n.initVideo(t))}static initVideo(t){if(t.data("tcb-video-initialized"))return;t.data("tcb-video-initialized",1);const e=t.attr("data-type");let i,r=0,s=0,c=["custom","external"].includes(e)?t.find("source").attr("src"):t.attr("data-url"),d=null;c=c.replace("#t=0.1","");const l=()=>{const t="function"==typeof d?d():r+5,e=t=>{const e=Math.max(Number(t)||0,r);n.saveRange(r,e,c),r=e};t&&"function"==typeof t.then?t.then(e).catch(()=>{const t=r+5;n.saveRange(r,t,c),r=t}):e(t)},u={setCurrentTimeGetter:t=>{d=t},onPlay:t=>{s||(s=1,n.triggerVideoStart(c)),r=t,clearInterval(i),i=setInterval(l,5e3)},onPause:t=>{clearInterval(i),t>r&&n.saveRange(r,t,c)},onEnd:t=>{n.saveRange(r,t,c),clearInterval(i),TCB_Front.Hooks.doAction("tcb.video.on_end",o)},onBuffer:t=>{r=t,clearInterval(i),i=setInterval(l,5e3)}};switch(e){case"youtube":a.initReportingEvents(t,u);break;case"vimeo":n.initVimeoEvents(t,u);break;case"wistia":n.initWistiaEvents(t,u);break;case"custom":case"external":n.initHtmlEvents(t,u)}}static initVimeoEvents(i,a){if(void 0===e.Vimeo)return void t.getScript("https://player.vimeo.com/api/player.js",()=>n.initVimeoEvents(i,a));const o=0===i.find("iframe").length?i:i.find("iframe"),r=new e.Vimeo.Player(o);a.setCurrentTimeGetter(()=>r.getCurrentTime()),r.on("play",()=>r.getCurrentTime().then(a.onPlay)),r.on("pause",()=>r.getCurrentTime().then(a.onPause)),r.on("ended",()=>r.getCurrentTime().then(a.onEnd)),r.on("seeking",()=>r.getCurrentTime().then(a.onBuffer))}static initWistiaEvents(i,a){const o=i.find("iframe");let r=o.attr("data-code");if(0!==o.length)o.addClass("wistia_embed");else{const t=i.attr("data-url");r=t.substring(t.lastIndexOf("/")+1)}void 0!==e._wq?e._wq.push({id:r,onReady(t){a.setCurrentTimeGetter(()=>t.time()),t.bind("play",()=>a.onPlay(t.time())).bind("pause",()=>a.onPause(t.time())).bind("end",()=>a.onEnd(t.time())).bind("seek",()=>a.onBuffer(t.time()))}}):t.getScript("//fast.wistia.com/assets/external/E-v1.js",()=>n.initWistiaEvents(i,a))}static initHtmlEvents(t,e){const i=t.find("video"),a=()=>i[0].currentTime;e.setCurrentTimeGetter(a),i.on("play",()=>e.onPlay(a())).on("pause",()=>e.onPause(a())).on("ended",()=>e.onEnd(a()))}static triggerVideoStart(t){TCB_Front.Utils.restAjax({route:tve_frontend_options.routes.video_reporting+"/video_started",data:{video_url:t,user_id:tve_frontend_options.current_user.id,post_id:tve_frontend_options.post_id}})}static saveRange(t,e,i){var a;TCB_Front.Utils.restAjax({route:tve_frontend_options.routes.video_reporting+"/save_range",data:{video_url:i,user_id:null!==(a=tve_frontend_options.current_user.id)&&void 0!==a?a:0,post_id:tve_frontend_options.post_id,range_start:Math.round(t),range_end:Math.round(e)}}).done(t=>{o=t,TCB_Front.Hooks.doAction("tcb.video.after_save_range",t)})}}return n}},42166(t){const e=["youtube","vimeo","wistia","bunnynet"],i=["self","external","custom"];t.exports=class{static isCustomProvider(t){return e.includes(t)}static isSelfHosted(t){return i.includes(t)}static playIframeVideo(t,e,i){const a=t.find("iframe"),o=a.parent(),n=document.createElement("iframe"),r=TCB_Front.Utils.getAttr(a);a.remove(),r.allow?r.allow.toLowerCase().includes("autoplay")||(r.allow=`${r.allow}; autoplay`):r.allow="autoplay";let s=r.src||r["data-src"]||"";const c=i.split("=")[0];if(s){const t=new RegExp(`([?&])${c}=([^&#]*)`,"i");s=s.replace(t,(t,e)=>"?"===e&&s.substring(s.indexOf(t)+t.length).startsWith("&")?"?":""),s=s.replace(/\?&/,"?").replace(/[?&]$/,"")}const d=s.includes("?")?"&":"?",l=`${s}${s?d:""}${i}`;r.src=l,r["data-src"]=l;for(const t in r)try{n.setAttribute(t,r[t])}catch(e){console.warn(`${t} is an invalid attribute name`)}let u=!1;if(o.length)try{o.append(n),u=!0}catch(t){}if(!u)try{e.replaceWith(n),u=!0}catch(t){}if(u||t.find(".tve_responsive_video_container,.tcb-video-float-container").first().append(n),e.length)try{e.remove()}catch(t){}n.focus()}}},23814(t){(e=>{class i{static onDOMReady(){document.addEventListener("vooPlayerReady",i.playBackgroundVoo,!1),document.addEventListener("vooPlayerReady",i.changeVooOnPlay,!1),TCB_Front.Utils.isEditorPage()?e(".tcb-video-background-el iframe.tcb-voo-bg").each(function(){const t=TVE.inner_$(this),e=t.attr("src");t.attr("src",e)}):(e('.thrv_responsive_video[data-type="vooplayer"]').each((t,i)=>{const a=e(i),o=a.outerHeight(),n=a.find(".tcb-video-cover,.video_overlay_image"),r=a.find("iframe");n.length>0&&r.length>0&&(a.find(".video-skin-player").css("z-index","-1"),r.before(n.css({height:r.height(),"max-height":o})),r.css("max-height",o))}),TCB_Front.floating.init()),TCB_Front.Hooks.addAction("tcb.video.before_autoplay",(t,e)=>{"vooplayer"===e&&t.find(".video-skin-player").css("z-index","")})}static playBackgroundVoo(){e("iframe.tcb-voo-bg").each((t,e)=>{const i=()=>{vooAPI(e.dataset.playerid,"onEnded",null,i),vooAPI(e.dataset.playerid,"play"),vooAPI(e.dataset.playerid,"volume",[0])};i()})}static changeVooOnPlay(t=TCB_Front.$body){t&&t.jquery||(t=TCB_Front.$body),t.find("iframe.video-player-container").each((t,i)=>{const a=()=>{e(i).css("pointer-events",""),e(i).parent().find("#theImg").remove()};i.src?a():vooAPI(i.dataset.playerid,"onPlay",null,()=>{a()})})}static getAssetsToPreconnect(){return["https://s3.spotlightr.com"]}}t.exports=i,window.TCB_Front.changeVooOnPlay=i.changeVooOnPlay})(ThriveGlobal.$j)},65465(t){t.exports=(t,e)=>{class i{static initialize(t){e.onYouTubeIframeAPIReady=()=>{TCB_Front.youtubeApiFetched=1,t()},i.fetchIframeApi()}static isApiInitialized(){return 1===TCB_Front.youtubeApiFetched||void 0!==e.YT&&void 0!==e.YT.Player}static fetchIframeApi(){t.ajax({url:"https://www.youtube.com/iframe_api",type:"get",crossDomain:!0,cache:!0,dataType:"script"})}static getDefaultPlayerParameters(t,e=!1){const i={autoplay:1,cc_load_policy:0,controls:0,disablekb:1,fs:0,iv_load_policy:0,modestbranding:1,playsinline:1,rel:0,showinfo:0,playlist:t};return e&&(i.loop=1,i.listType="playlist"),i}static isPlaylist(t){return t&&34===t.length}static getAssetsToPreconnect(){return["https://www.youtube.com","https://www.google.com","https://googleads.g.doubleclick.net","https://static.doubleclick.net","https://www.gstatic.com"]}}return i}},69997(t,e,i){t.exports=(t,e)=>{const a=i(65465)(t,e),o=".tcb-yt-bg";class n{static resetVideo(t){const e=t.find(o);if(e.length>0){const t=e.closest(".tcb-video-background-el"),i=TVE.Components.background.controls.video.video_settings.get_embed_code("background");t.html(i),n.play(t.find(o))}}static play(e=t(`div${o}:visible`)){e.length&&(a.isApiInitialized()?e.each((e,i)=>{const o=i.getAttribute("data-yt-id");let n;n=a.isPlaylist(o)?new YT.Player(i.id,{playerVars:a.getDefaultPlayerParameters(o,!0),events:{onReady:t=>t.target.mute(),onStateChange:t=>t.target.mute()}}):new YT.Player(i.id,{videoId:o,playerVars:a.getDefaultPlayerParameters(o),events:{onReady:t=>{t.target.mute(),t.target.playVideo()},onStateChange:t=>{t.target&&t.target.mute&&t.target.mute(),t.data===(YT.PlayerState.ENDED||0)&&t.target.playVideo()}}}),TCB_Front.latestYoutubeBackgroundPlayerInstance=n,t(n.getIframe()).data("tcb-yt-player",n)}):a.initialize(()=>n.play(e)))}static refreshVideos(){e.YT&&e.YT.Player&&t(`iframe${o}`).each((e,i)=>{const a=t(i);a.data("tcb-yt-player")||n.play(a)})}}return n}},82368(t,e,i){t.exports=(t,e)=>{const a=i(69997)(t,e),o=i(65465)(t,e);class n{static onDomReady(){n.initHooks(),n.playBackgroundVideos()}static initHooks(){TCB_Front.Utils.isEditorPage()?(TVE.add_action("tcb.element.duplicate",(t,e)=>a.resetVideo(e)),["sync","activate","create_display"].forEach(t=>TVE.add_action(`tve.conditional_display.${t}`,t=>a.resetVideo(t)))):(TCB_Front.Hooks.addFilter("tcb.video.lazy_load.src",(t,e)=>(t.includes("&enablejsapi=1")||"youtube"!==e.attr("data-type")||(t+="&enablejsapi=1"),t)),TCB_Front.Hooks.addAction("tcb.video.before_autoplay",(e,i)=>{if("youtube"!==i)return;const a=e.find("iframe")[0];t.each(a.attributes,(t,e)=>{let i=!1;e&&e.name.includes("data-gtm-yt-inspected")&&(a.removeAttribute(e.name),i=!0),i&&a.removeAttribute("id")})}))}static play(e){if(!o.isApiInitialized())return void o.initialize(()=>n.play(e));const i=e.find("iframe"),a=t("<div>"),r=TCB_Front.Utils.getAttr(i),s=new URL(TCB_Front.Utils.addHttp(i.attr("src"))),c=i.attr("data-code")?i.attr("data-code"):s.pathname.replace("/embed/",""),d=Object.fromEntries(s.searchParams.entries());d.autoplay=1,i.remove(),e.find(".video_overlay_image, .tcb-video-cover").replaceWith(a),1===parseInt(e.attr("data-reporting-enabled"))&&TCB_Front.Hooks.doAction("tcb.video.init_reporting",e),TCB_Front.latestYoutubePlayerInstance=n.initYoutubePlayer(a,c,d),delete r.src;const l=e.find("iframe")[0];for(const t in r)try{l.setAttribute(t,r[t])}catch(e){console.warn(`${t} is an invalid attribute name`)}}static initYoutubePlayer(t,e,i){return new YT.Player(t[0],{videoId:e,playerVars:i,width:"100%",events:{onReady:t=>t.target.playVideo(),onError:t=>console.warn(t)}})}static initReportingEvents(t,e){if(!o.isApiInitialized())return void o.initialize(()=>n.initReportingEvents(t,e));let i=t.find("iframe")[0];if(0===t.find("iframe").length){const e=t.attr("src")+"&enablejsapi=1";t.attr("src",e),i=t[0]}new YT.Player(i,{events:{onStateChange:t=>{var i,a;const o=t.data,n=(null==t||null===(i=t.target)||void 0===i||null===(a=i.playerInfo)||void 0===a?void 0:a.currentTime)||0;switch(e&&"function"==typeof e.setCurrentTimeGetter&&t&&t.target&&"function"==typeof t.target.getCurrentTime&&e.setCurrentTimeGetter(()=>t.target.getCurrentTime()),o){case YT.PlayerState.PLAYING:e.onPlay(n);break;case YT.PlayerState.PAUSED:e.onPause(n);break;case YT.PlayerState.ENDED:e.onEnd(n);break;case YT.PlayerState.BUFFERING:e.onBuffer(n)}}}})}static playBackgroundVideos(t){a.play(t)}static refreshBackgroundVideos(){a.refreshVideos()}static getAssetsToPreconnect(){return o.getAssetsToPreconnect()}static get autoplayString(){return"autoplay=1"}static get mutedString(){return"mute=1"}}return window.TCB_Front.Youtube=n,n}}},e={};function i(a){var o=e[a];if(void 0!==o)return o.exports;var n=e[a]={exports:{}};return t[a](n,n.exports,i),n.exports}void 0===TCB_Front.js_modules.video&&TCB_Front.setModuleLoadedStatus("video",!1),(t=>{if(TCB_Front.isModuleLoaded("video"))return;const e=i(49814)(t,window);e.init(),window.TCB_Front.video=e,TCB_Front.setModuleLoadedStatus("video",!0)})(ThriveGlobal.$j)})();
(()=>{window.TL_Front=window.TL_Front||{},window.ThriveGlobal=window.ThriveGlobal||{$j:jQuery.noConflict()};var e=".thrv_responsive_video iframe, .thrv_custom_html_shortcode iframe",t=".thrv_responsive_video video source",o=!1,r="undefined"!=typeof TL_Const&&TL_Const.trigger_based_form_types?TL_Const.trigger_based_form_types:["lightbox","screen_filler","slide_in","ribbon"],n=["shortcode_"];TL_Front.add_page_css=function(e){ThriveGlobal.$j.each(e,(function(e,t){if(e+="-css",-1!==(t=t.replace(/^http(s)?:\/\//,"//")).indexOf("thrive_flat")){var o=document.createElement("div");if(o.classList.add("tve-cb"),document.body.append(o),"both"===getComputedStyle(o).clear)return void o.remove();o.remove()}ThriveGlobal.$j("#"+e).length||ThriveGlobal.$j('link[href="http:'+t+'"]').length||ThriveGlobal.$j('link[href="https:'+t+'"]').length||ThriveGlobal.$j('<link rel="stylesheet" id="'+e+'" type="text/css" href="'+t+'"/>').prependTo("head")}))},TL_Front.lightspeed_assets=function(e){var t=function(){return ThriveGlobal.$j('link[href*="thrive_flat.css"]').length>0},r=[];if(e.css){if(e.css.files)for(var n in e.css.files){var i="flat"===n;(!t()&&i||!i)&&ThriveGlobal.$j('<link rel="stylesheet" href="'+e.css.files[n]+'"/>').prependTo("head")}e.css.inline&&e.css.inline.length&&e.css.inline.forEach((function(e){t()||ThriveGlobal.$j(e).prependTo("head")}))}if(e.js)for(var s in e.js)TCB_Front&&!TCB_Front.isModuleLoaded(s)&&r.push(s);!function t(){if(r.length){var n=r.shift();TL_Front.add_head_script(e.js[n],"tl-lightspeed-"+n,t)}else o=!0}()},TL_Front.conditional_display=function(e){void 0!==e&&e.lazy_load_conditional_preview&&tcb_condition_sets&&e.lazy_load_conditional_preview.forEach((function(e){-1===tcb_condition_sets.findIndex((function(t){return t.key===e.key}))&&tcb_condition_sets.push(e)}))},TL_Front.$document=ThriveGlobal.$j(document),TL_Front.extendConst=function(e){TL_Const.current_screen&&delete e.current_screen,ThriveGlobal.$j.extend(!0,TL_Const,e)},TL_Front.document_write=function(e){ThriveGlobal.$j("body").append(e)},TL_Front.add_head_script=function(e,t,o){var r=document.createElement("script"),n=ThriveGlobal.$j("head")[0];r.async=!0,"function"==typeof o&&(r.onload=r.onreadystatechange=o),void 0!==t&&(r.id=t),r.src=e,n.insertBefore(r,n.firstChild)},TL_Front.add_page_js=function(e,t){"function"!=typeof t&&(t=function(){});var o=0;ThriveGlobal.$j.each(e,(function(e,t){if("tve_frontend"===e&&"undefined"!=typeof TCB_Front)return!0;if(e+="-js",t&&!ThriveGlobal.$j("#"+e).length&&!ThriveGlobal.$j('script[src="'+t+'"]').length){if(o++,-1!==t.indexOf("connect.facebook.net"))return TL_Front.add_head_script(t,e,(function(){o--})),!0;ThriveGlobal.$j.getScript(t,(function(){o--}))}})),function e(){0!==o?setTimeout(e,50):t()}()},TL_Front.send_impression=function(e,t){if(e){t=t||{};var o={security:TL_Const.security,action:TL_Const.action_impression,tl_data:e,current_screen:TL_Const.current_screen};ThriveGlobal.$j.each(TL_Const.custom_post_data,(function(e,t){o[e]=t})),t.useBatching&&window.TVE_Dash&&!TVE_Dash.ajax_sent?TVE_Dash.add_load_item("tl_impression",o):ThriveGlobal.$j.post(TL_Const.ajax_url,o)}},TL_Front.isViewportBasedForm=function(e){return n.some((function(t){return 0===e.indexOf(t)}))},TL_Front.setupViewportImpressions=function(e){e&&0!==Object.keys(e).length&&(TL_Front.deferred_impressions=TL_Front.deferred_impressions||{},TL_Front.viewport_impressions=TL_Front.viewport_impressions||{},Object.keys(e).forEach((function(t){TL_Front.isViewportBasedForm(t)?TL_Front.viewport_impressions[t]=e[t]:-1!==r.indexOf(t)&&(TL_Front.deferred_impressions[t]=e[t])})))},TL_Front.do_impression=function(){if(TL_Front.impressions_data){var e={},t={};Object.keys(TL_Front.impressions_data).forEach((function(o){-1!==r.indexOf(o)||TL_Front.isViewportBasedForm(o)?t[o]=TL_Front.impressions_data[o]:e[o]=TL_Front.impressions_data[o]})),Object.keys(t).length>0&&(TL_Front.setupViewportImpressions(t),TL_Front.initViewportObservers()),Object.keys(e).length>0&&TL_Front.send_impression(e,{useBatching:!0})}},TL_Front.initViewportObservers=function(){TL_Front.viewport_impressions&&0!==Object.keys(TL_Front.viewport_impressions).length&&("IntersectionObserver"in window?(TL_Front.viewportObserver||(TL_Front.viewportObserverInitialCallbacks=TL_Front.viewportObserverInitialCallbacks||new WeakMap,TL_Front.viewportObservedElements=TL_Front.viewportObservedElements||new WeakSet,TL_Front.viewportObserver=new IntersectionObserver((function(e){e.forEach((function(e){var t=e.target;if(TL_Front.viewportObserverInitialCallbacks.has(t)){if(e.isIntersecting){var o=ThriveGlobal.$j(t),r=o.attr("data-tl-type")||o.closest(".tve-leads-conversion-object").attr("data-tl-type");r&&TL_Front.viewport_impressions[r]&&(TL_Front.trackViewportImpression(r),TL_Front.viewportObserver.unobserve(t),TL_Front.viewportObservedElements.delete(t))}}else TL_Front.viewportObserverInitialCallbacks.set(t,!0)}))}),{threshold:.5})),Object.keys(TL_Front.viewport_impressions).forEach((function(e){if(!TL_Front.viewport_impressions[e]._tracked){var t=ThriveGlobal.$j('.tve-leads-conversion-object[data-tl-type="'+e+'"]');if(t.length){var o=t[0];TL_Front.viewportObservedElements.has(o)||(TL_Front.viewportObservedElements.add(o),TL_Front.viewportObserver.observe(o))}}}))):Object.keys(TL_Front.viewport_impressions).forEach((function(e){TL_Front.trackViewportImpression(e)})))},TL_Front.trackViewportImpression=function(e){if(e&&TL_Front.viewport_impressions&&TL_Front.viewport_impressions[e]&&!TL_Front.viewport_impressions[e]._tracked){TL_Front.viewport_impressions[e]._tracked=!0;var t={};t[e]=TL_Front.viewport_impressions[e],TL_Front.send_impression(t)}},TL_Front.do_trigger_based_impression=function(e){if(e&&TL_Front.deferred_impressions&&TL_Front.deferred_impressions[e]&&!TL_Front.deferred_impressions[e]._tracked){TL_Front.deferred_impressions[e]._tracked=!0;var t={};t[e]=TL_Front.deferred_impressions[e],TL_Front.send_impression(t)}},TL_Front.do_two_step_impression=function(e){if(TL_Const&&TL_Const.forms&&TL_Const.forms[e]){var t=TL_Const.forms[e],o={};o[e]={group_id:t.main_group_id,form_type_id:t.form_type_id,variation_key:t._key,active_test_id:t.active_test_id||null},TL_Front.send_impression(o)}},TL_Front.maybe_track_two_step_impression=function(e){if(e&&-1!==e.indexOf("2step-")&&TL_Const&&TL_Const.forms){var t=e.replace("tve-leads-track-2step-",""),o=Object.keys(TL_Const.forms).find((function(e){return 0===e.indexOf("two_step_")&&TL_Const.forms[e]._key===t}));o&&TL_Front.do_two_step_impression(o)}},ThriveGlobal.$j((function(){if("undefined"!=typeof TL_Const){if(ThriveGlobal.$j(".tve-leads-screen-filler iframe, .tve-leads-ribbon iframe").not(".thrv_social_default iframe").not(".tcb-dr-done").each((function(){var e=ThriveGlobal.$j(this).addClass("tcb-dr-done");e.attr("src")&&e.attr("data-src",e.attr("src")),e.attr("src","")})),"undefined"!=typeof TCB_Front&&ThriveGlobal.$j(TCB_Front).on("content_loaded.thrive",(function(e,t){t.find(".tve-tl-anim").each((function(){var e=ThriveGlobal.$j(this);ThriveGlobal.$j(TL_Front).trigger("showform.thriveleads",{$target:e})}))})),ThriveGlobal.$j(window).on("tcb_after_dom_ready",(function(){if(!tve_frontend_options.is_editor_page){var e=TCB_Front.queryString.get("post_type");e&&"tve_lead_2s_lightbox"===e&&setTimeout((function(){TCB_Front.handleIframes(ThriveGlobal.$j(".tve_p_lb_content"))}),100)}})),ThriveGlobal.$j(TL_Front).on("showform.thriveleads",(function(o,n){var i,s=n.$target?n.$target:ThriveGlobal.$j("."+n.form_id);s.length&&(n.TargetEvent&&"exit"===n.TargetEvent.tve_trigger&&s.data("shown-on-exit")||(n.first&&(s=s.first()),s.attr("data-s-state")&&(s=s.closest(".tl-states-root").find('[data-state="'+s.attr("data-s-state")+'"] .tl-lb-target')),n&&n.$parentStateEl&&s.closest(".tl-style").first().data("parentStateEl",n.$parentStateEl),i=s.hasClass("tve-tl-anim")?s:s.find(".tve-tl-anim"),s.css("display",""),setTimeout((function(){i.addClass("tve-leads-triggered"),TL_Front.handle_typefocus(i,"start"),ThriveGlobal.$j(".tve_post_grid_masonry").length&&TCB_Front.postGridLayout()}),0),TL_Front.maybe_track_two_step_impression(n.form_id),n.form_type&&-1!==r.indexOf(n.form_type)&&TL_Front.do_trigger_based_impression(n.form_type),"function"==typeof TL_Front["open_"+n.form_type]?TL_Front["open_"+n.form_type](s,n.TargetEvent):s.show(),TCB_Front.resizePageSection(),s.on("switchstate",(function(e,t){t.offset().top-ThriveGlobal.$j(window).scrollTop()+t.outerHeight()<0&&ThriveGlobal.$j("html, body").animate({scrollTop:t.offset().top+"px"},50),TCB_Front.resizePageSection()})),setTimeout((function(){s.find(e+", "+t).each((function(){var e=ThriveGlobal.$j(this);e.attr("data-src")&&e.attr("src",e.attr("data-src"))}))}),200)))})),ThriveGlobal.$j("body").on("click",".tve-ribbon-close",(function(){var o=ThriveGlobal.$j(this).closest(".tve-leads-ribbon"),r=o.data("position");o.find(e+", "+t).each((function(){var e=ThriveGlobal.$j(this);e.attr("data-src",e.attr("src")),e.attr("src","")})),o.removeClass("tve-leads-triggered"),"top"===r?ThriveGlobal.$j("body").animate({marginTop:0},200,(function(){document.body.style.removeProperty("margin-top"),TCB_Front&&TCB_Front.$window&&TCB_Front.$window.trigger("scroll")})):"bottom"===r&&ThriveGlobal.$j("body").animate({marginBottom:"0px"},200,(function(){document.body.style.removeProperty("margin-bottom")})),TL_Front.handle_typefocus(o,"pause"),setTimeout((function(){o.css(r,"")}),400),ThriveGlobal.$j("#tve-lg-error-container").hide()})),ThriveGlobal.$j(window).on("conditional_display_loaded",(function(){var e=Object.keys(TL_Front.contentHtml||{});e.length&&e.forEach((function(e){var t=ThriveGlobal.$j(".tl-placeholder-f-type-".concat(e));if(t.length){var o=ThriveGlobal.$j(TL_Front.contentHtml[e]);t.replaceWith(o),setTimeout((function(){ThriveGlobal.$j(TL_Front).trigger("showform.thriveleads",{$target:o})}))}}))})),ThriveGlobal.$j(TCB_Front).on("tl-ajax-loaded",(function(){TL_Front.viewport_impressions&&Object.keys(TL_Front.viewport_impressions).length>0&&(window.requestAnimationFrame?requestAnimationFrame((function(){TL_Front.initViewportObservers()})):TL_Front.initViewportObservers())})),TL_Const.ajax_load||TL_Front.do_impression(),TL_Front.ajax_load_callback=function(e,t){if(t&&TL_Front.conditional_display(t),e&&e.res&&e.js&&e.html){var r,i;if(TL_Front.lightspeed_assets(e.lightspeed||{}),TL_Front.add_page_css(e.res.css),TL_Front.add_page_css(e.res.fonts),e.html&&(e.html.widget||ThriveGlobal.$j(".tl-widget-container").remove(),ThriveGlobal.$j.each(e.html,(function(t,o){if(!o)return!0;if(TL_Front.contentHtml=TL_Front.contentHtml||{},TL_Front.contentHtml[t]=o,"in_content"===t){var r=parseInt(e.in_content_pos),n="after",i=ThriveGlobal.$j(".tve-tl-cnt-wrap");i.length||(i=ThriveGlobal.$j("#tve_editor.tar-main-content")),i.length||(i=ThriveGlobal.$j("#post_content"));var s=i.find("p").filter(":visible").not(".thrv_table p, form p, .tcb-post-list p, .thrv_text_element div p, p.wp-caption-text, .thrv_responsive_video p, .thrv_header p");0===s.length&&0===r?i.prepend(o):(0===r&&(r=1,n="before"),s.eq(r-1)[n](o))}else{var a=ThriveGlobal.$j(".tl-placeholder-f-type-"+t);if(e.js[t]&&e.js[t].content_locking){var l=a.parents(".tve_content_lock").first();if(e.js[t].has_conversion)return a.remove(),l.removeClass("tve_lock_hide"),!0;"tve_lock_blur"===e.js[t].lock&&l.removeClass("tve_lock_hide").addClass(e.js[t].lock)}"widget"===t?a.hasClass("tl-preload-form")?a.first().replaceWith(ThriveGlobal.$j(o).addClass("tve-leads-triggered")):(a.replaceWith(o),ThriveGlobal.$j(".tl-widget-container").children().unwrap()):a.replaceWith(o),0===t.indexOf("two_step")&&(c=t,ThriveGlobal.$j(".tl-2step-trigger-".concat(c.replace("two_step_",""))).show())}var c})),i=-1,"Microsoft Internet Explorer"==navigator.appName?(r=navigator.userAgent,null!==new RegExp("MSIE ([0-9]{1,}[\\.0-9]{0,})").exec(r)&&(i=parseFloat(RegExp.$1))):"Netscape"==navigator.appName&&(r=navigator.userAgent,null!==new RegExp("Trident/.*rv:([0-9]{1,}[\\.0-9]{0,})").exec(r)&&(i=parseFloat(RegExp.$1))),i>0&&setTimeout((function(){var e="";ThriveGlobal.$j("body style.tve_custom_style").each((function(){e=this.innerText,this.innerText=e}))}))),e.body_end){var a=ThriveGlobal.$j(e.body_end);a.find(".tve_wistia_popover").each((function(){ThriveGlobal.$j("#"+this.id).length&&this.parentNode.removeChild(this)})),a.filter("link[href]").each((function(){ThriveGlobal.$j('link[href="'+this.getAttribute("href")+'"]').length&&(a=a.not(this))})),a.filter("script[src]").each((function(){ThriveGlobal.$j('script[src="'+this.getAttribute("src")+'"]').length&&(a=a.not(this))}));try{ThriveGlobal.$j("body").append(a)}catch(e){console.log("Body append: "+e)}}void 0!==e.js.TVO_Form&&(TVO_Form=e.js.TVO_Form),TL_Front.add_page_js(e.res.js,(function(){n=!0})),setTimeout((function e(){n&&o?(TCB_Front.event_triggers(ThriveGlobal.$j("body")),TCB_Front.onDOMReady(),s(),ThriveGlobal.$j(TCB_Front).trigger("tl-ajax-loaded"),TCB_Front.add_scroll_callback((function(){var e=ThriveGlobal.$j('.tve-leads-ribbon[data-position="top"]'),t=e.find(".tve_shortcode_editor"),o=e.is(":visible")&&Number(e.css("opacity"))?Math.max(e.outerHeight(),t.outerHeight()):0,r=ThriveGlobal.$j('[data-elementor-type="header"] .elementor-top-section.elementor-sticky.elementor-sticky--active');r.length||(r=ThriveGlobal.$j(".she-header")),r.length&&r[0].style.setProperty("margin-top",o+"px","important")}))):setTimeout(e,50)}),50),TL_Const.forms=e.js,e.deferred_impressions&&TL_Front.setupViewportImpressions(e.deferred_impressions),setTimeout((function(){ThriveGlobal.$j(".tl-preload-form").remove()}),1e3)}},TL_Const.ajax_load){var n=!1,i=(ThriveGlobal.$j(".tve-leads-two-step-trigger").hide(),{tcb_js:"undefined"!=typeof TCB_Front?1:0,main_group_id:TL_Const.main_group_id,shortcode_ids:TL_Const.shortcode_ids,two_step_ids:TL_Const.two_step_ids,action:"tve_leads_ajax_load_forms",security:TL_Const.security,display_options:TL_Const.display_options,current_screen:TL_Const.current_screen});return ThriveGlobal.$j.each(TL_Const.custom_post_data,(function(e,t){i[e]=t})),void(window.TVE_Dash&&!TVE_Dash.ajax_sent?ThriveGlobal.$j(document).on("tve-dash.load",(function(e){TVE_Dash.add_load_item("tl_lazy_load",i,TL_Front.ajax_load_callback)})):ThriveGlobal.$j.ajax({url:TL_Const.ajax_url,type:"post",dataType:"json",data:i,xhrFields:{withCredentials:!0}}).done(TL_Front.ajax_load_callback))}s()}function s(){if(!TL_Const.forms)return!1;function e(e){if(e.find('[data-validation="email"]').length)return e.find('[data-validation="email"]').val();var t="";return e.find("input").each((function(){if(this.name&&this.name.match(/email/i))return t=this.value,!1})),t}ThriveGlobal.$j("body").on("submit",".tve-leads-conversion-object form",(function(t){var o=ThriveGlobal.$j(this),r=o.parents(".tve-leads-conversion-object").first().attr("data-tl-type"),n={};if(o.data("tve-force-submit")||o.closest(".thrv_custom_html_shortcode").length||o.data("tl-do-submit")||!r||!TL_Const.forms[r]||function(e){var t=e.attr("id"),o=window.fluentFormVars,r=!1;return o&&o.forms&&(r=o.forms.some((function(e){return e.form_id_selector===t}))),r}(o)||function(e){var t=e.attr("id");return t&&t.includes("happyforms")&&window.HappyForms}(o))return!0;o.tve_form_loading(),o.find("input").each((function(){var e=ThriveGlobal.$j(this),t=e.attr("name");void 0!==t&&-1===TL_Const.ignored_fields.indexOf(t)&&(n[e.attr("name")]=e.val())}));var i={security:TL_Const.security,action:TL_Const.action_conversion,type:r,tl_data:TL_Const.forms[r],custom_fields:n,email:e(o),current_screen:TL_Const.current_screen};return ThriveGlobal.$j.each(TL_Const.custom_post_data,(function(e,t){i[e]=t})),ThriveGlobal.$j.ajax({url:TL_Const.ajax_url,data:i,type:"post",xhrFields:{withCredentials:!0}}).always((function(){void 0===o.attr("action")?location.reload():o.data("tve-force-submit",!0).submit()})),!1})),ThriveGlobal.$j("body").on("form_conversion.tcb",".tve-leads-conversion-object form",(function(e){var t=ThriveGlobal.$j(this).parents(".tve-leads-conversion-object").first().attr("data-tl-type");if(!t||!TL_Const.hasOwnProperty("forms")||!TL_Const.forms[t])return!0;var o={type:t,tl_data:TL_Const.forms[t],current_screen:TL_Const.current_screen};ThriveGlobal.$j.each(TL_Const.custom_post_data,(function(e,t){o[e]=t})),e.post_data=e.post_data||{},e.post_data.thrive_leads=o})).on("lead_conversion_success.tcb",".tve_lead_lock_shortcode form, .tve_post_lightbox form",(function(e){var t=ThriveGlobal.$j(this),o=t.parents(".tve_content_lock");if(t.closest(".tve_post_lightbox").length){var r=t.closest(".tve-leads-conversion-object").attr("data-tl-type");TL_Front.parent_state&&TL_Front.parent_state.parent().hasClass("tve-leads-track-"+r)&&(o=TL_Front.parent_state.closest(".tve_content_lock"))}o.length&&o.hasClass("tve_content_lock")&&(o.removeClass("tve_lead_lock").find(".tve_lead_lock_shortcode").remove(),o.find(".tve_lead_locked_overlay").remove(),e.content_unlocked=!0)})).on("leads_states.tcb",".tve-leads-conversion-object form",(function(e,t){var o=ThriveGlobal.$j(this);switch(o.find("#_form_type").val()){case"ribbon":var r=o.parents(".tve-leads-ribbon");o.parents(".tve_shortcode_editor").empty().html(t),TL_Front.open_ribbon(r);break;case"lightbox":case"tve_lead_2s_lightbox":o.parents(".tve_p_lb_control").empty().html(t);break;case"widget":case"in-content":case"post-footer":case"php-insert":o.parents(".tve_shortcode_editor").empty().html(t);break;case"slide-in":var n=o.parents(".tve-leads-slide-in");o.parents(".tve_shortcode_editor").empty().html(t),TL_Front.open_slide_in(n);break;case"screen-filler-lightbox":var i=o.parents(".tve-leads-screen-filler");o.parents(".tve_shortcode_editor").empty().html(t),TL_Front.open_screen_filler(i);break;case"scroll-mat":r=o.parents(".tve-leads-greedy_ribbon"),o.parents(".tve_shortcode_editor").empty().html(t),TL_Front.open_ribbon(r);break;case"tve_lead_shortcode":o.parents(".tve-leads-shortcode").empty().html(t);break;default:e.change_states=!1}e.change_states=!0})).on("leads_messages.tcb",".tve-leads-conversion-object form",(function(e){var t=ThriveGlobal.$j(this);switch(t.find("#_form_type").val()){case"tve_lead_shortcode":e.lightbox_state&&t.parents(".tve-leads-shortcode").hide();break;case"ribbon":t.parents(".thrv-ribbon").find(".tve-ribbon-close").click();break;case"lightbox":case"tve_lead_2s_lightbox":t.parents(".tve_p_lb_content").find(".tve_p_lb_close").click(),t.parents(".tve-leads-screen-filler").find(".tve-screen-filler-close").click();break;case"slide-in":t.parents(".thrv-leads-slide-in").find(".tve-leads-close").click();break;case"screen-filler-lightbox":t.parents(".tve-leads-screen-filler").find(".tve-screen-filler-close").click();break;case"scroll-mat":t.parents(".thrv-greedy-ribbon").find(".tve_et_click").click();break;default:t.find('input:not(:hidden):not([type="checkbox"]):not([type="radio"])').val("")}t.parents(".tve-leads-conversion-object").find(".tve_ea_thrive_leads_form_close").click(),TL_Front.parent_state&&TL_Front.close_form(TL_Front.parent_state)})),TL_Front.$document.on("switchstate",(function(e,t){t.find("script.tcb-lazyload-template").each((function(){ThriveGlobal.$j(this).replaceWith(this.innerHTML)}))}))}})),TL_Front.switch_lightbox_state=function(e,t){return e.find(".tve_p_lb_overlay").css("opacity","0.8"),e.find(".tve_p_lb_content").css("top",t.find(".tve_p_lb_content").css("top")).addClass("tve-leads-triggered"),window.tve_lb_switch_state=!0,TL_Front.open_lightbox(e.find(".tl-lb-target"))},TL_Front.close_lightbox=function(){var o=ThriveGlobal.$j("body"),r=ThriveGlobal.$j("html"),n="tve-o-hidden tve-l-open tve-hide-overflow",i=arguments[0]||o.data("tl-open-lightbox");i&&i.length&&(i.find(".tve-tl-anim").removeClass("tve-leads-triggered"),window.tve_lb_switch_state||(1===ThriveGlobal.$j(".tve_lb_open").length&&(o.removeClass(n).css("padding-right",""),r.removeClass(n),i.data("doc-scroll-top")?(document.documentElement.scrollTop=i.data("doc-scroll-top"),i.data("doc-scroll-top","")):i.data("bdy-scroll-top")&&(document.body.scrollTop=i.data("bdy-scroll-top"),i.data("bdy-scroll-top",""))),r.removeClass(r.data("tl-anim-class"))),window.tve_lb_switch_state=!1,setTimeout((function(){i.addClass("tve_lb_closing"),i.removeClass("tve_lb_open tve_lb_opening tve_lb_closing tve_p_lb_background").css("display","none").find("tve_p_lb_content").trigger("tve.lightbox-close")}),200),i.find(e+", "+t).each((function(){var e=ThriveGlobal.$j(this);"SOURCE"===this.tagName&&e.parent("video").trigger("pause"),e.attr("data-src",e.attr("src")),e.attr("src","")})),TL_Front.handle_typefocus(i,"pause"),ThriveGlobal.$j("#tve-lg-error-container").hide())},TL_Front.open_lightbox=function(o,r){if(!o.hasClass("tve_lb_open")&&!o.hasClass("tve_lb_opening")){var n=window.tve_lb_switch_state;ThriveGlobal.$j.fn.thrive_iphone_placeholder&&o.find("input[placeholder]").thrive_iphone_placeholder(),TL_Front.close_lightbox(ThriveGlobal.$j(".tve_p_lb_background.tve_lb_open")),o.css({visibility:"",position:"",left:"",display:""}).parents(".tl-style").css({visibility:"",position:"",left:"",display:""});var i,s,a,l,c,d=ThriveGlobal.$j("body"),_=ThriveGlobal.$j("html"),v="tve-o-hidden tve-l-open tve-hide-overflow",p=(i=ThriveGlobal.$j,s={border:"none",height:"200px",margin:"0",padding:"0",width:"200px"},a=i("<div>").css(i.extend({},s)),l=i("<div>").css(i.extend({left:"-1000px",overflow:"scroll",position:"absolute",top:"-1000px"},s)).append(a).appendTo("body").scrollLeft(1e3).scrollTop(1e3),c={height:l.offset().top-a.offset().top||0,width:l.offset().left-a.offset().left||0},l.remove(),c).width,h=parseInt(d.css("paddingRight")),f=ThriveGlobal.$j(".tve_p_lb_background.tve_lb_open").length;isNaN(h)&&(h=0),o.find(".tve_p_lb_close").off().on("click",(function(){return TL_Front.close_lightbox(),!1})),d.off("keyup.tve_lb_close").on("keyup.tve_lb_close",(function(e){if(27==e.which)return TL_Front.close_lightbox(),!1})),o.find(".tve_p_lb_overlay").off("click.tve_lb_close").on("click.tve_lb_close",(function(){return TL_Front.close_lightbox(),!1})),d.data("tl-open-lightbox",o),o.addClass("tve_p_lb_background"),o.data("doc-scroll-top",document.documentElement.scrollTop),o.data("bdy-scroll-top",document.body.scrollTop),d.addClass(v),_.addClass(v);var b=window.innerHeight<ThriveGlobal.$j(document).height();!n&&b&&d.css("padding-right",h+p+"px"),o.find(e+", "+t).each((function(){var e=jQuery(this);e.attr("data-src")&&e.attr("src",e.attr("data-src"))})),o.find(".thrv_responsive_video").each((function(){var e=ThriveGlobal.$j(this);TCB_Front.makeAutoplayVideo(e)}));var T="";ThriveGlobal.$j.each(o.parents(".tl-states-root").attr("class").split(" "),(function(e,t){if(0===t.indexOf("tl-anim"))return T=t,!1})),_.addClass(T).data("tl-anim-class",T),setTimeout((function(){function e(){var e=o.find(".tve_p_lb_content").outerHeight(!0)+2*parseInt(o.css("padding-top")),t=o.find(".tve_p_lb_content"),r=window.innerHeight,n=(r-e)/2;o.find(".tve_p_lb_overlay").css({height:e+80+"px","min-height":r+"px"}),f?t.animate({top:n<40?40:n},100):t.css("top",(n<40?40:n)+"px"),e+40>r&&o.addClass("tve-scroll")}setTimeout((function(){o.addClass("tve_lb_opening")}),0),o.find("iframe").not(".thrv_social_default iframe").each((function(){var e=ThriveGlobal.$j(this);!e.data("tve_ifr_loaded")&&e.attr("data-src")&&e.data("tve_ifr_loaded",1).attr("src",e.attr("data-src"))})),TCB_Front.resizePageSection(),e(),ThriveGlobal.$j(window).on("resize",e)}),20),setTimeout((function(){o.removeClass("tve_lb_opening").addClass("tve_lb_open").find(".tve_p_lb_content").trigger("tve.lightbox-open"),o.find("form").each((function(){ThriveGlobal.$j(this).find('input[required], textarea[required], select[required], input[data-required="true"], textarea[data-required="true"], select[data-required="true"]').each((function(){var e=ThriveGlobal.$j(this);"none"===e.css("display")&&e.show(),"hidden"===e.css("visibility")&&e.css("visibility","visible"),e.parentsUntil(".tve_p_lb_content").filter((function(){return"none"===ThriveGlobal.$j(this).css("display")||"hidden"===ThriveGlobal.$j(this).css("visibility")})).show().css("visibility","visible");var t=e.attr("tabindex");t&&parseInt(t)<0&&e.removeAttr("tabindex")}))})),ThriveGlobal.$j(window).trigger("scroll")}),300),r&&r.preventDefault&&(r.preventDefault(),r.stopPropagation()),o.parents(".tl-states-root").off("switchstate").on("switchstate",(function(e,t){var o=Array.prototype.slice.call(arguments,1);TL_Front.switch_lightbox_state.apply(TL_Front,o)})),r&&"exit"===r.tve_trigger&&o.data("shown-on-exit",!0),TCB_Front.$window.trigger("tl_after_lightbox_open",o),setTimeout((function(){TCB_Front.$window.trigger("tve_after_content_toggle",[o])}),500)}},TL_Front.open_two_step_lightbox=TL_Front.open_lightbox,TL_Front.open_ribbon=function(e){function t(){e.addClass("tve-leads-triggered");var t=e.find(".tve_shortcode_editor"),o=t.length?t.outerHeight():0,r=e.attr("data-position")||"top";switch(r){case"above":e.css("bottom","auto");case"top":e.css("top",ThriveGlobal.$j("#wpadminbar").length?"32px":"0px");break;case"bottom":e.css("bottom","0px"),e.css("top","auto")}var n=0,i=Math.max(e.outerHeight(),o),s=setInterval((function(){n++;var t=Math.max(e.outerHeight(),o);t==i&&10!=n||clearInterval(s),"top"===r?(ThriveGlobal.$j("body").animate({"margin-top":t+"px"},200,(function(){document.body.style.setProperty("margin-top",t+"px","important")})),TCB_Front&&TCB_Front.$window&&TCB_Front.$window.trigger("scroll")):"bottom"===r&&ThriveGlobal.$j("body").animate({"margin-bottom":t+"px"},200)}),100),a=ThriveGlobal.$j("body").find(".thrv_header.tve-scroll-sticky");if(a.length&&"top"===r){var l=parseFloat(TCB_Front.inlineCssVariable(a,"--tcb-header-extra-offset"))||0;TCB_Front.inlineCssVariable(a,"--tcb-header-extra-offset",l+i+"px")}e.off("switchstate").on("switchstate",(function(e,t){var o=Array.prototype.slice.call(arguments,1);TL_Front.switch_ribbon_state.apply(TL_Front,o)}))}TL_Const.forms.greedy_ribbon?(TL_Const.close_callbacks=TL_Const.close_callbacks||{},TL_Const.close_callbacks.greedy_ribbon=[t]):t()},TL_Front.switch_ribbon_state=function(e){var t=e.outerHeight(!0),o={};o["top"===e.parent().attr("data-position")?"margin-top":"margin-bottom"]=t+"px",e.find(".tve-tl-anim").removeClass((function(e,t){return(t.match(/(^|\s)tl-anim-\S+/g)||[]).join(" ")})).removeClass("tve-tl-anim"),ThriveGlobal.$j("body").animate(o,200)},TL_Front.open_greedy_ribbon=function(o){var r=ThriveGlobal.$j("body"),n=ThriveGlobal.$j(window),i=r.css("position");n.scrollTop(0),r.css("position","static"),r.addClass("tve-tl-gr-anim"),TCB_Front.$window.trigger("scroll"),o.css("top",ThriveGlobal.$j("#wpadminbar").length?"32px":"0px");var s=o.outerHeight();r[0].style.setProperty("margin-top",s+"px","important");var a=1;setTimeout((function(){ThriveGlobal.$j('.tve-leads-ribbon[data-position="top"]').removeClass("tve-leads-triggered")}),50),n.scroll((function(){var l=r.hasClass("tve-tl-gr-anim");if(a&&l){var c=n.scrollTop();if(c>s){(o.find(".tve_ea_thrive_wistia").length||o.find(".tve_with_wistia_popover"))&&ThriveGlobal.$j(".wistia_placebo_close_button").trigger("click"),r.removeClass("tve-tl-gr-anim"),o.addClass("tve-no-animation");var d=c-s;o.removeClass("tve-leads-triggered"),o.find(e+", "+t).each((function(){var e=ThriveGlobal.$j(this);e.attr("data-src",e.attr("src")),e.attr("src","")})),r.css("margin-top",""),r.css("position",i),n.scrollTop(d),o.removeClass("tve-no-animation"),a=0,TL_Front.form_closed("greedy_ribbon"),TL_Const.forms.greedy_ribbon.allow_callbacks=!1}}})),o.off("switchstate").on("switchstate",(function(e,t){}))},TL_Front.open_screen_filler=function(o,r){var n="tve-so-hidden tve-sl-open tve-s-hide-overflow",i=ThriveGlobal.$j("html,body"),s=ThriveGlobal.$j("html");if(ThriveGlobal.$j.fn.thrive_iphone_placeholder&&o.find("input[placeholder]").thrive_iphone_placeholder(),o.css("top",ThriveGlobal.$j("#wpadminbar").length?"32px":"0px").css("visibility",""),!0===o.hasClass("stl-anim-slip_from_top")){var a=ThriveGlobal.$j(window).scrollTop();o.css("top",a).css("visibility","")}o.find(".tve-screen-filler-close").on("click",(function(){c(o)})),o.data("doc-scroll-top",document.documentElement.scrollTop),o.data("bdy-scroll-top",document.body.scrollTop),"none"!==o.find(".thrv-leads-screen-filler.thrv_wrapper ").css("display")&&i.addClass(n);var l="";function c(o){o.find(e+", "+t).each((function(){var e=ThriveGlobal.$j(this);e.attr("data-src",e.attr("src")),e.attr("src","")})),o.removeClass("tve-leads-triggered"),TL_Front.handle_typefocus(o,"pause"),ThriveGlobal.$j(document).off("keyup.close-screenfiller"),0==ThriveGlobal.$j.find(".tve-leads-ribbon").length&&ThriveGlobal.$j("body").animate({"margin-top":"0px"},200),i.removeClass(n),s.removeClass(s.data("tl-s-anim-class")),setTimeout((function(){o.css("top","").hide(),"none"===o.css("display")&&(i.removeClass(n),o.removeClass("tve-leads-triggered"))}),400),o.data("doc-scroll-top")?(document.documentElement.scrollTop=o.data("doc-scroll-top"),o.data("doc-scroll-top","")):o.data("bdy-scroll-top")&&(document.body.scrollTop=o.data("bdy-scroll-top"),o.data("bdy-scroll-top","")),ThriveGlobal.$j("#tve-lg-error-container").hide()}ThriveGlobal.$j.each(o.attr("class").split(" "),(function(e,t){if(0===t.indexOf("stl-anim"))return l=t,!1})),s.addClass(l).data("tl-s-anim-class",l);var d=o.find("> .tl-style").hide(),_=o.find('> .tl-style[data-form-state="already_subscribed"]');_.length?_.show():d.first().show(),TL_Front.close_screen_filler=c,r&&r.preventDefault&&(r.preventDefault(),r.stopPropagation()),ThriveGlobal.$j(document).off("keyup.close-screenfiller").on("keyup.close-screenfiller",(function(e){27==e.which&&c(o)})),o.find(e+", "+t).each((function(){var e=jQuery(this);e.attr("data-src")&&e.attr("src",e.attr("data-src"))})),setTimeout((function(){TCB_Front.resizePageSection()}),500)},TL_Front.switch_slide_in_state=function(e){e.find(".tve-tl-anim").removeClass((function(e,t){return(t.match(/(^|\s)tl-anim-\S+/g)||[]).join(" ")})).removeClass("tve-tl-anim"),TL_Front.slide_in_position(e.find(".thrv-leads-slide-in"))},TL_Front.slide_in_position=function(e){var t=ThriveGlobal.$j(window),o=e.outerHeight();if(t.width()<=782||t.height()<o){e.parents(".tve-leads-slide-in").addClass("tve-lb");var r=t.height();setTimeout((function(){var t;t=e.parents(".tve-leads-slide-in").is('[class*="bot"]')?r-o:0,e.closest(".tve-leads-slide-in").data("doc-scroll-top",document.documentElement.scrollTop).data("bdy-scroll-top",document.body.scrollTop),e.parents(".tve-leads-conversion-object").first().css({height:o+80+"px","min-height":r+"px"}),e.css("top",(t<40?40:t)+"px"),o+40>r&&e.parents(".tve-leads-slide-in").css("overflow-y","scroll")}),0)}},TL_Front.open_slide_in=function(o,r){var n="tve-o-hidden tve-l-open tve-hide-overflow",i=ThriveGlobal.$j("body"),s=ThriveGlobal.$j("html");function a(r){r.removeClass("tve-leads-triggered"),TL_Front.handle_typefocus(r,"pause"),ThriveGlobal.$j(document).off("keyup.close-slidein"),ThriveGlobal.$j(".tve_lb_open").length||(i.removeClass(n),s.removeClass(n)),r.find(e+", "+t).each((function(){var e=ThriveGlobal.$j(this);e.attr("data-src",e.attr("src")),e.attr("src","")})),ThriveGlobal.$j("#tve-lg-error-container").hide(),o.data("doc-scroll-top")?(document.documentElement.scrollTop=o.data("doc-scroll-top"),o.data("doc-scroll-top","")):o.data("bdy-scroll-top")&&(document.body.scrollTop=o.data("bdy-scroll-top"),o.data("bdy-scroll-top",""))}ThriveGlobal.$j.fn.thrive_iphone_placeholder&&o.find("input[placeholder]").thrive_iphone_placeholder(),TL_Front.slide_in_position(o.find(".thrv-leads-slide-in").filter(":visible")),o.off().on("click",".tve-leads-close",(function(){a(o)})),o.find(".tve_ea_thrive_leads_form_close").on("click",(function(){a(o)})),o.on("switchstate",(function(e,t){var o=Array.prototype.slice.call(arguments,1);TL_Front.switch_slide_in_state.apply(TL_Front,o)})),ThriveGlobal.$j(document).off("keyup.close-slidein").on("keyup.close-slidein",(function(e){27==e.which&&a(o)})),r&&r.preventDefault&&(r.preventDefault(),r.stopPropagation())},TL_Front.close_form=function(o,r,n,i){var s=ThriveGlobal.$j(o).parents(".tve-leads-triggered"),a=s.attr("data-tl-type");if(void 0===a&&s.hasClass("tve-leads-widget"))a="widget";else if(void 0===a&&s.hasClass("tve-leads-post-footer"))a="post-footer";else if(void 0===a&&s.hasClass("tve-leads-slide-in"))a="slide-in";else if(void 0===a&&s.hasClass("tve-leads-in-content"))a="in-content";else if(void 0===a&&s.hasClass("tve-leads-shortcode"))a="shortcode";else if(void 0===a&&s.hasClass("tve-leads-greedy_ribbon"))a="greedy_ribbon";else{if(void 0===a&&s.hasClass("tve_p_lb_content"))return TL_Front.close_lightbox(),!1;if(void 0===a&&s.hasClass("tve-leads-screen-filler"))return TL_Front.close_screen_filler(s),!1}switch(s.removeClass("tve-leads-triggered"),TL_Front.handle_typefocus(s,"pause"),a){case"ribbon":var l=s.find(".tve-ribbon-close");l.length||(l=jQuery('<span class="tve-ribbon-close" style="display: none"></span>').appendTo(s)),l.trigger("click");var c=ThriveGlobal.$j("body").find(".thrv_header.tve-scroll-sticky");if(c.length&&"top"===s.attr("data-position")){var d=parseFloat(TCB_Front.inlineCssVariable(c,"--tcb-header-extra-offset"))-s.outerHeight(!0)+"px";TCB_Front.inlineCssVariable(c,"--tcb-header-extra-offset",d)}break;case"slide-in":s.find(".tve_ea_thrive_leads_form_close").trigger("click"),s.find(e+", "+t).each((function(){var e=ThriveGlobal.$j(this);e.attr("data-src",e.attr("src")),e.attr("src","")}));break;case"post-footer":case"in-content":case"shortcode":s.fadeOut(200,(function(){TL_Front.form_closed(a)}));break;case"widget":s.parent().slideUp(200);break;case"greedy_ribbon":var _=ThriveGlobal.$j("body"),v=ThriveGlobal.$j(window),p=_.css("margin-top");_[0].style.removeProperty("margin-top"),s.find(e+", "+t).each((function(){var e=ThriveGlobal.$j(this);e.attr("data-src",e.attr("src")),e.attr("src","")})),_.css("margin-top",p),v.scrollTop(0),_.animate({"margin-top":"0px"},300,"linear",(function(){TL_Front.form_closed(a)})).removeClass("tve-tl-gr-anim")}},TL_Front.form_closed=function(e){TL_Const.close_callbacks&&TL_Const.close_callbacks[e]&&ThriveGlobal.$j.each(TL_Const.close_callbacks[e],(function(e,t){ThriveGlobal.$j.isFunction(t)&&t()}))},TL_Front.handle_typefocus=function(e,t){e.find(".tve_typefocus").each((function(){jQuery(this).attr("data-typefocus",t)}))}})();
(()=>{if(window.TVE_Dash=window.TVE_Dash||{},!e||!e.$j){var a=window.$,e={$j:jQuery.noConflict()};a&&(window.$=a)}!function(a){TVE_Dash.ajax_sent=!1;var t={},s={};TVE_Dash.add_load_item=function(e,n,o){var r;if("function"!=typeof o&&(o=a.noop),TVE_Dash.ajax_sent){var i={},_={};return i[e]=n,_[e]=o,this.send_ajax(i,_),!0}return n?(t[e]&&"function"==typeof(null===(r=console)||void 0===r?void 0:r.warn)&&console.warn(e+" ajax action already defined"),t[e]=n,s[e]=o,!0):(console.error&&console.error("missing ajax data"),!1)},TVE_Dash.ajax_load_css=function(e){a.each(e,function(e,t){a("link#"+(e+="-css")).length||a('<link rel="stylesheet" id="'+e+'" type="text/css" href="'+t+'"/>').appendTo("head")})},TVE_Dash.ajax_load_js=function(e){var t=document.body;a.each(e,function(s,n){if(-1!==s.indexOf("_before"))return!0;var o=document.createElement("script");e[s+"_before"]&&a('<script type="text/javascript">'+e[s+"_before"]+"<\/script>").after(t.lastChild),s&&(o.id=s+"-script"),o.src=n,t.appendChild(o)})},TVE_Dash.send_ajax=function(t,s){a.ajax({url:tve_dash_front.ajaxurl,xhrFields:{withCredentials:!0},data:{post_id:tve_dash_front.post_id,action:"tve_dash_front_ajax",tve_dash_data:t},dataType:"json",type:"post"}).done(function(t){t&&a.isPlainObject(t)&&(t.__resources&&(t.__resources.css&&TVE_Dash.ajax_load_css(t.__resources.css),t.__resources.js&&TVE_Dash.ajax_load_js(t.__resources.js),delete t.__resources),a.each(t,function(a,e){if("function"!=typeof s[a])return!0;s[a].call(null,e,t)}),e.$j(window).trigger("tve_after_ajax_load"))})},TVE_Dash.forceImageLoad=function(a){Array.prototype.forEach.call(a.getElementsByTagName("img"),a=>{a.getAttribute("src").includes("data:image")&&a.setAttribute("src",a.getAttribute("data-opt-src")||a.getAttribute("data-src"))})},a(function(){window.TVE_Dash=window.TVE_Dash||TVE_Dash,setTimeout(function(){var e=new a.Event("tve-dash.load");return a(document).trigger(e),!a.isEmptyObject(t)&&!(!tve_dash_front.force_ajax_send&&tve_dash_front.is_crawler)&&(TVE_Dash.send_ajax(t,s),void(TVE_Dash.ajax_sent=!0))})})}(e.$j)})();
void 0===TCB_Front.js_modules["post-grid-compat"]&&TCB_Front.setModuleLoadedStatus("post-grid-compat",!1),(t=>{if(TCB_Front.isModuleLoaded("post-grid-compat"))return;window.addEventListener("load",function(){o.postGridLayout()});const o={postGridLayout(){try{t(".tve_post_grid_masonry,.tcb-post-list.masonry").each(function(){const o=this.dataset.masonry?JSON.parse(this.dataset.masonry):{},s=TCB_Front.getDisplayType()[0];void 0!==o[`gutter-${s}`]&&(o.gutter=parseInt(o[`gutter-${s}`])),t(this).masonry(o).css("opacity",1)})}catch(t){console.log(t)}const o=t(".tve_post_grid_grid");o.length<=0||o.find(".tve_pg_row").each(function(){let o=0;const s=t(this).css("height","");s.find(".tve_post").each(function(){const s=t(this),e=s.outerHeight();e>o&&(o=e),s.css("height","100%")}),s.css("height",o-1+"px")})}};t(window).on("tcb_after_dom_ready",()=>{o.postGridLayout(),TCB_Front.Utils.isEditorPage()||TCB_Front.addResizeCallback(o.postGridLayout)}).on("tcb_toggle_open",()=>o.postGridLayout()).on("tl_form_opened",()=>o.postGridLayout()).on("tcb_on_content_show",()=>o.postGridLayout()).on("tcb_before_lightbox_reposition",()=>o.postGridLayout()).on("tcb_post_list_after_item_insert",()=>o.postGridLayout()).on("tcb_off_screen_sidebar_toggle",()=>o.postGridLayout()),window.TCB_Front.postGridLayout=o.postGridLayout,TCB_Front.setModuleLoadedStatus("post-grid-compat",!0)})(ThriveGlobal.$j);
void 0===TCB_Front.js_modules.dropdown&&TCB_Front.setModuleLoadedStatus("dropdown",!1),(t=>{if(TCB_Front.isModuleLoaded("dropdown"))return;const e=".tve_lg_dropdown, .tcb-form-dropdown, .tve-dynamic-dropdown";t(window).on("tcb_after_dom_ready",()=>{if(!TCB_Front.Utils.isEditorPage()){const e=t(TCB_Front.Utils.isEditorPage()?"#tve_editor":"body");TCB_Front.Utils.initDropdown(e)}}),TCB_Front.Utils.initDropdown=o=>{t(".tve_lg_dropdown .tve-lg-dropdown-trigger, .tcb-form-dropdown .tve-lg-dropdown-trigger, .tve-dynamic-dropdown .tve-lg-dropdown-trigger").each(function(){t(this).attr("tabindex",-1).removeAttr("href").siblings("input").attr("style","position: absolute; opacity: 0;").attr("autocomplete","off")});let n="";const d=function(){n="",t(".tve-lg-dropdown-search").length&&t(".tve-lg-dropdown-search").val(""),t(".tve-lg-dropdown-option.tve-state-hover,.tve-dynamic-dropdown-option.tve-state-hover").removeClass("tve-state-hover")},r=function(t,e){e.find(".tve-lg-dropdown-trigger").find(".tve-disabled-text-inner").html(t.text()),e.find("input").attr("value",t.attr("data-value")).val(t.attr("data-value")),e.find(".tve-state-active").removeClass("tve-state-active tve-state-hover"),t.addClass("tve-state-active tve-state-hover"),e.find(".tve-lg-dropdown-list").animate({scrollTop:t.prevAll().length*t.outerHeight()},100),e.find("input").trigger("change"),e.trigger("tcb.dropdown_value_changed")};o.off("mousedown.dropdownclick").on("mousedown.dropdownclick",e,function(o){const n=t(o.currentTarget).next();if(n.hasClass("tve-lg-dropdown-message-after")&&n.remove(),o.currentTarget.classList.contains("tve-lg-field-disabled")){if(o.currentTarget.dataset.tveMessages){const e=JSON.parse(o.currentTarget.dataset.tveMessages);if(e.disabledReasonMessage){const n=document.createElement("div");n.classList.add("tve-lg-dropdown-message-after"),n.innerHTML=e.disabledReasonMessage,t(n).insertAfter(o.currentTarget)}}return}if(o.target.classList.contains("tve-lg-dropdown-input"))return;const d=t(this).closest(e),r=d.find(".tve-lg-dropdown-search");if(d.toggleClass("tve-state-expanded"),d.hasClass("tve-state-expanded")&&(r.length>0?r.find("input").trigger("focus"):d.find("input").trigger("focus")),o.target.classList.contains("tve-lg-dropdown-list")||o.target.closest(".tve-lg-dropdown-search"))return d.find(".tve-lg-dropdown-search input").trigger("focus"),!1;d.find(".tve-lg-dropdown-search").toggleClass("tve_display"),r.length&&d.find(".tve-lg-dropdown-search input").val(""),o.stopPropagation(),o.preventDefault()}).off("blur.dropdownblur").on("blur.dropdownblur",".tve_lg_dropdown input, .tcb-form-dropdown input, .tve-dynamic-dropdown input",function(o){o.stopPropagation(),o.preventDefault(),d(),this.closest(e).classList.remove("tve-state-expanded"),t(this).closest(e).find(".tve-lg-dropdown-search").removeClass("tve_display")}).off("keydown.dropdownkeypress").on("keydown.dropdownkeypress",".tve_lg_dropdown input, .tcb-form-dropdown input, .tve-dynamic-dropdown input",function(t){if(13===t.keyCode)return t.preventDefault(),!1}).off("keyup.dropdownkeypress").on("keyup.dropdownkeypress",".tve_lg_dropdown input, .tcb-form-dropdown input, .tve-dynamic-dropdown input",function(o){const s=t(this).closest(e),a=s.find(".tve-state-active"),i=s.find(".tve-lg-dropdown-search");switch(0===i.length&&9!==o.keyCode&&(o.stopPropagation(),o.preventDefault()),o.keyCode){case 13:s.toggleClass("tve-state-expanded"),i.length&&i.toggleClass("tve_display"),d();break;case 38:0===a.length?r(s.find(".tve-lg-dropdown-option,.tve-dynamic-dropdown-option").last(),s):a.prev().length&&r(a.prev(),s);break;case 40:0===a.length?r(s.find(".tve-lg-dropdown-option,.tve-dynamic-dropdown-option").first(),s):a.next().length&&r(a.next(),s);break;default:if(0===i.length?n+=String.fromCharCode(o.keyCode).toLowerCase():n=s.find(".tve-lg-dropdown-input").val().toLowerCase(),t(".tve-lg-dropdown-option.tve-state-hover,.tve-dynamic-dropdown-option.tve-state-hover").removeClass("tve-state-hover"),""===n)s.find(".tve-lg-dropdown-list").animate({scrollTop:0},300);else{const e=".tve-lg-dropdown-option, .tve-dynamic-dropdown-option",o=t(".tve-lg-dropdown-list"),d=t=>{o.animate({scrollTop:t.prevAll().length*t.outerHeight()},100),t.addClass("tve-state-hover")},r=s.find(e).filter(function(){return this.dataset.value.toLowerCase().startsWith(n)}).first(),a=r.length?t():s.find(e).filter(function(){return this.dataset.value.toLowerCase().includes(n)}).first();r.length?d(r):a.length&&d(a)}}}),o.off("mousedown.dropdownoptionclick").on("mousedown.dropdownoptionclick",".tve-lg-dropdown-option,.tve-dynamic-dropdown-option",function(o){o.stopPropagation(),o.preventDefault();const n=t(this),d=n.closest(e);r(n,d),d.removeClass("tve-state-expanded"),this.dataset.customOption&&d.find("input").trigger("changevalue.tveDropdown",this)})},TCB_Front.setModuleLoadedStatus("dropdown",!0)})(ThriveGlobal.$j);
(()=>{var t={74208(t){void 0===TCB_Front.js_modules.menu&&TCB_Front.setModuleLoadedStatus("menu",!1),function(e,n){if(TCB_Front.isModuleLoaded("menu"))return;const i=t=>["auto","scroll","hidden"].includes(t.css("overflow"));let o;function s(t){return e(t).closest(".thrv_widget_menu")}const a={init(){tve_frontend_options.is_editor_page||a.frontendInit(),a.customMenuSwitchIcon(),o||(o=a.customMenuSwitchIcon.bind(this,!1),n.addResizeCallback(o)),a.zIndexOrder(),e(".thrv_widget_menu").each((t,e)=>{a.addMutationListener(e)}),a.handleHiddenItems()},handleHiddenItems(){e(".thrv_widget_menu ul").each((t,n)=>{const i=e(n),o=i.closest("li").find("> a .tve-item-dropdown-trigger"),s=this.hasVisibleItems(i);s||n.style.setProperty("display","none","important"),o.toggle(s)})},hasVisibleItems(t){let e=!1;return t.find("> li").each((t,n)=>{getComputedStyle(n).getPropertyValue("display").includes("none")||(e=!0)}),e},zIndexOrder(){const t=e("ul.tve_w_menu");n.highestZIndex=t.length+6;let i=n.highestZIndex;t.each(function(){this.style.zIndex=i+5;const t=e(this),n=t.closest("#content");t.find("ul").css("z-index",i+6).parent().addClass("menu-item-has-children"),t.parentsUntil("body,#wrapper,#tve_editor").each(function(){const t=e(this);let n=parseInt(t.css("z-index"));isNaN(n)&&(n=0),n=800===n?i+7:Math.max(n,i+7),"static"!==t.css("position")&&(this.style.setProperty("z-index",n,"important"),this.classList.add("tcb-mp"))}),n.length&&"static"!==n.css("position")&&n.css("z-index",i+7).addClass("tcb-mp"),i--})},frontendInit(t){const o=this;function s(t,i){const o=t.attr("href"),s=t[0]?t[0].hash:"",a=t.attr("target");if(s){let i;try{i=e(s)}catch(t){}i&&i.length&&n.jumpScrollTo(i,t[0])}a||i.ctrlKey||i.metaKey?window.open(o,a||"_blank"):location.href=o}(t=t||n.$document).off("click.menu-disable-links").on("click.menu-disable-links",".tve-active-disabled .tve_w_menu .tve-state-active",function(t){const n=e(this).closest("li");if(!a.isHamburger(this)||!n.hasClass("menu-item-has-children"))return t.tvePreventNavigation=!0,!1}),t.off("menu_item_anchor_clicked").on("menu_item_anchor_clicked",".tve_w_menu li",function(){const t=e(this);a.isHamburger(t)&&requestAnimationFrame(()=>{a.toggleState(t,!1)})}),t.off("click.menu_item_click").on("click.menu_item_click",".tve_w_menu li:not(.tve-regular .tcb-mega-drop li)",function(t){if(t.tvePreventNavigation)return!0;if(t.stopPropagation(),e(t.target).closest(".tve-regular .tcb-mega-drop").length)return!0;const n=e(this),l=n.children("a").first(),r=l[0],d=!!n.find("ul").length,c=e(t.target).closest(".tve-item-dropdown-trigger").length||e(t.clickedTarget).closest(".tve-item-dropdown-trigger").length,u=n.closest(".thrv_widget_menu").attr("class").includes("tve-custom-menu-switch-icon-"),h=n.closest(".tve_w_menu").hasClass("tve_vertical");if((u||h)&&d){if(!c&&n.hasClass("expand-children")&&function(t){const e=t.attr("href");return e&&"#"!==e&&0!==e.indexOf("javascript:")}(l))return l.hasClass("tve-jump-scroll")?l.trigger("click"):s(l,t),!1;n.toggleClass("expand-children");const e=n.find("ul").first(),a=n.hasClass("expand-children");o.hasVisibleItems(e)&&e[a?"slideDown":"slideUp"](100);const r=e.closest(".section-content,.tve-cb");if(i(r)){let t={top:"",left:"",width:""};if(a){const{top:n,left:i,width:o}=e[0].getBoundingClientRect();t={top:n,left:i,width:o},e.data("fixed-position",{top:n,scrollTop:r.scrollTop()})}e.toggleClass("fixed-menu-item",a).css(t)}return!1}if(d&&c)return!1;const m=n.children(".tve_et_click");return m.length>0?(m.trigger("click"),!0):!!l.attr("href")&&(l.hasClass("tve-jump-scroll")?(l.trigger("click"),!0):(s(l,t),void(a.isHamburger(n)&&r.pathname===window.location.pathname&&r.host===window.location.host&&r.protocol===window.location.protocol&&requestAnimationFrame(()=>{a.toggleState(n,!1)}))))}),t.off("click.prevent_navigation").on("click.prevent_navigation",".tve_w_menu li a:not(.thrv_text_element a):not(.tve-regular .tcb-mega-drop a)",function(t){t.preventDefault()}),t.off("click.custom_menu").on("click.custom_menu",".tve-m-trigger",function(){return a.toggleState(this),!1}),t.off("mousedown.close_menu").on("mousedown.close_menu",t=>{e(t.target).closest(".thrv_widget_menu").length||a.closeAll()}),n.addResizeCallback(a.customMenuResponsive),n.addResizeCallback(a.mobileResponsiveToggle),a.customMenuResponsive(),a.refreshActiveStates(t),TCB_Front.$window.off("hashchange.tcb").on("hashchange.tcb",a.refreshActiveStates.bind(a,TCB_Front.$body)),a.positionLogo(t),a.mobileResponsiveToggle(),t.find(".section-content,.tve-cb").each((t,n)=>{const o=e(n);i(o)&&o.off("scroll.menu").on("scroll.menu",t=>{o.find(".fixed-menu-item").each((n,i)=>{const o=e(i),s=o.data("fixed-position"),a=parseInt(s.top)+(s.scrollTop-t.currentTarget.scrollTop);o.css("top",`${a}px`)})})})},mobileResponsiveToggle(){"mobile"===n.getDisplayType()?(n.$body.find(".vmd-right").attr("data-toggle-dir","vmd-right").removeClass("vmd-right").addClass("vmd-toggle"),n.$body.find(".vmd-left").attr("data-toggle-dir","vmd-left").removeClass("vmd-left").addClass("vmd-toggle")):n.$body.find(".vmd-toggle").each((t,e)=>{const n=e.getAttribute("data-toggle-dir");n&&(e.classList.remove("vmd-toggle"),e.classList.add(n))})},refreshActiveStates(t=TCB_Front.$body){t.find(".tve-custom-menu-type li > a").each(function(){if(!this.getAttribute("href")||"#"===this.getAttribute("href")||0===this.getAttribute("href").indexOf("javascript"))return;const t=e(this),n=location.protocol===this.protocol&&location.hostname===this.hostname&&location.pathname===this.pathname&&location.hash===this.hash;t.toggleClass("tve-state-active",n),t.parent().toggleClass("tve-state-active",n)})},customMenuResponsive(){e(".tve-m-trigger:visible").length?e(".tve-m-trigger").each(function(){const t=e(this).parent().find("> ul");if(!t.data("tve-colors-added")&&t.find("ul a").attr("data-tve-custom-colour")){const n=t.find("ul a").attr("data-tve-custom-colour");t.find("> li > a").each(function(){const t=e(this);t.attr("data-tve-custom-colour")&&(t.attr("data-o-color",t.attr("data-tve-custom-colour")),t.attr("data-tve-custom-colour",n))})}t.data("tve-colors-added",!0)}):(e(".tve-m-expanded").removeClass("tve-m-expanded"),e(".tve-m-trigger").each(function(){const t=e(this).parent().find("> ul");if(!t.data("tve-colors-added")&&t.find("> li > a").attr("data-o-color")){const e=t.find("> li > a"),n=e.attr("data-o-color");e.attr("data-tve-custom-colour",n).removeAttr("data-o-color")}t.data("tve-colors-added",!1)}))},customMenuSwitchIcon(t=!0){const i=n.getDisplayType();e(".thrv_widget_menu").each(function(){const n=e(this),o=n.attr("data-tve-allhoriz");let s=n.attr("data-tve-switch-icon"),l=!1;const r=n.data("tve-frontend-init");n.data("tve-frontend-init",!0),s||o||(s="tablet,mobile");const d=s.split(","),c=n.hasClass("tve-regular")||!r&&!n.find(".tve-m-trigger").is(":visible");if(n.removeClass("tve-custom-menu-switch-icon-desktop tve-custom-menu-switch-icon-tablet tve-custom-menu-switch-icon-mobile"),t&&n.find("ul:not(.tcb-masonry.masonry)").removeAttr("style"),d.includes(i)?n.addClass(`tve-custom-menu-switch-icon-${i}`):l=!0,n.toggleClass("tve-regular",l),n.toggleClass("tve-dropdown",!l),n.find("li.menu-item").toggleClass("tcb-menu-img-hamburger",!l),r&&l&&c)return void a.ensureOnScreenDropdown(n);n.toggleClass("tve-regular",l),n.toggleClass("tve-dropdown",!l);const u=n.find(":not(.tve-ham-wrap) > ul.tve_w_menu, .tve-ham-wrap");if(l)a.ensureRegularLogoSplit(n),n.find("ul").removeAttr("style"),n.find("li").removeClass("expand-children"),n.find(".tve-m-expanded").removeClass("tve-m-expanded"),u.removeAttr("style"),setTimeout(()=>n.find(".tcb-masonry").masonry(),1e3);else{if(a.ensureHamburgerLogoSplit(n),n.find(".tcb-masonry").each(function(){const t=e(this);t.data("masonry")&&t.masonry("destroy")}),!n.data("calc-dimensions")){n.find(".sub-menu").slideDown(0).slideUp(0).removeAttr("style"),n.data("calc-dimensions",!0);const t=u.attr("style","height: auto !important;max-height:none !important").outerHeight();u.removeAttr("style"),n.data("calc-height",t)}t?a.toggleState(n,!1):a.reposition(n)}a.ensureOnScreenDropdown(n)})},isHamburger(t){const e=s(t);return e.length>0&&e.attr("class").includes("tve-custom-menu-switch-icon-")},isVertical(t){const e=s(t);return e.length>0&&e.find(".tve_vertical").length>0},toggleState(t,e,i=100){const o=s(t),l=o.find("ul").first();let r=o.find(".tve-ham-wrap");0===r.length&&(r=l);const d=r.hasClass("tve-m-expanded");let c=!d;if(!this.hasVisibleItems(l))return o;if(void 0!==e&&(c=e),c===d)return o;if(o.hasClass("tve-mobile-side-fullscreen")&&n.$body.toggleClass("tve-fullscreen-menu",c),o.find(".tve-m-trigger").toggleClass("tve-triggered-icon",e),c?o.parents(".tcb-mp").addBack().css("z-index",800):setTimeout(()=>{a.zIndexOrder()},100),!o.hasClass("tve-mobile-dropdown")){if(c&&tve_frontend_options.is_editor_page){const t=o.find(".tve-m-trigger");t.hasClass("close-offscreen-icon-available")||t.append(t.find(".tcb-icon-close").clone().removeClass("tcb-icon-close").addClass("tcb-icon-close-offscreen")).addClass("close-offscreen-icon-available ")}return r.toggleClass("tve-m-expanded",e).removeAttr("style"),o}if(c){r.css("display","flex");const t=this.getMenuPositionalParent(o),e=parseInt(o.data("calc-height")||"500")+"px",s=n.getDisplayType(),a=n.getMediaAttr(o,"data-dropdown-position",s),l="full"===a?window.innerWidth||document.documentElement.clientWidth:t.outerWidth(),d=this.getMenuDropdownPosition(o,r,l);r.attr("style",`visibility: visible;display: flex;margin-left: 0 !important;${d}width:${l}px !important;max-height:${e}px`),r.addClass("tve-m-expanded");const c=o.hasClass("tve-mobile-dropdown");"tablet"===s&&c&&["full","left","right","center"].includes(a)&&requestAnimationFrame(()=>{const t=r.outerWidth(),e=this.calculateViewportBasedPosition(a,t,l,o);r.css("left",`${e}px`)}),setTimeout(()=>{r.css("max-height","none")},i)}else o.data("calc-height",r.outerHeight()),r.stop().slideUp(i,()=>{r.removeClass("tve-m-expanded").removeAttr("style"),r.css("visibility","hidden")});return o},calculateViewportBasedPosition(t,e,n,i){const o=i.offset(),s=window.innerWidth||document.documentElement.clientWidth;let a;if("left"===t)a=-o.left;else if("right"===t)a=s-o.left-e;else if("full"===t&&e>=n)a=-o.left;else{const t=e/2;a=s/2-o.left-t}return a},getEffectiveMenuWidth(t,e){let n=e;const i=t.find(".tve_w_menu").first(),o=i.length>0?i:t;let s=o.css("max-width");if((!s||"none"===s)&&window.getComputedStyle&&o[0]){const t=window.getComputedStyle(o[0]).getPropertyValue("--tve-set-max-width");t&&(s=t.trim())}if(s&&"none"!==s){const t=parseFloat(s);!isNaN(t)&&t<e&&(n=t)}return n},getMenuDropdownPosition(t,e,i){const o=n.getDisplayType();let s=n.getMediaAttr(t,"data-dropdown-position",o);const a=t.find(".tve-m-trigger .tcb-icon-close"),l=a.offset(),r=t.offset();let d="";const c=t.hasClass("tve-mobile-dropdown");switch(e.is("ul")&&(e=this.getMenuPositionalParent(t),s="full"),"mobile"===o&&(s="full"),s){case"left":d="tablet"===o&&c?`left:${-r.left}px;right:unset;`:`right: ${parseInt(r.left+t.outerWidth()-l.left-a.outerWidth())}px;left: unset;`;break;case"right":if("tablet"===o&&c){const t=i;d=`left:${(window.innerWidth||document.documentElement.clientWidth)-r.left-t}px;right:unset;`}else d=`left: ${parseInt(l.left-r.left)}px;right:unset;`;break;case"full":if("tablet"===o&&c){const t=window.innerWidth||document.documentElement.clientWidth,n=this.getEffectiveMenuWidth(e,i);if(n>=i)d=`left:${-r.left}px;`;else{const e=n/2;d=`left:${t/2-r.left-e}px;`}}else d=`left:${this.getMenuPositionalParent(t).offset().left-r.left}px;`;break;default:if("tablet"===o&&c){const t=(window.innerWidth||document.documentElement.clientWidth)/2,n=this.getEffectiveMenuWidth(e,i)/2;d=`left:${t-r.left-n}px;`}else{if(void 0!==s&&1===parseInt(t.attr("data-offscreen-width-setup"))){let t=e.css("max-width");(t.includes("%")||"none"===t)&&(t=e.outerWidth()),i=Math.min(i,parseInt(t))}d=`left: ${parseInt(l.left-r.left-i/2+a.outerWidth()/2)}px;right:unset;`}}return d},getMenuPositionalParent:t=>t.closest(".tve-page-section-in, #tve_editor, #wrapper, .section-content"),reposition(t){const e=s(t),i=e.find(".tve-m-expanded").first(),o=i.length>0;if(e.find(".tve-m-trigger").toggleClass("tve-triggered-icon",o&&e.attr("class").includes("tve-mobile-")),o&&e.hasClass("tve-mobile-dropdown")){const t=this.getMenuPositionalParent(e),o=parseInt(e.data("calc-height")||"500")+"px",s=n.getDisplayType(),a=n.getMediaAttr(e,"data-dropdown-position",s),l="full"===a?window.innerWidth||document.documentElement.clientWidth:t.outerWidth(),r=this.getMenuDropdownPosition(e,i,l);let d=i.css("display");"none"===d&&(d="flex"),i.attr("style",`visibility: visible;margin-left: 0 !important;${r}width:${l}px !important;max-height:${o}px;display:${d}`);const c=e.hasClass("tve-mobile-dropdown");"tablet"===s&&c&&["full","left","right","center"].includes(a)&&requestAnimationFrame(()=>{const t=i.outerWidth(),n=this.calculateViewportBasedPosition(a,t,l,e);i.css("left",`${n}px`)}),setTimeout(()=>{i.css("max-height","none")},100)}return e},closeAll(){e(".thrv_widget_menu").each((t,e)=>{a.toggleState(e,!1)})},positionLogo(t){(t||n.$body).find(".tcb-menu-logo-wrap").each((t,n)=>{const i=e(n),o=i.siblings(),s=Math.floor(o.length/2);o.eq(s).before(i)})},ensureLogoSplit(t){const e=s(t);e.hasClass("tcb-logo-split")&&(a.isHamburger(e)?a.ensureHamburgerLogoSplit(t):a.ensureRegularLogoSplit(t))},ensureHamburgerLogoSplit(t,n=s(t).find("li.tcb-menu-logo-wrap")){const i=s(t);if(n.children().length){i.find(".tcb-hamburger-logo").remove();const t=e('<div class="tcb-hamburger-logo"></div>');t.append(n.children()),i.find(".thrive-shortcode-html").prepend(t)}},ensureRegularLogoSplit(t){const e=s(t),n=e.find(".tcb-hamburger-logo .tcb-logo"),i=e.find("li.tcb-menu-logo-wrap");n.length&&i.length&&i.empty().append(n),a.handleLogoOverflow(e)},handleLogoOverflow(t){const e=t.find("li.tcb-menu-logo-wrap");if(e.length)if(a.menuOverflows(t)){const t=e.outerHeight(!0),n=e.outerWidth();e.closest(".thrive-shortcode-html").css("padding-top",t+"px"),e.css({top:`-${t}px`,left:`calc(50% - ${Math.round(n/2)}px)`,position:"absolute"})}else e.removeAttr("style"),e.closest(".thrive-shortcode-html").css("padding-top","");else t.find(".thrive-shortcode-html").css("padding-top","")},menuOverflows(t){let n=0;return t.find(".tve_w_menu > li").each(function(){n+=e(this).outerWidth(!0)}),n>t.parent().width()-5},addMutationListener(t){const e=s(t);let i;const o=()=>{cancelAnimationFrame(i),i=requestAnimationFrame(a.handleLogoOverflow.bind(this,e))};if(window.ResizeObserver){const t=e.find("ul.tve_w_menu")[0];if(!t)return;const i=new ResizeObserver(o);if(!e.data("resize-observer")){i.observe(t),e.data("resize-observer",i);const n=new MutationObserver(t=>{Array.from(t).forEach(t=>{t.target.classList.contains("tcb-menu-logo-wrap")||"UL"===t.target.tagName&&"childList"===t.type&&t.addedNodes.length&&Array.from(t.addedNodes).forEach(t=>n.observe(t,{attributes:!0}))}),e.hasClass("tve-regular")&&o()});e.find(".tve_w_menu > li:not(.tcb-menu-logo-wrap)").each((t,e)=>{n.observe(e,{attributes:!0})})}const s=e.find("li.tcb-menu-logo-wrap");if(s.length&&!s.data("resize-observer")&&(s.data("resize-observer",i),i.observe(s[0])),e.hasClass("tcb-mega-std")&&!e.data("mega-resize-observer")){let t;const i=new ResizeObserver(()=>{cancelAnimationFrame(t),t=requestAnimationFrame(a.handleMegaMenuPosition.bind(this,e))});e.find(".tcb-mega-drop").each((t,e)=>{n.inlineCssVariable(e,"top","var(--mega-menu-top,100%)")}),i.observe(e[0]),e.data("mega-resize-observer",i)}}},handleMegaMenuPosition(t){const e=t.find(".tve_w_menu");if(e.length){const i=t[0].getBoundingClientRect().bottom,o=getComputedStyle(e[0]),s=parseInt(o.getPropertyValue("border-bottom-width"));t.find(".menu-item.menu-item-has-children.lvl-0").each((t,e)=>{const o=e.getBoundingClientRect().bottom,a=i-o-s;a>0?n.inlineCssVariable(e,"--mega-menu-top",`calc(100% - ${a}px)`):n.inlineCssVariable(e,"--mega-menu-top","")})}},ensureOnScreenDropdown(t){const i=s(t),o=i.hasClass("tve-regular"),a=i.hasClass("tve-vertical-menu"),l=i.offset().left+i.outerWidth();i.find("li:last-child > ul").each((t,n)=>{const i=e(n),s=i.offset().left+i.outerWidth();Math.ceil(s-l)>=0&&o&&s<i.outerWidth()?i.css({left:"auto",right:"0px"}):i.css({left:"",right:""})}),o||a?i.find(".tve_w_menu > li li").each((t,e)=>{let i;a&&(i=e.parentNode.closest("li"),i&&i.classList.add("expand-children"));const s=e.getBoundingClientRect();let l=parseFloat(e.getAttribute("data-init-width"));if(l||(l=s.width,e.setAttribute("data-init-width",l)),l+s.left>document.body.offsetWidth){const t=document.body.offsetWidth-s.left,i=l-t;o&&l>t&&n.inlineCssVariable(e.parentNode,{left:`calc(100% - ${i}px)`})}else n.inlineCssVariable(e,{"max-width":"","min-width":""});i&&i.classList.remove("expand-children")}):i.find(".tve_w_menu > li li").each((t,e)=>{n.inlineCssVariable(e,{"max-width":"","min-width":""})})}};e(window).on("tcb_after_dom_ready",()=>a.init()),window.addEventListener("load",()=>a.init()),window.TCB_Front.menu=a,t.exports=a,TCB_Front.setModuleLoadedStatus("menu",!0)}(ThriveGlobal.$j,TCB_Front)}},e={};!function n(i){var o=e[i];if(void 0!==o)return o.exports;var s=e[i]={exports:{}};return t[i](s,s.exports,n),s.exports}(74208)})();
window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode&&"a"!==E.activeElement.tagName.toLowerCase())return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window);
!function(n,t){var r,e;"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("underscore",t):(n="undefined"!=typeof globalThis?globalThis:n||self,r=n._,(e=n._=t()).noConflict=function(){return n._=r,e})}(this,function(){var n="1.13.7",t="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},e=Array.prototype,V=Object.prototype,F="undefined"!=typeof Symbol?Symbol.prototype:null,P=e.push,f=e.slice,s=V.toString,q=V.hasOwnProperty,r="undefined"!=typeof ArrayBuffer,u="undefined"!=typeof DataView,U=Array.isArray,W=Object.keys,z=Object.create,L=r&&ArrayBuffer.isView,$=isNaN,C=isFinite,K=!{toString:null}.propertyIsEnumerable("toString"),J=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],G=Math.pow(2,53)-1;function l(u,o){return o=null==o?u.length-1:+o,function(){for(var n=Math.max(arguments.length-o,0),t=Array(n),r=0;r<n;r++)t[r]=arguments[r+o];switch(o){case 0:return u.call(this,t);case 1:return u.call(this,arguments[0],t);case 2:return u.call(this,arguments[0],arguments[1],t)}for(var e=Array(o+1),r=0;r<o;r++)e[r]=arguments[r];return e[o]=t,u.apply(this,e)}}function o(n){var t=typeof n;return"function"==t||"object"==t&&!!n}function H(n){return void 0===n}function Q(n){return!0===n||!1===n||"[object Boolean]"===s.call(n)}function i(n){var t="[object "+n+"]";return function(n){return s.call(n)===t}}var X=i("String"),Y=i("Number"),Z=i("Date"),nn=i("RegExp"),tn=i("Error"),rn=i("Symbol"),en=i("ArrayBuffer"),a=i("Function"),t=t.document&&t.document.childNodes,p=a="function"!=typeof/./&&"object"!=typeof Int8Array&&"function"!=typeof t?function(n){return"function"==typeof n||!1}:a,t=i("Object"),un=u&&(!/\[native code\]/.test(String(DataView))||t(new DataView(new ArrayBuffer(8)))),a="undefined"!=typeof Map&&t(new Map),u=i("DataView");var h=un?function(n){return null!=n&&p(n.getInt8)&&en(n.buffer)}:u,v=U||i("Array");function y(n,t){return null!=n&&q.call(n,t)}var on=i("Arguments"),an=(!function(){on(arguments)||(on=function(n){return y(n,"callee")})}(),on);function fn(n){return Y(n)&&$(n)}function cn(n){return function(){return n}}function ln(t){return function(n){n=t(n);return"number"==typeof n&&0<=n&&n<=G}}function sn(t){return function(n){return null==n?void 0:n[t]}}var d=sn("byteLength"),pn=ln(d),hn=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var vn=r?function(n){return L?L(n)&&!h(n):pn(n)&&hn.test(s.call(n))}:cn(!1),g=sn("length");function yn(n,t){t=function(t){for(var r={},n=t.length,e=0;e<n;++e)r[t[e]]=!0;return{contains:function(n){return!0===r[n]},push:function(n){return r[n]=!0,t.push(n)}}}(t);var r=J.length,e=n.constructor,u=p(e)&&e.prototype||V,o="constructor";for(y(n,o)&&!t.contains(o)&&t.push(o);r--;)(o=J[r])in n&&n[o]!==u[o]&&!t.contains(o)&&t.push(o)}function b(n){if(!o(n))return[];if(W)return W(n);var t,r=[];for(t in n)y(n,t)&&r.push(t);return K&&yn(n,r),r}function dn(n,t){var r=b(t),e=r.length;if(null==n)return!e;for(var u=Object(n),o=0;o<e;o++){var i=r[o];if(t[i]!==u[i]||!(i in u))return!1}return!0}function m(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)}function gn(n){return new Uint8Array(n.buffer||n,n.byteOffset||0,d(n))}m.VERSION=n,m.prototype.valueOf=m.prototype.toJSON=m.prototype.value=function(){return this._wrapped},m.prototype.toString=function(){return String(this._wrapped)};var bn="[object DataView]";function mn(n,t,r,e){var u;return n===t?0!==n||1/n==1/t:null!=n&&null!=t&&(n!=n?t!=t:("function"==(u=typeof n)||"object"==u||"object"==typeof t)&&function n(t,r,e,u){t instanceof m&&(t=t._wrapped);r instanceof m&&(r=r._wrapped);var o=s.call(t);if(o!==s.call(r))return!1;if(un&&"[object Object]"==o&&h(t)){if(!h(r))return!1;o=bn}switch(o){case"[object RegExp]":case"[object String]":return""+t==""+r;case"[object Number]":return+t!=+t?+r!=+r:0==+t?1/+t==1/r:+t==+r;case"[object Date]":case"[object Boolean]":return+t==+r;case"[object Symbol]":return F.valueOf.call(t)===F.valueOf.call(r);case"[object ArrayBuffer]":case bn:return n(gn(t),gn(r),e,u)}o="[object Array]"===o;if(!o&&vn(t)){var i=d(t);if(i!==d(r))return!1;if(t.buffer===r.buffer&&t.byteOffset===r.byteOffset)return!0;o=!0}if(!o){if("object"!=typeof t||"object"!=typeof r)return!1;var i=t.constructor,a=r.constructor;if(i!==a&&!(p(i)&&i instanceof i&&p(a)&&a instanceof a)&&"constructor"in t&&"constructor"in r)return!1}e=e||[];u=u||[];var f=e.length;for(;f--;)if(e[f]===t)return u[f]===r;e.push(t);u.push(r);if(o){if((f=t.length)!==r.length)return!1;for(;f--;)if(!mn(t[f],r[f],e,u))return!1}else{var c,l=b(t);if(f=l.length,b(r).length!==f)return!1;for(;f--;)if(c=l[f],!y(r,c)||!mn(t[c],r[c],e,u))return!1}e.pop();u.pop();return!0}(n,t,r,e))}function c(n){if(!o(n))return[];var t,r=[];for(t in n)r.push(t);return K&&yn(n,r),r}function jn(e){var u=g(e);return function(n){if(null==n)return!1;var t=c(n);if(g(t))return!1;for(var r=0;r<u;r++)if(!p(n[e[r]]))return!1;return e!==_n||!p(n[wn])}}var wn="forEach",t=["clear","delete"],u=["get","has","set"],U=t.concat(wn,u),_n=t.concat(u),r=["add"].concat(t,wn,"has"),u=a?jn(U):i("Map"),t=a?jn(_n):i("WeakMap"),U=a?jn(r):i("Set"),a=i("WeakSet");function j(n){for(var t=b(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=n[t[u]];return e}function An(n){for(var t={},r=b(n),e=0,u=r.length;e<u;e++)t[n[r[e]]]=r[e];return t}function xn(n){var t,r=[];for(t in n)p(n[t])&&r.push(t);return r.sort()}function Sn(f,c){return function(n){var t=arguments.length;if(c&&(n=Object(n)),!(t<2||null==n))for(var r=1;r<t;r++)for(var e=arguments[r],u=f(e),o=u.length,i=0;i<o;i++){var a=u[i];c&&void 0!==n[a]||(n[a]=e[a])}return n}}var On=Sn(c),w=Sn(b),Mn=Sn(c,!0);function En(n){var t;return o(n)?z?z(n):((t=function(){}).prototype=n,n=new t,t.prototype=null,n):{}}function Bn(n){return v(n)?n:[n]}function _(n){return m.toPath(n)}function Nn(n,t){for(var r=t.length,e=0;e<r;e++){if(null==n)return;n=n[t[e]]}return r?n:void 0}function In(n,t,r){n=Nn(n,_(t));return H(n)?r:n}function Tn(n){return n}function A(t){return t=w({},t),function(n){return dn(n,t)}}function kn(t){return t=_(t),function(n){return Nn(n,t)}}function x(u,o,n){if(void 0===o)return u;switch(null==n?3:n){case 1:return function(n){return u.call(o,n)};case 3:return function(n,t,r){return u.call(o,n,t,r)};case 4:return function(n,t,r,e){return u.call(o,n,t,r,e)}}return function(){return u.apply(o,arguments)}}function Dn(n,t,r){return null==n?Tn:p(n)?x(n,t,r):(o(n)&&!v(n)?A:kn)(n)}function Rn(n,t){return Dn(n,t,1/0)}function S(n,t,r){return m.iteratee!==Rn?m.iteratee(n,t):Dn(n,t,r)}function Vn(){}function Fn(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))}m.toPath=Bn,m.iteratee=Rn;var O=Date.now||function(){return(new Date).getTime()};function Pn(t){function r(n){return t[n]}var n="(?:"+b(t).join("|")+")",e=RegExp(n),u=RegExp(n,"g");return function(n){return e.test(n=null==n?"":""+n)?n.replace(u,r):n}}var r={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},qn=Pn(r),r=Pn(An(r)),Un=m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Wn=/(.)^/,zn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Ln=/\\|'|\r|\n|\u2028|\u2029/g;function $n(n){return"\\"+zn[n]}var Cn=/^\s*(\w|\$)+\s*$/;var Kn=0;function Jn(n,t,r,e,u){return e instanceof t?(e=En(n.prototype),o(t=n.apply(e,u))?t:e):n.apply(r,u)}var M=l(function(u,o){function i(){for(var n=0,t=o.length,r=Array(t),e=0;e<t;e++)r[e]=o[e]===a?arguments[n++]:o[e];for(;n<arguments.length;)r.push(arguments[n++]);return Jn(u,i,this,this,r)}var a=M.placeholder;return i}),Gn=(M.placeholder=m,l(function(t,r,e){var u;if(p(t))return u=l(function(n){return Jn(t,u,r,this,e.concat(n))});throw new TypeError("Bind must be called on a function")})),E=ln(g);function B(n,t,r,e){if(e=e||[],t||0===t){if(t<=0)return e.concat(n)}else t=1/0;for(var u=e.length,o=0,i=g(n);o<i;o++){var a=n[o];if(E(a)&&(v(a)||an(a)))if(1<t)B(a,t-1,r,e),u=e.length;else for(var f=0,c=a.length;f<c;)e[u++]=a[f++];else r||(e[u++]=a)}return e}var Hn=l(function(n,t){var r=(t=B(t,!1,!1)).length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var e=t[r];n[e]=Gn(n[e],n)}return n});var Qn=l(function(n,t,r){return setTimeout(function(){return n.apply(null,r)},t)}),Xn=M(Qn,m,1);function Yn(n){return function(){return!n.apply(this,arguments)}}function Zn(n,t){var r;return function(){return 0<--n&&(r=t.apply(this,arguments)),n<=1&&(t=null),r}}var nt=M(Zn,2);function tt(n,t,r){t=S(t,r);for(var e,u=b(n),o=0,i=u.length;o<i;o++)if(t(n[e=u[o]],e,n))return e}function rt(o){return function(n,t,r){t=S(t,r);for(var e=g(n),u=0<o?0:e-1;0<=u&&u<e;u+=o)if(t(n[u],u,n))return u;return-1}}var et=rt(1),ut=rt(-1);function ot(n,t,r,e){for(var u=(r=S(r,e,1))(t),o=0,i=g(n);o<i;){var a=Math.floor((o+i)/2);r(n[a])<u?o=a+1:i=a}return o}function it(o,i,a){return function(n,t,r){var e=0,u=g(n);if("number"==typeof r)0<o?e=0<=r?r:Math.max(r+u,e):u=0<=r?Math.min(r+1,u):r+u+1;else if(a&&r&&u)return n[r=a(n,t)]===t?r:-1;if(t!=t)return 0<=(r=i(f.call(n,e,u),fn))?r+e:-1;for(r=0<o?e:u-1;0<=r&&r<u;r+=o)if(n[r]===t)return r;return-1}}var at=it(1,et,ot),ft=it(-1,ut);function ct(n,t,r){t=(E(n)?et:tt)(n,t,r);if(void 0!==t&&-1!==t)return n[t]}function N(n,t,r){if(t=x(t,r),E(n))for(u=0,o=n.length;u<o;u++)t(n[u],u,n);else for(var e=b(n),u=0,o=e.length;u<o;u++)t(n[e[u]],e[u],n);return n}function I(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=Array(u),i=0;i<u;i++){var a=e?e[i]:i;o[i]=t(n[a],a,n)}return o}function lt(f){return function(n,t,r,e){var u=3<=arguments.length;return function(n,t,r,e){var u=!E(n)&&b(n),o=(u||n).length,i=0<f?0:o-1;for(e||(r=n[u?u[i]:i],i+=f);0<=i&&i<o;i+=f){var a=u?u[i]:i;r=t(r,n[a],a,n)}return r}(n,x(t,e,4),r,u)}}var st=lt(1),pt=lt(-1);function T(n,e,t){var u=[];return e=S(e,t),N(n,function(n,t,r){e(n,t,r)&&u.push(n)}),u}function ht(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(!t(n[i],i,n))return!1}return!0}function vt(n,t,r){t=S(t,r);for(var e=!E(n)&&b(n),u=(e||n).length,o=0;o<u;o++){var i=e?e[o]:o;if(t(n[i],i,n))return!0}return!1}function k(n,t,r,e){return E(n)||(n=j(n)),0<=at(n,t,r="number"==typeof r&&!e?r:0)}var yt=l(function(n,r,e){var u,o;return p(r)?o=r:(r=_(r),u=r.slice(0,-1),r=r[r.length-1]),I(n,function(n){var t=o;if(!t){if(null==(n=u&&u.length?Nn(n,u):n))return;t=n[r]}return null==t?t:t.apply(n,e)})});function dt(n,t){return I(n,kn(t))}function gt(n,e,t){var r,u,o=-1/0,i=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&o<r&&(o=r);else e=S(e,t),N(n,function(n,t,r){u=e(n,t,r),(i<u||u===-1/0&&o===-1/0)&&(o=n,i=u)});return o}var bt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function mt(n){return n?v(n)?f.call(n):X(n)?n.match(bt):E(n)?I(n,Tn):j(n):[]}function jt(n,t,r){if(null==t||r)return(n=E(n)?n:j(n))[Fn(n.length-1)];for(var e=mt(n),r=g(e),u=(t=Math.max(Math.min(t,r),0),r-1),o=0;o<t;o++){var i=Fn(o,u),a=e[o];e[o]=e[i],e[i]=a}return e.slice(0,t)}function D(o,t){return function(r,e,n){var u=t?[[],[]]:{};return e=S(e,n),N(r,function(n,t){t=e(n,t,r);o(u,n,t)}),u}}var wt=D(function(n,t,r){y(n,r)?n[r].push(t):n[r]=[t]}),_t=D(function(n,t,r){n[r]=t}),At=D(function(n,t,r){y(n,r)?n[r]++:n[r]=1}),xt=D(function(n,t,r){n[r?0:1].push(t)},!0);function St(n,t,r){return t in r}var Ot=l(function(n,t){var r={},e=t[0];if(null!=n){p(e)?(1<t.length&&(e=x(e,t[1])),t=c(n)):(e=St,t=B(t,!1,!1),n=Object(n));for(var u=0,o=t.length;u<o;u++){var i=t[u],a=n[i];e(a,i,n)&&(r[i]=a)}}return r}),Mt=l(function(n,r){var t,e=r[0];return p(e)?(e=Yn(e),1<r.length&&(t=r[1])):(r=I(B(r,!1,!1),String),e=function(n,t){return!k(r,t)}),Ot(n,e,t)});function Et(n,t,r){return f.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))}function Bt(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[0]:Et(n,n.length-t)}function R(n,t,r){return f.call(n,null==t||r?1:t)}var Nt=l(function(n,t){return t=B(t,!0,!0),T(n,function(n){return!k(t,n)})}),It=l(function(n,t){return Nt(n,t)});function Tt(n,t,r,e){Q(t)||(e=r,r=t,t=!1),null!=r&&(r=S(r,e));for(var u=[],o=[],i=0,a=g(n);i<a;i++){var f=n[i],c=r?r(f,i,n):f;t&&!r?(i&&o===c||u.push(f),o=c):r?k(o,c)||(o.push(c),u.push(f)):k(u,f)||u.push(f)}return u}var kt=l(function(n){return Tt(B(n,!0,!0))});function Dt(n){for(var t=n&&gt(n,g).length||0,r=Array(t),e=0;e<t;e++)r[e]=dt(n,e);return r}var Rt=l(Dt);function Vt(n,t){return n._chain?m(t).chain():t}function Ft(r){return N(xn(r),function(n){var t=m[n]=r[n];m.prototype[n]=function(){var n=[this._wrapped];return P.apply(n,arguments),Vt(this,t.apply(m,n))}}),m}N(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var r=e[t];m.prototype[t]=function(){var n=this._wrapped;return null!=n&&(r.apply(n,arguments),"shift"!==t&&"splice"!==t||0!==n.length||delete n[0]),Vt(this,n)}}),N(["concat","join","slice"],function(n){var t=e[n];m.prototype[n]=function(){var n=this._wrapped;return Vt(this,n=null!=n?t.apply(n,arguments):n)}});n=Ft({__proto__:null,VERSION:n,restArguments:l,isObject:o,isNull:function(n){return null===n},isUndefined:H,isBoolean:Q,isElement:function(n){return!(!n||1!==n.nodeType)},isString:X,isNumber:Y,isDate:Z,isRegExp:nn,isError:tn,isSymbol:rn,isArrayBuffer:en,isDataView:h,isArray:v,isFunction:p,isArguments:an,isFinite:function(n){return!rn(n)&&C(n)&&!isNaN(parseFloat(n))},isNaN:fn,isTypedArray:vn,isEmpty:function(n){var t;return null==n||("number"==typeof(t=g(n))&&(v(n)||X(n)||an(n))?0===t:0===g(b(n)))},isMatch:dn,isEqual:function(n,t){return mn(n,t)},isMap:u,isWeakMap:t,isSet:U,isWeakSet:a,keys:b,allKeys:c,values:j,pairs:function(n){for(var t=b(n),r=t.length,e=Array(r),u=0;u<r;u++)e[u]=[t[u],n[t[u]]];return e},invert:An,functions:xn,methods:xn,extend:On,extendOwn:w,assign:w,defaults:Mn,create:function(n,t){return n=En(n),t&&w(n,t),n},clone:function(n){return o(n)?v(n)?n.slice():On({},n):n},tap:function(n,t){return t(n),n},get:In,has:function(n,t){for(var r=(t=_(t)).length,e=0;e<r;e++){var u=t[e];if(!y(n,u))return!1;n=n[u]}return!!r},mapObject:function(n,t,r){t=S(t,r);for(var e=b(n),u=e.length,o={},i=0;i<u;i++){var a=e[i];o[a]=t(n[a],a,n)}return o},identity:Tn,constant:cn,noop:Vn,toPath:Bn,property:kn,propertyOf:function(t){return null==t?Vn:function(n){return In(t,n)}},matcher:A,matches:A,times:function(n,t,r){var e=Array(Math.max(0,n));t=x(t,r,1);for(var u=0;u<n;u++)e[u]=t(u);return e},random:Fn,now:O,escape:qn,unescape:r,templateSettings:Un,template:function(o,n,t){n=Mn({},n=!n&&t?t:n,m.templateSettings);var r,t=RegExp([(n.escape||Wn).source,(n.interpolate||Wn).source,(n.evaluate||Wn).source].join("|")+"|$","g"),i=0,a="__p+='";if(o.replace(t,function(n,t,r,e,u){return a+=o.slice(i,u).replace(Ln,$n),i=u+n.length,t?a+="'+\n((__t=("+t+"))==null?'':_.escape(__t))+\n'":r?a+="'+\n((__t=("+r+"))==null?'':__t)+\n'":e&&(a+="';\n"+e+"\n__p+='"),n}),a+="';\n",t=n.variable){if(!Cn.test(t))throw new Error("variable is not a bare identifier: "+t)}else a="with(obj||{}){\n"+a+"}\n",t="obj";a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(t,"_",a)}catch(n){throw n.source=a,n}function e(n){return r.call(this,n,m)}return e.source="function("+t+"){\n"+a+"}",e},result:function(n,t,r){var e=(t=_(t)).length;if(!e)return p(r)?r.call(n):r;for(var u=0;u<e;u++){var o=null==n?void 0:n[t[u]];void 0===o&&(o=r,u=e),n=p(o)?o.call(n):o}return n},uniqueId:function(n){var t=++Kn+"";return n?n+t:t},chain:function(n){return(n=m(n))._chain=!0,n},iteratee:Rn,partial:M,bind:Gn,bindAll:Hn,memoize:function(e,u){function o(n){var t=o.cache,r=""+(u?u.apply(this,arguments):n);return y(t,r)||(t[r]=e.apply(this,arguments)),t[r]}return o.cache={},o},delay:Qn,defer:Xn,throttle:function(r,e,u){function o(){l=!1===u.leading?0:O(),i=null,c=r.apply(a,f),i||(a=f=null)}function n(){var n=O(),t=(l||!1!==u.leading||(l=n),e-(n-l));return a=this,f=arguments,t<=0||e<t?(i&&(clearTimeout(i),i=null),l=n,c=r.apply(a,f),i||(a=f=null)):i||!1===u.trailing||(i=setTimeout(o,t)),c}var i,a,f,c,l=0;return u=u||{},n.cancel=function(){clearTimeout(i),l=0,i=a=f=null},n},debounce:function(t,r,e){function u(){var n=O()-i;n<r?o=setTimeout(u,r-n):(o=null,e||(f=t.apply(c,a)),o||(a=c=null))}var o,i,a,f,c,n=l(function(n){return c=this,a=n,i=O(),o||(o=setTimeout(u,r),e&&(f=t.apply(c,a))),f});return n.cancel=function(){clearTimeout(o),o=a=c=null},n},wrap:function(n,t){return M(t,n)},negate:Yn,compose:function(){var r=arguments,e=r.length-1;return function(){for(var n=e,t=r[e].apply(this,arguments);n--;)t=r[n].call(this,t);return t}},after:function(n,t){return function(){if(--n<1)return t.apply(this,arguments)}},before:Zn,once:nt,findKey:tt,findIndex:et,findLastIndex:ut,sortedIndex:ot,indexOf:at,lastIndexOf:ft,find:ct,detect:ct,findWhere:function(n,t){return ct(n,A(t))},each:N,forEach:N,map:I,collect:I,reduce:st,foldl:st,inject:st,reduceRight:pt,foldr:pt,filter:T,select:T,reject:function(n,t,r){return T(n,Yn(S(t)),r)},every:ht,all:ht,some:vt,any:vt,contains:k,includes:k,include:k,invoke:yt,pluck:dt,where:function(n,t){return T(n,A(t))},max:gt,min:function(n,e,t){var r,u,o=1/0,i=1/0;if(null==e||"number"==typeof e&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=E(n)?n:j(n)).length;a<f;a++)null!=(r=n[a])&&r<o&&(o=r);else e=S(e,t),N(n,function(n,t,r){((u=e(n,t,r))<i||u===1/0&&o===1/0)&&(o=n,i=u)});return o},shuffle:function(n){return jt(n,1/0)},sample:jt,sortBy:function(n,e,t){var u=0;return e=S(e,t),dt(I(n,function(n,t,r){return{value:n,index:u++,criteria:e(n,t,r)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(e<r||void 0===r)return 1;if(r<e||void 0===e)return-1}return n.index-t.index}),"value")},groupBy:wt,indexBy:_t,countBy:At,partition:xt,toArray:mt,size:function(n){return null==n?0:(E(n)?n:b(n)).length},pick:Ot,omit:Mt,first:Bt,head:Bt,take:Bt,initial:Et,last:function(n,t,r){return null==n||n.length<1?null==t||r?void 0:[]:null==t||r?n[n.length-1]:R(n,Math.max(0,n.length-t))},rest:R,tail:R,drop:R,compact:function(n){return T(n,Boolean)},flatten:function(n,t){return B(n,t,!1)},without:It,uniq:Tt,unique:Tt,union:kt,intersection:function(n){for(var t=[],r=arguments.length,e=0,u=g(n);e<u;e++){var o=n[e];if(!k(t,o)){for(var i=1;i<r&&k(arguments[i],o);i++);i===r&&t.push(o)}}return t},difference:Nt,unzip:Dt,transpose:Dt,zip:Rt,object:function(n,t){for(var r={},e=0,u=g(n);e<u;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},range:function(n,t,r){null==t&&(t=n||0,n=0),r=r||(t<n?-1:1);for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),o=0;o<e;o++,n+=r)u[o]=n;return u},chunk:function(n,t){if(null==t||t<1)return[];for(var r=[],e=0,u=n.length;e<u;)r.push(f.call(n,e,e+=t));return r},mixin:Ft,default:m});return n._=n});
!function(n){var s="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global;if("function"==typeof define&&define.amd)define(["underscore","jquery","exports"],function(t,e,i){s.Backbone=n(s,i,t,e)});else if("undefined"!=typeof exports){var t,e=require("underscore");try{t=require("jquery")}catch(t){}n(s,exports,e,t)}else s.Backbone=n(s,{},s._,s.jQuery||s.Zepto||s.ender||s.$)}(function(t,h,b,e){function a(t,e,i,n,s){var r,o=0;if(i&&"object"==typeof i){void 0!==n&&"context"in s&&void 0===s.context&&(s.context=n);for(r=b.keys(i);o<r.length;o++)e=a(t,e,r[o],i[r[o]],s)}else if(i&&l.test(i))for(r=i.split(l);o<r.length;o++)e=t(e,r[o],n,s);else e=t(e,i,n,s);return e}function x(t,e,i){i=Math.min(Math.max(i,0),t.length);for(var n=Array(t.length-i),s=e.length,r=0;r<n.length;r++)n[r]=t[r+i];for(r=0;r<s;r++)t[r+i]=e[r];for(r=0;r<n.length;r++)t[r+s+i]=n[r]}function s(i,n,t,s){b.each(t,function(t,e){n[e]&&(i.prototype[e]=function(n,t,s,r){switch(t){case 1:return function(){return n[s](this[r])};case 2:return function(t){return n[s](this[r],t)};case 3:return function(t,e){return n[s](this[r],T(t,this),e)};case 4:return function(t,e,i){return n[s](this[r],T(t,this),e,i)};default:return function(){var t=u.call(arguments);return t.unshift(this[r]),n[s].apply(n,t)}}}(n,t,e,s))})}var o,i=t.Backbone,u=Array.prototype.slice,e=(h.VERSION="1.6.0",h.$=e,h.noConflict=function(){return t.Backbone=i,this},h.emulateHTTP=!1,h.emulateJSON=!1,h.Events={}),l=/\s+/,n=(e.on=function(t,e,i){return this._events=a(n,this._events||{},t,e,{context:i,ctx:this,listening:o}),o&&(((this._listeners||(this._listeners={}))[o.id]=o).interop=!1),this},e.listenTo=function(t,e,i){if(t){var n=t._listenId||(t._listenId=b.uniqueId("l")),s=this._listeningTo||(this._listeningTo={}),r=o=s[n],s=(r||(this._listenId||(this._listenId=b.uniqueId("l")),r=o=s[n]=new g(this,t)),c(t,e,i,this));if(o=void 0,s)throw s;r.interop&&r.on(e,i)}return this},function(t,e,i,n){var s,r;return i&&(e=t[e]||(t[e]=[]),s=n.context,r=n.ctx,(n=n.listening)&&n.count++,e.push({callback:i,context:s,ctx:s||r,listening:n})),t}),c=function(t,e,i,n){try{t.on(e,i,n)}catch(t){return t}},r=(e.off=function(t,e,i){return this._events&&(this._events=a(r,this._events,t,e,{context:i,listeners:this._listeners})),this},e.stopListening=function(t,e,i){var n=this._listeningTo;if(n){for(var s=t?[t._listenId]:b.keys(n),r=0;r<s.length;r++){var o=n[s[r]];if(!o)break;o.obj.off(e,i,this),o.interop&&o.off(e,i)}b.isEmpty(n)&&(this._listeningTo=void 0)}return this},function(t,e,i,n){if(t){var s,r=n.context,o=n.listeners,h=0;if(e||r||i){for(s=e?[e]:b.keys(t);h<s.length;h++){var a=t[e=s[h]];if(!a)break;for(var u=[],l=0;l<a.length;l++){var c=a[l];i&&i!==c.callback&&i!==c.callback._callback||r&&r!==c.context?u.push(c):(c=c.listening)&&c.off(e,i)}u.length?t[e]=u:delete t[e]}return t}for(s=b.keys(o);h<s.length;h++)o[s[h]].cleanup()}}),d=(e.once=function(t,e,i){var n=a(d,{},t,e,this.off.bind(this));return this.on(n,e="string"==typeof t&&null==i?void 0:e,i)},e.listenToOnce=function(t,e,i){e=a(d,{},e,i,this.stopListening.bind(this,t));return this.listenTo(t,e)},function(t,e,i,n){var s;return i&&((s=t[e]=b.once(function(){n(e,s),i.apply(this,arguments)}))._callback=i),t}),f=(e.trigger=function(t){if(this._events){for(var e=Math.max(0,arguments.length-1),i=Array(e),n=0;n<e;n++)i[n]=arguments[n+1];a(f,this._events,t,void 0,i)}return this},function(t,e,i,n){var s,r;return t&&(s=t[e],r=t.all,s&&(r=r&&r.slice()),s&&p(s,n),r)&&p(r,[e].concat(n)),t}),p=function(t,e){var i,n=-1,s=t.length,r=e[0],o=e[1],h=e[2];switch(e.length){case 0:for(;++n<s;)(i=t[n]).callback.call(i.ctx);return;case 1:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r);return;case 2:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,o);return;case 3:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,o,h);return;default:for(;++n<s;)(i=t[n]).callback.apply(i.ctx,e);return}},g=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0},v=(g.prototype.on=e.on,g.prototype.off=function(t,e){t=this.interop?(this._events=a(r,this._events,t,e,{context:void 0,listeners:void 0}),!this._events):(this.count--,0===this.count);t&&this.cleanup()},g.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},e.bind=e.on,e.unbind=e.off,b.extend(h,e),h.Model=function(t,e){var i=t||{},n=(e=e||{},this.preinitialize.apply(this,arguments),this.cid=b.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(i=this.parse(i,e)||{}),b.result(this,"defaults")),i=b.defaults(b.extend({},n,i),n);this.set(i,e),this.changed={},this.initialize.apply(this,arguments)}),m=(b.extend(v.prototype,e,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(t){return b.clone(this.attributes)},sync:function(){return h.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return b.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!b.iteratee(t,this)(this.attributes)},set:function(t,e,i){if(null!=t){var n;if("object"==typeof t?(n=t,i=e):(n={})[t]=e,!this._validate(n,i=i||{}))return!1;var s,r,o=i.unset,t=i.silent,h=[],a=this._changing,u=(this._changing=!0,a||(this._previousAttributes=b.clone(this.attributes),this.changed={}),this.attributes),l=this.changed,c=this._previousAttributes;for(s in n)e=n[s],b.isEqual(u[s],e)||h.push(s),b.isEqual(c[s],e)?delete l[s]:l[s]=e,o?delete u[s]:u[s]=e;if(this.idAttribute in n&&(r=this.id,this.id=this.get(this.idAttribute),this.trigger("changeId",this,r,i)),!t){h.length&&(this._pending=i);for(var d=0;d<h.length;d++)this.trigger("change:"+h[d],this,u[h[d]],i)}if(!a){if(!t)for(;this._pending;)i=this._pending,this._pending=!1,this.trigger("change",this,i);this._pending=!1,this._changing=!1}}return this},unset:function(t,e){return this.set(t,void 0,b.extend({},e,{unset:!0}))},clear:function(t){var e,i={};for(e in this.attributes)i[e]=void 0;return this.set(i,b.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!b.isEmpty(this.changed):b.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&b.clone(this.changed);var e,i,n=this._changing?this._previousAttributes:this.attributes,s={};for(i in t){var r=t[i];b.isEqual(n[i],r)||(s[i]=r,e=!0)}return!!e&&s},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return b.clone(this._previousAttributes)},fetch:function(i){i=b.extend({parse:!0},i);var n=this,s=i.success;return i.success=function(t){var e=i.parse?n.parse(t,i):t;if(!n.set(e,i))return!1;s&&s.call(i.context,n,t,i),n.trigger("sync",n,t,i)},N(this,i),this.sync("read",this,i)},save:function(t,e,i){null==t||"object"==typeof t?(n=t,i=e):(n={})[t]=e;var n,s=(i=b.extend({validate:!0,parse:!0},i)).wait;if(n&&!s){if(!this.set(n,i))return!1}else if(!this._validate(n,i))return!1;var r=this,o=i.success,h=this.attributes,t=(i.success=function(t){r.attributes=h;var e=i.parse?r.parse(t,i):t;if((e=s?b.extend({},n,e):e)&&!r.set(e,i))return!1;o&&o.call(i.context,r,t,i),r.trigger("sync",r,t,i)},N(this,i),n&&s&&(this.attributes=b.extend({},h,n)),this.isNew()?"create":i.patch?"patch":"update"),e=("patch"!=t||i.attrs||(i.attrs=n),this.sync(t,this,i));return this.attributes=h,e},destroy:function(e){e=e?b.clone(e):{};function i(){n.stopListening(),n.trigger("destroy",n,n.collection,e)}var n=this,s=e.success,r=e.wait,t=!(e.success=function(t){r&&i(),s&&s.call(e.context,n,t,e),n.isNew()||n.trigger("sync",n,t,e)});return this.isNew()?b.defer(e.success):(N(this,e),t=this.sync("delete",this,e)),r||i(),t},url:function(){var t,e=b.result(this,"urlRoot")||b.result(this.collection,"url")||M();return this.isNew()?e:(t=this.get(this.idAttribute),e.replace(/[^\/]$/,"$&/")+encodeURIComponent(t))},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},b.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=b.extend({},this.attributes,t);t=this.validationError=this.validate(t,e)||null;return!t||(this.trigger("invalid",this,t,b.extend(e,{validationError:t})),!1)}}),h.Collection=function(t,e){e=e||{},this.preinitialize.apply(this,arguments),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,b.extend({silent:!0},e))}),w={add:!0,remove:!0,merge:!0},_={add:!0,remove:!1},y=(b.extend(m.prototype,e,{model:v,preinitialize:function(){},initialize:function(){},toJSON:function(e){return this.map(function(t){return t.toJSON(e)})},sync:function(){return h.sync.apply(this,arguments)},add:function(t,e){return this.set(t,b.extend({merge:!1},e,_))},remove:function(t,e){e=b.extend({},e);var i=!b.isArray(t),t=(t=i?[t]:t.slice(),this._removeModels(t,e));return!e.silent&&t.length&&(e.changes={added:[],merged:[],removed:t},this.trigger("update",this,e)),i?t[0]:t},set:function(t,e){if(null!=t){(e=b.extend({},w,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);for(var i=!b.isArray(t),n=(t=i?[t]:t.slice(),e.at),s=((n=(n=null!=n?+n:n)>this.length?this.length:n)<0&&(n+=this.length+1),[]),r=[],o=[],h=[],a={},u=e.add,l=e.merge,c=e.remove,d=!1,f=this.comparator&&null==n&&!1!==e.sort,p=b.isString(this.comparator)?this.comparator:null,g=0;g<t.length;g++){var v,m=t[g],_=this.get(m);_?(l&&m!==_&&(v=this._isModel(m)?m.attributes:m,e.parse&&(v=_.parse(v,e)),_.set(v,e),o.push(_),f)&&!d&&(d=_.hasChanged(p)),a[_.cid]||(a[_.cid]=!0,s.push(_)),t[g]=_):u&&(m=t[g]=this._prepareModel(m,e))&&(r.push(m),this._addReference(m,e),a[m.cid]=!0,s.push(m))}if(c){for(g=0;g<this.length;g++)a[(m=this.models[g]).cid]||h.push(m);h.length&&this._removeModels(h,e)}var y=!1;if(s.length&&(!f&&u&&c)?(y=this.length!==s.length||b.some(this.models,function(t,e){return t!==s[e]}),this.models.length=0,x(this.models,s,0),this.length=this.models.length):r.length&&(f&&(d=!0),x(this.models,r,null==n?this.length:n),this.length=this.models.length),d&&this.sort({silent:!0}),!e.silent){for(g=0;g<r.length;g++)null!=n&&(e.index=n+g),(m=r[g]).trigger("add",m,this,e);(d||y)&&this.trigger("sort",this,e),(r.length||h.length||o.length)&&(e.changes={added:r,removed:h,merged:o},this.trigger("update",this,e))}return i?t[0]:t}},reset:function(t,e){e=e?b.clone(e):{};for(var i=0;i<this.models.length;i++)this._removeReference(this.models[i],e);return e.previousModels=this.models,this._reset(),t=this.add(t,b.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,b.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,b.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return u.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t,t.idAttribute)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t=t||{};var i=e.length;return b.isFunction(e)&&(e=e.bind(this)),1===i||b.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(i){var n=(i=b.extend({parse:!0},i)).success,s=this;return i.success=function(t){var e=i.reset?"reset":"set";s[e](t,i),n&&n.call(i.context,s,t,i),s.trigger("sync",s,t,i)},N(this,i),this.sync("read",this,i)},create:function(t,e){var n=(e=e?b.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;n||this.add(t,e);var s=this,r=e.success;return e.success=function(t,e,i){n&&(t.off("error",s._forwardPristineError,s),s.add(t,i)),r&&r.call(i.context,t,e,i)},n&&t.once("error",this._forwardPristineError,this),t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t,e){return t[e||this.model.prototype.idAttribute||"id"]},values:function(){return new E(this,S)},keys:function(){return new E(this,I)},entries:function(){return new E(this,k)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){return this._isModel(t)?(t.collection||(t.collection=this),t):(t=((e=e?b.clone(e):{}).collection=this).model.prototype?new this.model(t,e):this.model(t,e)).validationError?(this.trigger("invalid",this,t.validationError,e),!1):t},_removeModels:function(t,e){for(var i=[],n=0;n<t.length;n++){var s,r,o=this.get(t[n]);o&&(s=this.indexOf(o),this.models.splice(s,1),this.length--,delete this._byId[o.cid],null!=(r=this.modelId(o.attributes,o.idAttribute))&&delete this._byId[r],e.silent||(e.index=s,o.trigger("remove",o,this,e)),i.push(o),this._removeReference(o,e))}return 0<t.length&&!e.silent&&delete e.index,i},_isModel:function(t){return t instanceof v},_addReference:function(t,e){this._byId[t.cid]=t;var i=this.modelId(t.attributes,t.idAttribute);null!=i&&(this._byId[i]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var i=this.modelId(t.attributes,t.idAttribute);null!=i&&delete this._byId[i],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,n){if(e){if(("add"===t||"remove"===t)&&i!==this)return;var s,r;"destroy"===t&&this.remove(e,n),"changeId"===t&&(s=this.modelId(e.previousAttributes(),e.idAttribute),r=this.modelId(e.attributes,e.idAttribute),null!=s&&delete this._byId[s],null!=r)&&(this._byId[r]=e)}this.trigger.apply(this,arguments)},_forwardPristineError:function(t,e,i){this.has(t)||this._onModelEvent("error",t,e,i)}}),"function"==typeof Symbol&&Symbol.iterator),E=(y&&(m.prototype[y]=m.prototype.values),function(t,e){this._collection=t,this._kind=e,this._index=0}),S=1,I=2,k=3,y=(y&&(E.prototype[y]=function(){return this}),E.prototype.next=function(){if(this._collection){var t,e;if(this._index<this._collection.length)return t=this._collection.at(this._index),this._index++,{value:this._kind===S?t:(e=this._collection.modelId(t.attributes,t.idAttribute),this._kind===I?e:[e,t]),done:!1};this._collection=void 0}return{value:void 0,done:!0}},h.View=function(t){this.cid=b.uniqueId("view"),this.preinitialize.apply(this,arguments),b.extend(this,b.pick(t,P)),this._ensureElement(),this.initialize.apply(this,arguments)}),A=/^(\S+)\s*(.*)$/,P=["model","collection","el","id","attributes","className","tagName","events"],T=(b.extend(y.prototype,e,{tagName:"div",$:function(t){return this.$el.find(t)},preinitialize:function(){},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof h.$?t:h.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t=t||b.result(this,"events"))for(var e in this.undelegateEvents(),t){var i=t[e];(i=b.isFunction(i)?i:this[i])&&(e=e.match(A),this.delegate(e[1],e[2],i.bind(this)))}return this},delegate:function(t,e,i){return this.$el.on(t+".delegateEvents"+this.cid,e,i),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,i){return this.$el.off(t+".delegateEvents"+this.cid,e,i),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){var t;this.el?this.setElement(b.result(this,"el")):(t=b.extend({},b.result(this,"attributes")),this.id&&(t.id=b.result(this,"id")),this.className&&(t.class=b.result(this,"className")),this.setElement(this._createElement(b.result(this,"tagName"))),this._setAttributes(t))},_setAttributes:function(t){this.$el.attr(t)}}),function(e,t){return b.isFunction(e)?e:b.isObject(e)&&!t._isModel(e)?H(e):b.isString(e)?function(t){return t.get(e)}:e}),H=function(t){var e=b.matches(t);return function(t){return e(t.attributes)}},$=(b.each([[m,{forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},"models"],[v,{keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1},"attributes"]],function(t){var i=t[0],e=t[1],n=t[2];i.mixin=function(t){var e=b.reduce(b.functions(t),function(t,e){return t[e]=0,t},{});s(i,t,e,n)},s(i,b,e,n)}),h.sync=function(t,e,n){var i,s=$[t],r=(b.defaults(n=n||{},{emulateHTTP:h.emulateHTTP,emulateJSON:h.emulateJSON}),{type:s,dataType:"json"}),o=(n.url||(r.url=b.result(e,"url")||M()),null!=n.data||!e||"create"!==t&&"update"!==t&&"patch"!==t||(r.contentType="application/json",r.data=JSON.stringify(n.attrs||e.toJSON(n))),n.emulateJSON&&(r.contentType="application/x-www-form-urlencoded",r.data=r.data?{model:r.data}:{}),!n.emulateHTTP||"PUT"!==s&&"DELETE"!==s&&"PATCH"!==s||(r.type="POST",n.emulateJSON&&(r.data._method=s),i=n.beforeSend,n.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",s),i)return i.apply(this,arguments)}),"GET"===r.type||n.emulateJSON||(r.processData=!1),n.error),t=(n.error=function(t,e,i){n.textStatus=e,n.errorThrown=i,o&&o.call(n.context,t,e,i)},n.xhr=h.ajax(b.extend(r,n)));return e.trigger("request",e,t,n),t},{create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"}),C=(h.ajax=function(){return h.$.ajax.apply(h.$,arguments)},h.Router=function(t){t=t||{},this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)}),j=/\((.*?)\)/g,O=/(\(\?)?:\w+/g,U=/\*\w+/g,z=/[\-{}\[\]+?.,\\\^$|#\s]/g,R=(b.extend(C.prototype,e,{preinitialize:function(){},initialize:function(){},route:function(e,i,n){b.isRegExp(e)||(e=this._routeToRegExp(e)),b.isFunction(i)&&(n=i,i=""),n=n||this[i];var s=this;return h.history.route(e,function(t){t=s._extractParameters(e,t);!1!==s.execute(n,t,i)&&(s.trigger.apply(s,["route:"+i].concat(t)),s.trigger("route",i,t),h.history.trigger("route",s,i,t))}),this},execute:function(t,e,i){t&&t.apply(this,e)},navigate:function(t,e){return h.history.navigate(t,e),this},_bindRoutes:function(){if(this.routes){this.routes=b.result(this,"routes");for(var t,e=b.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(z,"\\$&").replace(j,"(?:$1)?").replace(O,function(t,e){return e?t:"([^/?]+)"}).replace(U,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var i=t.exec(e).slice(1);return b.map(i,function(t,e){return e===i.length-1?t||null:t?decodeURIComponent(t):null})}}),h.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)}),q=/^[#\/]|\s+$/g,F=/^\/+|\/+$/g,B=/#.*$/,M=(R.started=!1,b.extend(R.prototype,e,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){t=(t||this).location.href.match(/#(.*)$/);return t?t[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return(t=null==t?this._usePushState||!this._wantsHashChange?this.getPath():this.getHash():t).replace(q,"")},start:function(t){if(R.started)throw new Error("Backbone.history has already been started");if(R.started=!0,this.options=b.extend({root:"/"},this.options,t),this.root=this.options.root,this._trailingSlash=this.options.trailingSlash,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||7<document.documentMode),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(F,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot())return t=this.root.slice(0,-1)||"/",this.location.replace(t+"#"+this.getPath()),!0;this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}this._hasHashChange||!this._wantsHashChange||this._usePushState||(this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1,(t=(t=document.body).insertBefore(this.iframe,t.firstChild).contentWindow).document.open(),t.document.close(),t.location.hash="#"+this.fragment);t=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?t("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),R.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if((e=e===this.fragment&&this.iframe?this.getHash(this.iframe.contentWindow):e)===this.fragment)return!this.matchRoot()&&this.notfound();this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(e){return this.matchRoot()&&(e=this.fragment=this.getFragment(e),b.some(this.handlers,function(t){if(t.route.test(e))return t.callback(e),!0}))||this.notfound()},notfound:function(){return this.trigger("notfound"),!1},navigate:function(t,e){if(!R.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var i=this.root,i=(i=this._trailingSlash||""!==t&&"?"!==t.charAt(0)?i:i.slice(0,-1)||"/")+t,n=(t=t.replace(B,""),this.decodeFragment(t));if(this.fragment!==n){if(this.fragment=n,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,i);else{if(!this._wantsHashChange)return this.location.assign(i);this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)&&(n=this.iframe.contentWindow,e.replace||(n.document.open(),n.document.close()),this._updateHash(n.location,t,e.replace))}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,i){i?(i=t.href.replace(/(javascript:|#).*$/,""),t.replace(i+"#"+e)):t.hash="#"+e}}),h.history=new R,v.extend=m.extend=C.extend=y.extend=R.extend=function(t,e){var i=this,n=t&&b.has(t,"constructor")?t.constructor:function(){return i.apply(this,arguments)};return b.extend(n,i,e),n.prototype=b.create(i.prototype,t),(n.prototype.constructor=n).__super__=i.prototype,n},function(){throw new Error('A "url" property or function must be specified')}),N=function(e,i){var n=i.error;i.error=function(t){n&&n.call(i.context,e,t,i),e.trigger("error",e,t,i)}};return h._debug=function(){return{root:t,_:b}},h});
(()=>{var e;(()=>{function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}var t;window.ThriveComments=window.ThriveComments||{},ThriveComments.util=ThriveComments.util||{},_.templateSettings={evaluate:/<#([\s\S]+?)#>/g,interpolate:/<#=([\s\S]+?)#>/g,escape:/<#-([\s\S]+?)#>/g},t=jQuery,ThriveComments.util.tpl=function(e,n){var i=t("script#"+e.replace(/\//g,"-")).html()||"";return n?_.template(i)(n):_.template(i)},ThriveComments.util.nested=function(e,t){var n=this;return e instanceof Backbone.Model?this.nested(e.attributes,t):_.each(t,(function(t){t.children&&(e[t.name]=n.nested(e[t.name],t.children)),_.isArray(e)?_.each(e,(function(e){e[t.name]=new t.obj(e[t.name])})):e[t.name]=new t.obj(e[t.name])})),e},ThriveComments.util.validateInput=function(e,n,i){var o=(e=e instanceof jQuery?e:t(e)).val(),s=!0;return""==(o=o.trim())?(n||(n=ThriveComments.util.render_label("isRequired")),s=!1,e.removeClass("tcm-valid"),e.addClass("tcm-invalid"),e.prev(".tcm-error-message").show().html(n)):(e.removeClass("tcm-invalid"),e.prev(".tcm-error-message").hide(n)),s},ThriveComments.util.validateInputUrl=function(e,n,i){var o=(e=e instanceof jQuery?e:t(e)).val(),s=!0;return null!=o&&0==this.isValidUrl(this.addHttp(o))?(n||(n=ThriveComments.util.render_label("isRequired")),s=!1,e.removeClass("tcm-valid"),e.addClass("tcm-invalid"),e.prev(".tcm-error-message").show().html(n)):(e.removeClass("tcm-invalid"),e.prev(".tcm-error-message").hide(n)),s},ThriveComments.util.validateStoringConsent=function(e,n){var i=(e=e instanceof jQuery?e:t(e)).is(":checked"),o=e.siblings(".tcm-consent-text"),s=ThriveComments.util.get_cookie("tcm_cookie_user_name"),r=!0;return""===ThriveComments.settings.storing_consent||0===ThriveComments.settings.storing_consent||(i||""!==s?(o.removeClass("tcm-not-selected"),e.prev(".tcm-error-message").hide(n)):(n||(n=ThriveComments.util.render_label("isRequired")),r=!1,o.removeClass("tcm-not-selected"),o.addClass("tcm-not-selected"),e.prev(".tcm-error-message").show().html(n))),r},ThriveComments.util.validateEmail=function(e,n){var i=(e=e instanceof jQuery?e:t(e)).val();return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(i)?(e.removeClass("tcm-invalid"),e.prev(".tcm-error-message").hide(),!0):(e.removeClass("tcm-valid"),e.addClass("tcm-invalid"),e.prev(".tcm-error-message").show().html(n),!1)},ThriveComments.util.valuesToArray=function(e){return Object.keys(e).map((function(t){return e[t]}))},ThriveComments.util.set_avatar_url=function(e){e.length&&e.attr("data-src")===ThriveComments.default_author_picture_url&&this.checkGravatar(e.attr("data-email-hash")).done((function(t){e.css("background-image",'url("'+t+'")')}))},ThriveComments.util.previousUser=function(){return""!==ThriveComments.util.get_cookie("social-login")||!!ThriveComments.current_user.ID||void 0},ThriveComments.util.set_cookie=function(t,n,i,o){o=o||"/",i=i||2592e3;var s,r=new Date;i=parseInt(i),r.setTime(r.getTime()+1e3*i),s=r.toUTCString(),"object"===e(n)&&(n=JSON.stringify(n)),document.cookie=encodeURIComponent(t)+"="+n+";expires="+s+";path="+o},ThriveComments.util.get_cookie=function(e){for(var t=e+"=",n=document.cookie.split(";"),i=0;i<n.length;i++){for(var o=n[i];" "==o.charAt(0);)o=o.substring(1);if(0==o.indexOf(t))return o.substring(t.length,o.length)}return""},ThriveComments.util.search_comment=function(e,t){return void 0!==e.models&&this.search_recursive(e.models,t)},ThriveComments.util.search_recursive=function(e,t){for(var n=0,i=0;!n&&i<e.length;i++)e[i].get("comment_ID")==t?n=e[i]:e[i].get("children")&&e[i].get("children").length&&(n=n||this.search_recursive(e[i].get("children"),t));return n},ThriveComments.util.elem_viewport=function(e){var n=e.offset(),i=n?n.top:0,o=i+e.outerHeight(),s=t(window).scrollTop(),r=s+t(window).height();return o>s&&i<r},ThriveComments.util.focusElement=function(e){var n,i=e.offset().top,o=e.height(),s=t(window).height();n=o<s?i-(s/2-o/2):i,t("html, body").animate({scrollTop:n},300,"easeOutQuint")},ThriveComments.util.save_setting_model=function(e,t,n,i){if(!e)return!1;(i=i||{}).success||(i.success=ThriveComments.translations.settings_saved_success_toast),i.fail||(i.fail=ThriveComments.translations.settings_saved_fail_toast),new ThriveComments.models.Settings({name:e,value:t}).save().done((function(o){"NoMessage"!==i.success&&TVE_Dash.success(i.success),-1!==ThriveComments.tcm_sync_settings.indexOf(e)&&n.where({name:e}).shift().set("value",t)})).fail((function(e){TVE_Dash.err(i.fail)}))},ThriveComments.util.render_label=function(e,t,n){var i,o,s,r,m,a;if(t||(t=""),!(i=window.parent.ThriveComments?void 0===window.parent.ThriveComments.objects.Settings?ThriveComments.tcm_customize_labels:window.parent.ThriveComments.objects.Settings.get(ThriveComments.tcm_labels_key).get("value"):ThriveComments.tcm_customize_labels)||!i.hasOwnProperty(e))return"";if(-1===(m=i[e].text).indexOf("{"))return m;switch(s=m.indexOf("{"),r=m.indexOf("}"),n){case"before":a=m.substr(0,s);break;case"after":a=m.substr(r+1,m.length-1);break;default:o=m.substring(s,r+1),a=m.replace(o,t)}return a},ThriveComments.util.showCommentsNumber=function(e){var n=t(".tcm-comments-number");n.length&&n.html(n.html().replace("comment_count",e)).show()},ThriveComments.util.tcm_show_loader=function(){t(".tcm-dot-loader").show()},ThriveComments.util.tcm_hide_loader=function(){t(".tcm-dot-loader").hide(),t(".thrive-comments-content").show()},ThriveComments.util.tcm_hide_textareas=function(e){var n=t(e.currentTarget).closest(".tcm-reply-container").find(".tcm-reply-btn").attr("data-id");t("textarea[name=tcm-post-content]").each((function(){var e=t(this).closest(".tcm-comment-wrapper"),i=t(this).closest(".tcm-reply-container").find(".tcm-reply-btn").attr("data-id"),o=e.find(".tcm-create-post-container").attr("data-position");void 0!==n&&t(this).closest(".comment-id-0").find(".tcm-comment-additional-fields").hide(),""!=o&&"top"===o||n==i||(t(this).closest(".tcm-comment-wrapper").slideUp(),t(this).closest(".tcm-reply-container").find(".tcm-reply-btn").attr("data-clicked",0))}))},ThriveComments.util.after_ajax_login_actions=function(){t(".tcm-lazy-comments").empty(),t.ajax({headers:{"X-WP-Nonce":ThriveComments.nonce},cache:!1,url:ThriveComments.routes.generate_nonce,dataType:"JSON",data:{action:"refresh_nonce"},type:"GET"}).done((function(e){var n=window.parent.ThriveComments.util.commentId,i=n?"comments/"+n:"";ThriveComments.current_user=e.current_user,ThriveComments.nonce=e.nonce,Backbone.history.loadUrl(i),t(".tcm-comment-item").each((function(){var e=t(this);e.find(".tcm-comment-wrapper").hide(),e.find(".tcm-error-heading").hide()}))}))},ThriveComments.util.focusAfterLogin=function(){if(this.commentId&&parseInt(this.commentId)===this.commentId){var e=t("div[data-comment-id="+this.commentId+"]");e.find(".tcm-reply-btn").click(),e.find("#tcm-post-content").val(this.content).focus()}if("bottom"===this.position){var n=t(".add-comment");n.click(),n.closest(".tcm-lazy-comments").find("textarea#tcm-post-content").val(this.content).focus()}"top"===this.position&&t("textarea#tcm-post-content").focus(),this.position=null},ThriveComments.util.scrollToElement=function(e){e.length&&t("body, html").animate({scrollTop:e.offset().top-t(window).height()/2+30},{duration:500,complete:function(){var t=e.parent();t.addClass("tcm-highlight-item"),setTimeout((function(){return t.removeClass("tcm-highlight-item")}),800)}})},ThriveComments.util.showCommentConversion=function(e){var t=new ThriveComments.views.CommentConversion({commentView:e});t.handleAfterShowAction(),e.$el.prepend(t.$el)},ThriveComments.util.isValidUrl=function(e){return!(null===e.match(/(http(s)?:\/\/.)(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g))},ThriveComments.util.addHttp=function(e){return(e=t.trim(e))&&!/^(?:f|ht)tps?\:\/\//.test(e)&&(e="http://"+e),e},ThriveComments.util.err=function(e,n,i){t(".tvd-toast").remove(),Toasts.init(e,n||3e3,"tvd-toast tvd-red",i,"bottom"),t(".tvd-toast").parent().addClass("tcm-frontend-toast")},ThriveComments.util.getDropDownItems=function(e){var t;if(e.meta_query.tcm_delegate)t={approve:1,unapprove:1,no_reply_needed:1,featured:1,delegate:1,spam:1,trash:1};else if(e.meta_query.tcm_featured)t={stop_featured:1,no_reply_needed:1,delegate:1};else switch(e.status){case"all":case"hold":case"tcm_unreplied":t={approve:1,unapprove:1,no_reply_needed:1,featured:1,delegate:1,spam:1,trash:1};break;case"featured":t={no_reply_needed:1,stop_featured:1,delegate:1};break;case"spam":t={not_spam:1,delete:1};break;case"trash":t={spam:1,restore:1,delete:1}}return t},ThriveComments.util.dynamicSortByProperty=function(e){var t=1;return"-"===e[0]&&(t=-1,e=e.substr(1)),function(n,i){return(n[e]<i[e]?-1:n[e]>i[e]?1:0)*t}},ThriveComments.util.insertAtCaret=function(e,t){if(e.length){var n=e[0],i=n.scrollTop,o=0,s=n.selectionStart||"0"==n.selectionStart?"ff":!!document.selection&&"ie";if("ie"==s){n.focus();var r=document.selection.createRange();r.moveStart("character",-n.value.length),o=r.text.length}else"ff"==s&&(o=n.selectionStart);var m=n.value.substring(0,o),a=n.value.substring(o,n.value.length);if(n.value=m+t+a,o+=t.length,"ie"==s){n.focus();var c=document.selection.createRange();c.moveStart("character",-n.value.length),c.moveStart("character",o),c.moveEnd("character",0),c.select()}else"ff"==s&&(n.selectionStart=o,n.selectionEnd=o,n.focus());n.scrollTop=i}},ThriveComments.util.ajaxurl=function(e){var t=-1!==ajaxurl.indexOf("?")?"&":"?";return e&&e.length?(e=e.replace(/^(\?|&)/,""),e+="&_nonce="+ThriveComments.admin_nonce,ajaxurl+t+e):ajaxurl+t+"_nonce="+ThriveComments.admin_nonce},ThriveComments.util.toCamelCase=function(e){return(e=e.replace(/_/g," ")).toLowerCase().replace(/(?:(^.))/g,(function(e){return e.charAt(e.length-1).toUpperCase()}))},ThriveComments.util.formatSelection=function(e){var t,n,i,o=e instanceof jQuery?e[0]:document.getElementById(e);return void 0!==document.selection?(o.focus(),t=document.selection.createRange().text):void 0!==o.selectionStart&&(n=o.selectionStart,i=o.selectionEnd,t=o.value.substring(n,i)),{selectedText:t,startPos:n,endPos:i}},ThriveComments.util.set_subscriber_cookies=function(e){var t=ThriveComments.util.get_cookie("subscribed_posts");if(""!==t&&(t=JSON.parse(t)),0===e){var n=t.indexOf(ThriveComments.post.ID);n>-1&&(t.splice(n,1),ThriveComments.util.set_cookie("subscribed_posts",JSON.stringify(t),31104e3))}else""===t?t=[ThriveComments.post.ID]:t.push(ThriveComments.post.ID),ThriveComments.util.set_cookie("subscribed_posts",JSON.stringify(t),31104e3)},ThriveComments.util.checkGravatar=function(e){var n=this,i=t.Deferred();if(this.gravatarCache=this.gravatarCache||{},this.gravatarCache[e])this.gravatarCache[e].success?i.resolve(this.gravatarCache[e].url):i.reject();else{var o="https://www.gravatar.com/avatar/"+e+"?s=512";t.ajax({type:"HEAD",url:o+"&d=404"}).done((function(t){n.gravatarCache[e]={url:o,success:!0},i.resolve(o)})).fail((function(){n.gravatarCache[e]={url:"",success:!1},i.reject()}))}return i}})(),window.ThriveComments=window.ThriveComments||{},ThriveComments.models=ThriveComments.models||{},ThriveComments.collections=ThriveComments.collections||{},jQuery,ThriveComments.models.Base=Backbone.Model.extend({idAttribute:"comment_ID",sync:function(e,t,n){var i;return(n=n||{}).cache=!1,_.isUndefined(ThriveComments.nonce)||_.isNull(ThriveComments.nonce)||(i=n.beforeSend,n.beforeSend=function(e){if(e.setRequestHeader("X-WP-Nonce",ThriveComments.nonce),i)return i.apply(this,arguments)}),Backbone.sync(e,t,n)}}),ThriveComments.collections.Base=Backbone.Collection.extend({sync:function(e,t,n){var i;return(n=n||{}).cache=!1,n.url=this.url(),_.isUndefined(ThriveComments.nonce)||_.isNull(ThriveComments.nonce)||(i=n.beforeSend,n.beforeSend=function(e){if(e.setRequestHeader("X-WP-Nonce",ThriveComments.nonce),i)return i.apply(this,arguments)}),Backbone.sync(e,t,n)}}),ThriveComments.models.Comment=ThriveComments.models.Base.extend({getCommentStatus:function(){var e="";switch(1===parseInt(this.get("tcm_featured"))&&(e="featured"),this.get("comment_approved").toString()){case"1":case"approved":e="approved";break;case"0":case"hold":e="unapproved";break;case"spam":e="spam";break;case"trash":e="trash";break;default:0===parseInt(this.get("tcm_featured"))&&(e="stop_featuring")}return e},setCommentApproved:function(){if(void 0!==this.get("status")){var e=this.get("status")===ThriveComments.const.moderation.unapprove?0:1;this.set("comment_approved",e)}},url:function(){return ThriveComments.routes.comments+"/"+ThriveComments.post.ID},isPostAuthor:function(){return this.attributes.user_id===ThriveComments.post.post_author},parse:function(e){return delete e.author,void 0===e.replace_keyword||!1===e.replace_keyword||(ThriveComments.settings.tcm_keywords&&ThriveComments.settings.tcm_keywords.sort(ThriveComments.util.dynamicSortByProperty("-name")),_.each(ThriveComments.settings.tcm_keywords,(function(t){var n=t.name.split(", ");_.each(n,(function(n){var i,o='<a href="'+t.value+'"';t.new_tab&&(o+=' target="_blank"'),t.no_follow&&(o+=' rel="nofollow"'),n=n.trim(),o+=">"+n+"</a>";var s=new RegExp("\\b"+n+"\\b(?![^<]*?<\\/a>)","gi"),r=n.length,m=(i=e.comment_content).match(s);_.each(m,(function(e){var t=i.search(s),m=o,a=o.search(">"+n+"<")+1;m=[m.slice(0,a),e,m.slice(a+r)].join(""),i=[i.slice(0,t),m,i.slice(t+r)].join("")})),e.comment_content=i}))}))),e}}),ThriveComments.collections.Comments=ThriveComments.collections.Base.extend({model:ThriveComments.models.Comment,compField:ThriveComments.sorting.sort_field,compOrder:ThriveComments.sorting.order,tcm_secret:"",commentCount:0,awaiting_moderation:0,userCommentCount:0,minCompField:null,url:function(){return ThriveComments.routes.comments+"/"+ThriveComments.post.ID},comparator:function(e){return 1===parseInt(e.get("tcm_featured"))?-1*Number.MAX_SAFE_INTEGER+this.compOrder*e.get(this.compField):this.compOrder*e.get(this.compField)},nested:function(e){var t=this;return e.children&&_.each(e.children,(function(n,i){t.nested(n),e.children[i]=new ThriveComments.models.Comment(n,{parse:!0})})),e},parse:function(e){var t=this;return this.commentCount=e.count,this.userCommentCount=e.user_comment_count,e=e.comments,_.each(e,(function(n,i){n.children&&n.children.length&&(e[i]=t.nested(n))})),e},insertComment:function(e,t){var n=this;_.each(e,(function(i,o){if(i.get("comment_ID")===parseInt(t.get("comment_parent"))){var s=e[o].get("children");s||(s=[]),s.push(t),e[o].set("children",s)}else i.get("children")&&i.get("children").length&&n.insertComment(i.get("children"),t)}))},push:function(e){this.commentCount++,0==e.get("comment_parent")?(this.models.push(e),this.length=this.length+1):this.insertComment(this.models,e)},countFeaturedComments:function(){return this.where({tcm_featured:"1"}).length}}),window.ThriveComments=window.ThriveComments||{},ThriveComments.views=ThriveComments.views||{},ThriveComments.objects=ThriveComments.objects||{},e=jQuery,ThriveComments.views.CreateComment=Backbone.View.extend({template:ThriveComments.util.tpl("comments/create"),events:{"focus #tcm-post-content":"showMainCreateFields","click .tcm-save-btn":"saveComment","click .tcm-show-login":"showLogin","keydown .form-input":"keyAction","input textarea":"textareaSizing","click #tcm-fb-logo":"facebookLogin","click .tcm-logout-label":"logout"},keyAction:function(e){13===e.keyCode&&(this.saveComment(e),e.stopPropagation())},initialize:function(e){e&&(this.viewList=e.viewList),this.comments_media_query()},comments_media_query:function(){var e=this.$el.parents("#comments");e.width()<600&&e.addClass("tcm-small")},textareaSizing:function(t){var n=t.currentTarget;e(n).css("height",1).css("height",n.scrollHeight+2)},showMainCreateFields:function(e){if(ThriveComments.util.tcm_hide_textareas(e),this.viewList.showPreviousClickedReplys(),this.$(".tcm-comment-additional-fields").slideDown(),!ThriveComments.current_user.ID){var t=decodeURIComponent(ThriveComments.util.get_cookie("tcm_cookie_user_name")).slice(1,-1).replace(/\+/g," "),n=decodeURIComponent(ThriveComments.util.get_cookie("tcm_cookie_user_email")).slice(1,-1),i=JSON.parse('{ "link": "'+decodeURIComponent(ThriveComments.util.get_cookie("tcm_cookie_user_website")).slice(1,-1)+'" }');t&&""===this.$("#tcm-guest-name").val()&&(this.$("#tcm-guest-name").val(t),this.$("#tcm-guest-email").val(n),this.$("#tcm-author-url").val(i.link),this.$("span.checkmark").click())}ThriveComments.currentOpenView=this},render:function(t){var n=this.$("#tcm-post-content").val(),i=ThriveComments.util.get_cookie("social-login");return""!==i&&(ThriveComments.social_user=JSON.parse(i)),t=e.extend({},t,{gravatarActive:ThriveComments.settings.gravatar_active,share_individual_comments:ThriveComments.settings.share_individual_comments,comment_registration:ThriveComments.settings.comment_registration,current_user_id:void 0!==ThriveComments.current_user.ID?ThriveComments.current_user.ID:0,comment_content:void 0!==n?n:"",close_comments:ThriveComments.close_comments}),this.$el.html(this.template(t)),this.afterRender(t),this},afterRender:function(t){if(new ClipboardJS("#tcm-click-to-copy").on("success",(function(t){var n=e(t.trigger),i=n.text();n.text(ThriveComments.util.render_label("copy_input")),setTimeout((function(){n.text(i)}),1e3),t.clearSelection()})),1===ThriveComments.settings.tcm_api_status.google_api&&ThriveComments.settings.tcm_enable_social_signin)var n=setInterval((function(){window.google&&window.google.accounts&&(window.google.accounts.id.renderButton(document.getElementById("tcm-google-sign-in-".concat(t.id)),{type:"icon",shape:"pill"}),clearInterval(n))}),1e3)},saveComment:function(t){var n=this;if(!this.validateComment())return!1;this.$("#tcm-submit-comment").text(ThriveComments.util.render_label("comment_sending"));var i=this.prepareCommentForSave();(i=new ThriveComments.models.Comment(i)).save().done((function(i){var o=new ThriveComments.models.Comment(i),s=n.$("textarea");e(".tcm-post-input-container textarea").val(""),n.$("#tcm-submit-comment").text(ThriveComments.util.render_label("submit_comment")),"trash"!==o.get("comment_approved")&&n.addNewCommentToList(t.currentTarget,o,0),n.removeCreateForm(),s.css("height",1),n.replyAndApprove(i,o),e(".tcm-reply-btn").attr("data-clicked",0),n.viewList.showPreviousClickedReplys()})).fail((function(e){var t=n.handleError(e);ThriveComments.util.err(t)})).always((function(){n.$("#tcm-submit-comment").text(ThriveComments.util.render_label("submit_comment"))}))},prepareCommentForSave:function(){var e,t,n,i=ThriveComments.util.get_cookie("social-login"),o=this.$("#tcm-author-url").val(),s="",r={};return""!==i?(t=(e=JSON.parse(i)).name,n=e.email,s=e.picture):(t=ThriveComments.util.previousUser()?ThriveComments.current_user.display_name:this.$("input[name='name']").val(),n=ThriveComments.util.previousUser()?ThriveComments.current_user.user_email:this.$("input[name='email']").val()),this.$(".tcm-extra-fields input").each((function(){this.checked&&(r[this.getAttribute("name")]=this.value)})),{children:[],comment_content:this.$("#tcm-post-content").val().trim(),comment_author:t,comment_author_email:n,comment_author_url:void 0!==o&&ThriveComments.util.isValidUrl(ThriveComments.util.addHttp(o))?o:"",comment_author_picture:s,comment_parent:this.$(".tcm-save-btn").attr("data-parent"),level:this.$(".tcm-save-btn").attr("data-parent")>0?Math.min(parseInt(this.$(".tcm-save-btn").attr("data-level"))+1,3):0,secret_spam:ThriveComments.secret_spam,comment_post_ID:ThriveComments.post.ID,tva_term:void 0!==ThriveComments.tva_term&&ThriveComments.tva_term,tcm_receive_notifications:this.$("#tcm_receive_notifications").prop("checked"),tcm_remember_me:this.$("#tcm_remember_me").prop("checked"),tcm_storing_consent:this.$("#tcm_storing_consent").prop("checked"),tcm_extra_fields:r}},handleError:function(e){var t="";switch(e.status){case 409:t=ThriveComments.util.render_label("comment_duplicate");break;case 429:t=ThriveComments.util.render_label("comment_flood");break;default:""===(t=ThriveComments.util.render_label(e.responseJSON.code))&&(t=e.responseJSON.code+". "+e.responseJSON.message)}return t},replyAndApprove:function(e,t){var n=t.get("comment_parent"),i=null;if(n&&t.get("is_moderator")&&(i=ThriveComments.util.search_comment(ThriveComments.objects.Comments,n))){var o={id:i.get("comment_ID")};i.set("comment_approved",1),i.set("status",1),i.save(o,{error:this.handleError})}},removeCreateForm:function(){var e=this.$(".mainInput");e.parents("div.tcm-lazy-comments").length&&this.$(".tcm-create-post-container").hide(),e.length?(e.val(""),this.$(".tcm-comment-additional-fields").hide()):this.$el.remove()},addNewCommentToList:function(t,n,i){var o,s=jQuery(t).closest(".tcm-comment-item");return!!this.$el.siblings(".tcm-comments-list").first().find("div[data-comment-id="+n.get("comment_ID")+"]").length||(ThriveComments.objects.Comments.push(n),this.updateCommentCountLabel(n),(o=this.insertCommentIntoPosition(t,n,s,i))&&ThriveComments.util.showCommentConversion(o),e(window).trigger("scroll"),this)},insertCommentIntoPosition:function(t,n,i,o){var s,r=new ThriveComments.views.CommentsItem({model:n,commentsList:this.viewList});if(s=r.render().$el,!i.length){var m=e(t).closest(".tcm-create-post-container").attr("data-position");return s.addClass("tcm-main-parent"),"top"===m&&-1===ThriveComments.objects.Comments.compOrder?(this.$el.next().prepend(s),r):"bottom"!==m||1!==ThriveComments.objects.Comments.compOrder||jQuery(".tcm-loader").is(":visible")?o?(jQuery(".tcm-loader").is(":visible")&&-1!==ThriveComments.objects.Comments.compOrder||this.$el.next().prepend(s),r):(this.viewList.close(),this.viewList.pushCommentsCreated({comment_id:n.get("comment_ID"),comment_after_save:n.get("show_after_save")}),this.viewList.initDisplayComments(n.get("comment_ID")),!1):(this.$el.parent().prev().append(s),r)}return n.get("level")>2&&s.addClass("stop-nesting"),i.append(s),r},updateCommentCountLabel:function(t){"1"===t.get("comment_approved")&&e(".tcm-comments-number").text((function(e,t){return t.replace(/(\d+)/,ThriveComments.objects.Comments.commentCount)}))},validateComment:function(){var e=!0;return ThriveComments.util.get_cookie("social-login"),ThriveComments.util.previousUser()||(ThriveComments.util.validateInput(this.$("input[name='name']"),ThriveComments.util.render_label("author_name_required"),!0)||(e=!1),ThriveComments.util.validateEmail(this.$("input[name='email']"),ThriveComments.util.render_label("isRequired"),!0)||(e=!1),""!==this.$("#tcm-author-url").val()&&(ThriveComments.util.validateInputUrl(this.$("#tcm-author-url"),ThriveComments.util.render_label("invalid_website_url"),!0)||(e=!1)),ThriveComments.util.validateStoringConsent(this.$("#tcm_storing_consent"),ThriveComments.util.render_label("accept_privacy_checkbox"))||(e=!1)),ThriveComments.util.validateInput(this.$("#tcm-post-content"),ThriveComments.util.render_label("comment_content_missing"),!0)||(e=!1),e},showLogin:function(t){var n,i=e("#wp-auth-check"),o=e("#wp-auth-check-form"),s=e("#wp-auth-check-wrap"),r=s.find(".wp-auth-fallback-expired"),m=this,a=!1,c=jQuery(t.currentTarget).closest(".tcm-create-post-container");if(ThriveComments.util.position=c.data("position"),ThriveComments.util.content=c.find("textarea#tcm-post-content").val(),ThriveComments.util.afterLogin=1,ThriveComments.util.commentId=c.data("comment-id"),o.length){e(window).on("beforeunload.wp-auth-check",(function(e){e.originalEvent.returnValue=window.authcheckL10n.beforeunload}));var l=o.attr("data-src").replace("members/login/","wp-login.php");o.attr("data-src",l),(n=e('<iframe id="wp-auth-check-frame" frameborder="0">').attr("title",r.text())).on("load",(function(){var t,n;a=!0,o.removeClass("loading");try{t=(n=e(this).contents().find("body")).height()}catch(e){return s.addClass("fallback"),i.css("max-height",""),o.remove(),void r.focus()}t?n&&n.hasClass("interim-login-success")?m.hideLogin():i.css("max-height",t+40+"px"):n&&n.length||(s.addClass("fallback"),i.css("max-height",""),o.remove(),r.focus())})).attr("src",l).ready((function(){s.find(".wp-auth-check-close").on("click",(function(){m.hideLogin()}))})),o.append(n)}e("body").addClass("modal-open"),s.removeClass("hidden"),n?(n.focus(),setTimeout((function(){a||(s.addClass("fallback"),o.remove(),r.focus())}),1e4)):r.focus()},hideLogin:function(){var t=e("#wp-auth-check-wrap");e(window).off("beforeunload.wp-auth-check"),"undefined"==typeof adminpage||"post-php"!==adminpage&&"post-new-php"!==adminpage||"undefined"==typeof wp||!wp.heartbeat||(e(document).off("heartbeat-tick.wp-auth-check"),wp.heartbeat.connectNow()),t.fadeOut(200,(function(){t.addClass("hidden").css("display",""),e("#wp-auth-check-frame").remove(),e("body").removeClass("modal-open")}))},checkConversion:function(e){("first_time"==e.show_after_save&&"tcm_redirect"==ThriveComments.settings.tcm_conversion.first_time.active||"second_time"==e.show_after_save&&"tcm_redirect"==ThriveComments.settings.tcm_conversion.second_time.active)&&this.redirectURL(e)},redirectURL:function(e){"first_time"==e.show_after_save?window.location.replace(ThriveComments.settings.tcm_conversion.tcm_redirect.first_time.redirect_url):"second_time"==e.show_after_save&&window.location.replace(ThriveComments.settings.tcm_conversion.tcm_redirect.second_time.redirect_url)},facebookLogin:function(e){var t=this;FB.login((function(e){e.authResponse&&FB.api("/me?fields=name,email",(function(e){var n={name:e.name,email:e.email,picture:location.protocol+"//graph.facebook.com/"+e.id+"/picture?width=200"};ThriveComments.util.set_cookie("social-login",n),ThriveComments.social_user=n,t.reloadView()}))}),{scope:"email"})},logout:function(e){ThriveComments.util.set_cookie("social-login","",-1),delete ThriveComments.social_user,this.reloadView()},reloadView:function(){var t=this.$(".tcm-create-post-container"),n=t.data("comment-id"),i=n?"comments/"+n:"";ThriveComments.util.position=t.data("position"),ThriveComments.util.content=t.find("textarea#tcm-post-content").val(),ThriveComments.util.afterLogin=1,ThriveComments.util.commentId=n,Backbone.history.loadUrl(i),e(".tcm-comment-item").each((function(){var t=e(this);t.find(".tcm-comment-wrapper").hide(),t.find(".tcm-error-heading").hide()}))}}),ThriveComments.views.SortComments=Backbone.View.extend({template:ThriveComments.util.tpl("comments/sort"),sortBy:ThriveComments.sorting.sort_name,events:{"click #tcm-sort-by":"mouseEnterShare","click .tcm-dropdown-element":"sortComments","mouseenter #tcm-sort-by":"mouseEnterShare","mouseleave #tcm-sort-by":"mouseLeaveShare"},initialize:function(e){this.viewList=e.viewList,this.render()},render:function(){this.$el.empty(),this.$el.append(this.template({sortBy:this.sortBy}))},sortComments:function(e){var t=e.currentTarget.getAttribute("data-value");jQuery(e.currentTarget).parent().siblings(".current-sorting").html(e.currentTarget.innerHTML.trim()),this.sortBy=t,this.viewList.sortComments(t),jQuery("#tcm-sort-by").removeClass("tcm-share-dropdown-hover")},mouseEnterShare:function(e){return"click"===e.type&&e.stopPropagation(),!e.target.classList.contains("tcm-sort-by")&&e.currentTarget.classList.add("tcm-share-dropdown-hover"),!1},mouseLeaveShare:function(e){return jQuery(e.currentTarget).removeClass("tcm-share-dropdown-hover"),!1}}),ThriveComments.views.Comments=Backbone.View.extend({template:ThriveComments.util.tpl("comments/list"),events:{"change #tcm-sort-by":"sortComments"},viewLazy:null,viewSort:null,comments_rendered:0,commentsCreated:[],lazyFlag:1,clickedRplyButtons:[],initialize:function(t){var n,i,o,s,r;this.viewLazy=t.viewLazy,this.viewSort=t.viewSort,"undefined"==typeof FB&&1===ThriveComments.settings.tcm_api_status.facebook&&1===ThriveComments.settings.tcm_api_status.facebook_api&&ThriveComments.settings.tcm_enable_social_signin&&(window.fbAsyncInit=function(){FB.init({appId:ThriveComments.tcm_social_apis.facebook.app_id,autoLogAppEvents:!0,status:!0,xfbml:!0,version:"v2.9"})},i="script",o="facebook-jssdk",r=(n=document).getElementsByTagName(i)[0],n.getElementById(o)||((s=n.createElement(i)).id=o,s.src="//connect.facebook.net/en_US/sdk.js",r.parentNode.insertBefore(s,r))),1===ThriveComments.settings.tcm_api_status.google_api&&ThriveComments.settings.tcm_enable_social_signin&&(window.onGoogleLibraryLoad=function(){window.google.accounts.id.initialize({client_id:ThriveComments.tcm_social_apis.google.client_id,context:"use",ux_mode:"popup",auto_prompt:!1,callback:function(e){var t,n,i=(t=e.credential.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),n=decodeURIComponent(window.atob(t).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join("")),JSON.parse(n)),o={name:i.name,email:i.email,picture:i.picture};ThriveComments.util.set_cookie("social-login",o),ThriveComments.social_user=o,void 0!==ThriveComments.currentOpenView&&"function"==typeof ThriveComments.currentOpenView.reloadView&&ThriveComments.currentOpenView.reloadView()}})},e.getScript("https://accounts.google.com/gsi/client"))},close:function(){this.$el.empty(),this.unbind()},startLazy:function(e){var t=this;if(!e&&ThriveComments.settings.lazy_load){var n=jQuery("#thrive-comments");(this.lazyFlag&&ThriveComments.util.elem_viewport(n)||ThriveComments.util.elem_viewport(this.viewLazy.$el)||ThriveComments.util.afterLogin)&&(t.initDisplayComments(e),t.lazyFlag=0),jQuery(window).scroll((function(){t.lazyFlag&&ThriveComments.util.elem_viewport(n)&&(t.initDisplayComments(e),t.lazyFlag=0)}))}else t.initDisplayComments(e);this.lazy_avatar()},initDisplayComments:function(t){var n=this;if(ThriveComments.util.tcm_show_loader(),"static"===this.viewLazy.type){var i={};ThriveComments.tva_term&&void 0!==ThriveComments.tva_term&&(i.tva_term=ThriveComments.tva_term),this.collection.fetch({data:e.param(i),success:function(){n.displayComments(t)},error:function(e,t){ThriveComments.util.err(ThriveComments.util.render_label("tcm_get_comments_error"))}})}else this.displayComments(t)},lazy_avatar:function(){var t=this;e(window).on("scroll",(function(){t.show_images()}))},show_images:function(){e("div.no-image").each((function(){var t=e(this);if(!0===t.data("social-avatar"))return t.removeClass("no-image"),!1;ThriveComments.util.elem_viewport(t)&&(ThriveComments.util.set_avatar_url(t),t.removeClass("no-image"))}))},displayComments:function(e){this.viewLazy.view=this,this.viewLazy.changePage(null,{id:e,page:1,sortBy:ThriveComments.sorting.sort_field})},sortComments:function(e){switch(e){case"desc":this.collection.compField="comment_ID",this.collection.compOrder=-1;break;case"asc":this.collection.compField="comment_ID",this.collection.compOrder=1;break;case"top-rated":this.collection.compField="comment_karma",this.collection.compOrder=-1}var t=1==this.collection.compOrder?"ASC":"DESC";this.comments_rendered=0,this.viewLazy.changePage(null,{page:1,resetContent:1,sortBy:this.collection.compField,order:t})},render:function(e){var t=this;return ThriveComments.util.showCommentsNumber(this.collection.commentCount),e.forEach((function(e){var n,i=new ThriveComments.views.CommentsItem({model:e,commentsList:t}),o=i.render().$el;o.addClass("tcm-main-parent"),t.$el.append(o),(n=t.searchInCommentsCreated(e.get("comment_ID")))&&(i.model.set("show_after_save",n.comment_after_save),ThriveComments.util.showCommentConversion(i))})),ThriveComments.util.tcm_hide_loader(),this},pushCommentsCreated:function(e){this.commentsCreated.push(e)},searchInCommentsCreated:function(t){if(!this.commentsCreated.length)return!1;var n=e.grep(this.commentsCreated,(function(e){return parseInt(e.comment_id)===t}));return 0!==n.length&&n[0]},addClickedReplyButton:function(e){return this.clickedRplyButtons.push(e),this},showPreviousClickedReplys:function(){return this.clickedRplyButtons.forEach((function(e){1!==parseInt(e.getAttribute("data-clicked"))&&(e.style.display="block")})),this}}),ThriveComments.views.FrontendModeration=Backbone.View.extend({template:ThriveComments.util.tpl("comments/moderation"),actions:{},events:{"click .tcm-dropdown-moderate-element":"updateComment"},initialize:function(e){this.commentView=e.commentView?e.commentView:null,this.setActions(),this.render(),this.initClipboard()},render:function(){var e=this.model.getCommentStatus(),t=this.getActions(e);this.$el.html(this.template({actions:t}))},initClipboard:function(){var t=this.$("[data-value=copyLink]");if(t.length){var n=new ClipboardJS(t[0]),i=ThriveComments.const.post_url+"#comments/"+this.$el.closest(".tcm-comment-content").attr("data-comment-id");t.attr("data-clipboard-text",i),n.on("success",(function(t){var n=e(t.trigger),i=n.text();n.text(ThriveComments.util.render_label("copy_input")),setTimeout((function(){n.text(i)}),1e3),t.clearSelection()}))}},updateComment:function(e){var t=e.currentTarget.getAttribute("data-fn"),n=e.currentTarget.getAttribute("data-value");"function"==typeof this[t]&&this[t](n)},changeApprove:function(e){var t={id:this.model.get("comment_ID")};ThriveComments.const.moderation.unapprove===e&&"0"!==this.model.get("tcm_featured")&&(this.model.set("tcm_featured",0),t.update_meta="tcm_featured"),this.model.set("comment_approved",e),this.model.set("status",e),this.model.save(t,{error:this.errorAtSave})},changeFeature:function(e){var t={id:this.model.get("comment_ID"),update_meta:"tcm_featured"};return ThriveComments.const.moderation.featured===parseInt(e)&&this.model.get("comment_approved")!==ThriveComments.const.moderation.approve&&(this.model.set("status",ThriveComments.const.moderation.approve),this.model.set("comment_approved",1)),this.model.set("tcm_featured",parseInt(e)),this.model.save(t,{error:this.errorAtSave}),this},changeSpam:function(e){var t={id:this.model.get("comment_ID")};this.model.set("comment_approved",e),this.model.set("status",e).save(t,{error:this.errorAtSave})},changeTrash:function(e){var t={id:this.model.get("comment_ID")};this.model.set("status",e).save(t,{error:this.errorAtSave})},undoDelete:function(){var e="trash"===this.model.get("status")?"untrash":"unspam",t={id:this.model.get("comment_ID")};return this.model.set("status",e),this.model.save(t,{error:this.errorAtSave}),!1},errorAtSave:function(e,t,n){var i="";if(t.responseJSON.message)i=t.responseJSON.message;else if(t.responseText)try{i="parsererror"===n?"Could not parse response: "+t.responseText:JSON.parse(t.responseText).message}catch(e){}i||(i=(t.statusText||n)+(t.status?" ("+t.status+")":"")),ThriveComments.util.err(i)},setActions:function(){var e={unapproved:{approve:{text:ThriveComments.util.render_label("approve_text"),fn:"changeApprove",value:1},feature:{text:ThriveComments.util.render_label("feature_text"),fn:"changeFeature",value:ThriveComments.const.moderation.featured},copy:{text:ThriveComments.util.render_label("copy_url"),value:"copyLink"},spam:{text:ThriveComments.util.render_label("spam_text"),fn:"changeSpam",value:ThriveComments.const.moderation.spam},trash:{text:ThriveComments.util.render_label("trash_text"),fn:"changeTrash",value:ThriveComments.const.moderation.trash}},approved:{unapprove:{text:ThriveComments.util.render_label("unapprove_text"),fn:"changeApprove",value:ThriveComments.const.moderation.unapprove},feature:{text:ThriveComments.util.render_label("feature_text"),fn:"changeFeature",value:ThriveComments.const.moderation.featured},copy:{text:ThriveComments.util.render_label("copy_url"),value:"copyLink"},spam:{text:ThriveComments.util.render_label("spam_text"),fn:"changeSpam",value:ThriveComments.const.moderation.spam},trash:{text:ThriveComments.util.render_label("trash_text"),fn:"changeTrash",value:ThriveComments.const.moderation.trash}},featured:{unapprove:{text:ThriveComments.util.render_label("unapprove_text"),fn:"changeApprove",value:ThriveComments.const.moderation.unapprove},stop_featuring:{text:ThriveComments.util.render_label("stop_feature_text"),fn:"changeFeature",value:ThriveComments.const.moderation.not_featured},spam:{text:ThriveComments.util.render_label("spam_text"),fn:"changeSpam",value:ThriveComments.const.moderation.spam},trash:{text:ThriveComments.util.render_label("trash_text"),fn:"changeTrash",value:ThriveComments.const.moderation.trash}},stop_featuring:{unapprove:{text:ThriveComments.util.render_label("unapprove_text"),fn:"changeApprove",value:ThriveComments.const.moderation.unapprove},feature:{text:ThriveComments.util.render_label("feature_text"),fn:"changeFeature",value:ThriveComments.const.moderation.featured},spam:{text:ThriveComments.util.render_label("spam_text"),fn:"changeSpam",value:ThriveComments.const.moderation.spam},trash:{text:ThriveComments.util.render_label("trash_text"),fn:"changeTrash",value:ThriveComments.const.moderation.trash}}},t={approved:{copy:{text:ThriveComments.util.render_label("copy_url"),value:"copyLink"}}};this.actions=ThriveComments.current_user.is_moderator?e:t},getActions:function(e){return""!==e?this.actions[e]:{}}}),ThriveComments.views.DeletedItem=Backbone.View.extend({template:ThriveComments.util.tpl("comments/deleted"),events:{"click .undo-action":"undoAction"},initialize:function(e){this.commentView=e.commentView?e.commentView:null,this.moderationView=e.moderationView?e.moderationView:null},render:function(){return this.$el.html(this.template({comment:this.model})),this.commentView.$(".tcm-comment-content").hide(),this.commentView.$(".tcm-comment-item").hide(),this.commentView.$el.removeClass("tcm-featured-class"),this},undoAction:function(){return this.moderationView.undoDelete(),!1}}),ThriveComments.views.CommentsItem=Backbone.View.extend({className:"tcm-comment-item",template:ThriveComments.util.tpl("comments/item"),voteRoute:ThriveComments.routes.comments+"/vote",events:{"click .tcm-reply-btn":"showCreateFields","click .tcm-share-btn":"showShareButtons","mouseenter .tcm-share-dropdown":"mouseEnterShare","mouseleave .tcm-share-dropdown":"mouseLeaveShare","click .tcm-share-twitter":"shareTwitter","click .tcm-share-facebook":"shareFacebook","click .tcm-voting-input":"vote"},initialize:function(e){this.commentsList=e.commentsList?e.commentsList:null,this.listenTo(this.model,"sync",this.commentSync)},showCreateFields:function(t){var n=new ThriveComments.views.CreateComment({viewList:this.commentsList}),i=t.currentTarget,o=i.getAttribute("data-id"),s=i.getAttribute("data-level");"1"!==i.getAttribute("data-clicked")&&(ThriveComments.util.tcm_hide_textareas(t),this.commentsList.showPreviousClickedReplys(),e(".add-comment").show(),jQuery(i).siblings(".tcm-create-comment-fields").html("").append(n.render({mainInput:0,id:o,level:s,photo_src:ThriveComments.current_user.photo_url,previousUser:ThriveComments.util.previousUser(),position:"",close_comments:ThriveComments.close_comments}).$el).css("display","none").slideDown(),i.setAttribute("data-clicked",1),i.style.display="none",this.commentsList.addClickedReplyButton(i),t.stopPropagation(),jQuery(window).trigger("scroll"))},commentSync:function(){return this.render(),"spam"!==this.model.get("status")&&"trash"!==this.model.get("status")||this.deletedState(),jQuery(window).trigger("scroll"),this},render:function(){var e=ThriveComments.util.get_cookie("vote-comment-"+this.model.id);return this.model.setCommentApproved(),this.$el.html(this.template({comment:this.model,gravatarActive:ThriveComments.settings.gravatar_active,close_comments:ThriveComments.close_comments,share_individual_comments:ThriveComments.settings.share_individual_comments,lazy_load_avatar:ThriveComments.settings.lazy_load_avatar,last_vote:e})),this.afterRender(),this.initCommentModeration(),this.model.get("children")&&this.model.get("children").length&&(this.$el.addClass("tcm-has-children"),this.renderChildren(this.model.get("comment_ID"),this.model.get("children"),this.$el)),this.commentsList.comments_rendered++,this},renderChildren:function(e,t,n){var i=this;t&&t.forEach((function(t){if(0!==parseInt(t.get("comment_parent"))&&parseInt(t.get("comment_parent"))===e){var o,s=new ThriveComments.views.CommentsItem({model:t,commentsList:i.commentsList}),r=s.render().$el;n.append(r),(o=i.commentsList.searchInCommentsCreated(t.get("comment_ID")))&&(s.model.set("show_after_save",o.comment_after_save),ThriveComments.util.showCommentConversion(s),s.handleAfterShowAction())}}))},afterRender:function(){return this.model.get("user_id")===ThriveComments.post.post_author&&(this.$el.addClass("tcm-post-author"),this.$("strong").addClass("tcm-color-ac")),this.model.get("level")>=3&&this.$el.addClass("stop-nesting"),this.model.get("children")&&this.model.get("children").length&&this.$el.addClass("tcm-has-children"),1===parseInt(this.model.get("tcm_featured"))?this.$el.addClass("tcm-featured-class"):this.$el.removeClass("tcm-featured-class"),this},initCommentModeration:function(){this.moderationView=new ThriveComments.views.FrontendModeration({el:this.$("#tcm-moderate-front"),model:this.model,commentView:this})},showShareButtons:function(){this.$(".tcm-share-btns-container").show()},mouseEnterShare:function(e){return jQuery(e.currentTarget).addClass("tcm-share-dropdown-hover"),!1},mouseLeaveShare:function(e){var t=jQuery(e.currentTarget);return t.removeClass("tcm-share-dropdown-hover"),t.find(".tcm-copy-input-content").removeClass("hover"),!1},shareTwitter:function(e){var t,n=this.$(".tcm-comment-text-content").html().trim(),i=e.currentTarget.getAttribute("data-url"),o=this.$(".tcm-comment-author-name strong").text().replace(/\s\s+/g," ");for(n=n.replace(/<(?:.|\n)*?>/gm,"");o.length>20;)o=o.split(" ").slice(0,-1).join(" ");return(n=n.replace(/<br\s*[\/]?>/gi," ")).length>90&&(n=(n=n.substring(0,90)).split(" ").slice(0,-1).join(" ")),n=n+"... -"+o+" "+i,t=this.$("a.tcm-share-twitter").attr("href")+"?text="+encodeURIComponent(n),window.open(t,"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=350,width=500"),!1},shareFacebook:function(e){var t,n=ThriveComments.post?ThriveComments.post.post_title:"",i=this.$(".tcm-comment-author-img").css("background-image").replace("url(","").replace(")","").replace(/\"/gi,""),o=this.$(".tcm-comment-text-content").html().trim(),s=encodeURIComponent(e.currentTarget.getAttribute("data-url"));return o=(o=o.replace(/<(?:.|\n)*?>/gm,"")).replace(/<br\s*[\/]?>/gi,""),t=this.$("a.tcm-share-facebook").attr("href")+"?u="+s+"&title="+n+"&description="+o+"&picture="+encodeURIComponent(i),window.open(t,"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=350,width=500"),!1},vote:function(e){var t=this,n=this.model.id,i=e.currentTarget.dataset.type,o=this.$(".tcm-comment-content:first .tcm-voting-input"),s=o.filter(".tcm-upvote").find(".tcm-votes-count").text(),r=o.filter(".tcm-downvote").find(".tcm-votes-count").text(),m=o.filter(".tcm-upvote").attr("class"),a=o.filter(".tcm-downvote").attr("class"),c=function(){o.filter(".tcm-upvote").attr("class",m).find(".tcm-votes-count").text(s),o.filter(".tcm-downvote").attr("class",a).find(".tcm-votes-count").text(r)};if(this.doingVote)return!1;function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";jQuery.ajax({headers:{"X-WP-Nonce":ThriveComments.nonce},url:t.voteRoute,type:"POST",data:{comment_id:n,vote_type:i,secret_spam:ThriveComments.secret_spam,g_recaptcha_response:e}}).done((function(e){t.doingVote=!1})).fail((function(e){ThriveComments.util.err(e.responseJSON.message),c()})).always((function(){}))}return this.doingVote=!0,e.currentTarget.classList.contains("active")?(e.currentTarget.classList.remove("active"),e.currentTarget.classList.contains("tcm-upvote")?o.filter(".tcm-upvote").find(".tcm-votes-count").text(parseInt(s)-1):o.filter(".tcm-downvote").find(".tcm-votes-count").text(parseInt(r)-1)):(e.currentTarget.classList.contains("tcm-upvote")?(o.filter(".tcm-upvote").find(".tcm-votes-count").text(parseInt(s)+1),o.filter(".tcm-downvote").hasClass("active")&&o.filter(".tcm-downvote").find(".tcm-votes-count").text(parseInt(r)-1)):(o.filter(".tcm-downvote").find(".tcm-votes-count").text(parseInt(r)+1),o.filter(".tcm-upvote").hasClass("active")&&o.filter(".tcm-upvote").find(".tcm-votes-count").text(parseInt(s)-1)),o.removeClass("active"),e.currentTarget.classList.add("active")),ThriveComments.recaptcha_enabled&&void 0!==window.grecaptcha?grecaptcha.ready((function(){grecaptcha.execute(ThriveComments.recaptcha.site_key,{action:"submit"}).then((function(e){l(e)}))})):l(),!1},deletedState:function(){this.childView=new ThriveComments.views.DeletedItem({el:this.$(".deleted-state").first(),model:this.model,commentView:this,moderationView:this.moderationView}),this.childView.render(),e(window).trigger("scroll")}}),ThriveComments.views.LazyLoad=Backbone.View.extend({template:ThriveComments.util.tpl("comments/lazy-loading"),events:{"click .tcm-loader":"changePage","click .add-comment":"addCommentBottom","click .tcm-link-subscribe":"showSubscribeForm","click .tcm-link-unsubscribe":"unSubscribe","click .submit-subscribe-post":"subscribePost","click .submit-unsubscribe-post":"unSubscribePost"},currentPage:1,itemsPerPage:parseInt(ThriveComments.settings.comments_per_page),collection:null,params:null,type:"",view:null,order:"",sortBy:"",initialize:function(e){this.collection=e.collection,this.view=e.view,this.type=e.type,this.order=1===ThriveComments.sorting.order?"ASC":"DESC"},changePage:function(t,n){e(".tcm-lazy-comments .tcm-dot-loader").removeClass("done"),this.$(".add-comment").hide();var i=this,o={itemsPerPage:this.itemsPerPage};if(n&&void 0!==n.page?o.page=parseInt(n.page):o.page=this.currentPage,o.page<1&&(o.page=1),n&&void 0!==n.resetContent&&this.view.$el.empty(),n&&n.id&&(o.go_to_id=n.id),"dynamic"==this.type)n&&void 0!==n.sortBy?o.sortBy=n.sortBy:o.sortBy=this.sortBy,n&&void 0!==n.order?o.order=n.order:o.order=this.order,ThriveComments.tva_term&&void 0!==ThriveComments.tva_term&&(o.tva_term=ThriveComments.tva_term),this.collection.fetch({reset:!0,data:e.param(o),success:function(e,t){i.$el.show(),null!=t.nextPage?i.updateParams(t.nextPage,o.sortBy,o.order):i.updateParams(o.page+1,o.sortBy,o.order),i.view.render(e),i.render(),ThriveComments.util.scrollToElement(i.view.$("div[data-comment-id="+o.go_to_id+"]"))}});else if("static"===this.type&&void 0!==this.view&&null!==this.view){var s,r=(o.page-1)*this.itemsPerPage,m=o.page,a=0,c=this.collection.sort();if(ThriveComments.settings.page_comments){if(n&&n.id){do{s=c.chain().rest(r).first(this.itemsPerPage).value(),a=ThriveComments.util.search_recursive(s,n.id),this.view.render(s),r=((m+=1)-1)*this.itemsPerPage,this.updateParams(m,"","")}while(!a&&0!==s.length);ThriveComments.util.scrollToElement(this.view.$("div[data-comment-id="+n.id+"]")),a?ThriveComments.util.scrollToElement(this.view.$("div[data-comment-id="+n.id+"]")):(r=(o.page-1)*this.itemsPerPage,this.view.$el.empty(),this.updateParams(o.page+1,"",""),s=c.chain().rest(r).first(this.itemsPerPage).value(),this.view.render(s))}else{this.updateParams(o.page+1,"","");var l=c.countFeaturedComments(),h=this.itemsPerPage;l>0&&(o.page>1?r+=l:h=l+h),s=c.chain().rest(r).first(h).value(),this.view.render(s)}if(0===s.length)return ThriveComments.util.showCommentsNumber(0),ThriveComments.util.tcm_hide_loader(),void this.$(".tcm-loader").hide()}else this.view.render(c),ThriveComments.util.scrollToElement(this.view.$("div[data-comment-id="+n.id+"]"));i.render()}return!1},updateParams:function(e,t,n){this.currentPage=e,this.sortBy=t,this.order=n},render:function(){this.$el.html(this.template({commentsLength:this.collection.commentCount,comments_rendered:this.view.comments_rendered,showPoweredBy:ThriveComments.settings.powered_by,pageComments:ThriveComments.settings.page_comments,type:this.type})),e(".level-0").length>=parseInt(this.collection.userCommentCount)?this.$(".tcm-loader").hide():this.$(".tcm-loader").show(),ThriveComments.util.focusAfterLogin(),jQuery(window).trigger("scroll");var t=decodeURIComponent(ThriveComments.util.get_cookie("tcm_cookie_user_email"));return""!==ThriveComments.util.get_cookie("subscribed_posts")&&t&&-1!==JSON.parse(ThriveComments.util.get_cookie("subscribed_posts")).indexOf(ThriveComments.post.ID)&&void 0!==ThriveComments.current_user.ID?(this.$(".tcm-link-subscribe").hide(),this.$(".tcm-link-unsubscribe").show(),!1):this},addCommentBottom:function(t){ThriveComments.util.tcm_hide_textareas(t);var n=new ThriveComments.views.CreateComment({viewList:this.viewList}),i=this.$(".tcm-powered-by"),o=n.render({mainInput:1,id:0,level:0,photo_src:ThriveComments.current_user.photo_url,previousUser:ThriveComments.util.previousUser(),position:"bottom",close_comments:ThriveComments.close_comments}).$el;e(t.currentTarget).hide(),i.length?i.before(o):this.$el.append(o)},showSubscribeForm:function(){return ThriveComments.current_user.ID?this.addPostSubscriber(ThriveComments.current_user.user_email,1):(this.$(".tcm-link-subscribe").hide(),this.$("#tcm-subscribe-form").show()),!1},unSubscribe:function(e){var t=ThriveComments.current_user.user_email;this.$(".tcm-link-unsubscribe").hide(),this.$("#tcm-unsubscribe-form").hide(),this.$(".tcm-link-subscribe").show(),e.stopPropagation(),void 0===ThriveComments.current_user.user_email&&(t=decodeURIComponent(ThriveComments.util.get_cookie("tcm_cookie_user_email"))),this.addPostSubscriber(t,0)},subscribePost:function(){var e=this.$(".tcm-subscriber-email");if(ThriveComments.util.validateEmail(e,ThriveComments.util.render_label("isRequired"))){if(""!==ThriveComments.util.get_cookie("subscribed_posts")&&-1!==JSON.parse(ThriveComments.util.get_cookie("subscribed_posts")).indexOf(ThriveComments.post.ID)&&ThriveComments.util.validateEmail(e,ThriveComments.util.render_label("isRequired")))return this.$("#tcm-subscribe-form").hide(),this.$(".tcm-already-subscribed").show(),!1;this.addPostSubscriber(e.val(),1)}},unSubscribePost:function(){var e=this.$(".tcm-unsubscriber-email");return""!==ThriveComments.util.get_cookie("subscribed_posts")&&-1!==JSON.parse(ThriveComments.util.get_cookie("subscribed_posts")).indexOf(ThriveComments.post.ID)&&ThriveComments.util.validateEmail(e,ThriveComments.util.render_label("isRequired"))&&this.addPostSubscriber(e.val(),0),!1},addPostSubscriber:function(t,n){var i=this.$(".tcm-link-subscribe"),o=ThriveComments.util.render_label("subscribe"),s=this.$("#tcm-subscribe-form"),r=this.$(".tcm-link-unsubscribe"),m=this.$("#tcm-unsubscribe-form"),a={email:t,post_id:ThriveComments.post.ID,subscribe:n};ThriveComments.tva_term&&void 0!==ThriveComments.tva_term&&(a.tva_term=ThriveComments.tva_term),i.text(ThriveComments.util.render_label("comment_pending")),s.hide(),ThriveComments.current_user.ID?i.show():i.hide(),e.ajax({headers:{"X-WP-Nonce":ThriveComments.nonce},type:"POST",url:ThriveComments.routes.update_post_subscriber,data:a}).done((function(){ThriveComments.util.set_subscriber_cookies(n),0===n?(i.text(o),ThriveComments.current_user.ID?i.show():(i.hide(),m.hide(),s.show())):1===n&&ThriveComments.current_user.ID?(i.hide(),r.show()):(s.hide(),i.hide(),m.show())})).fail((function(e){m.show(),i.text(o),ThriveComments.util.err(e.responseJSON.message)}))}}),ThriveComments.views.CommentConversion=Backbone.View.extend({className:"tcm-conversion-container",template:ThriveComments.util.tpl("comments-conversion"),events:{"click .fb-button":"conv_facebook","click .x-button":"conv_twitter","click .in-button":"conv_linkedin","click .pt-button":"conv_pinterest","click .gm-button":"conv_google","click .xi-button":"conv_xing"},commentView:null,initialize:function(e){this.commentView=e.commentView,this.conversionSettings=this.commentView.model.get("conversion_settings")},render:function(e){return this.$el.html(this.template(e)),this},handleAfterShowAction:function(e){var t=this.commentView.model.get("show_after_save"),n=this.commentView.model.get("commenter_first");if(!t)return!1;if("live_update"===t)return this.handleLiveUpdate(t,n,"tcm_live_update"),!0;switch(this.conversionSettings[t].active){case"tcm_redirect":this.redirectURL(t);break;case"tcm_live_update":this.handleLiveUpdate(t,n,"tcm_live_update");break;case"tcm_related_posts":this.handleRelatedPosts(t,"tcm_related_posts");break;case"tcm_thrivebox":this.handleThrivebox(t);break;case"tcm_social_share":this.handleSocialShare(t,"tcm_social_share")}},handleSocialShare:function(e,t){var n,i="live_update"===e?this.conversionSettings.tcm_live_update[e]:this.conversionSettings.tcm_social_share[e];n=i.custom_message.replace("{commenter_name}",this.commentView.model.get("comment_author")),this.render({html_switch:t,custom_message:n,share_btns:i.social_sharing_buttons})},handleRelatedPosts:function(e,t){var n,i,o="live_update"===e?this.conversionSettings.tcm_live_update[e]:this.conversionSettings.tcm_related_posts[e];""!==o.custom_message&&(n=o.custom_message.replace("{commenter_name}",this.commentView.model.get("comment_author")),i=o.show_featured_image,this.render({html_switch:t,custom_message:n,show_featured_image:i}))},redirectURL:function(e){""==ThriveComments.settings.tcm_conversion.tcm_redirect[e].redirect_url||ThriveComments.settings.tcm_conversion.tcm_redirect[e].flag||window.location.replace(ThriveComments.settings.tcm_conversion.tcm_redirect[e].redirect_url)},handleLiveUpdate:function(e,t,n){var i,o=1===parseInt(t)?"first_time":"second_time",s="live_update"===e?this.conversionSettings.tcm_live_update[o]:this.conversionSettings.tcm_live_update[e];""!==s.custom_message&&(i=s.custom_message.replace("{commenter_name}",this.commentView.model.get("comment_author")),this.render({html_switch:n,custom_message:i}))},handleThrivebox:function(t){var n,i=this.conversionSettings.tcm_thrivebox[t].thrivebox_id,o=this;if(!i||"undefined"==typeof TL_Const||"0"===i)return n="first_time"===t?1:2,this.handleLiveUpdate(t,n,"tcm_live_update"),!1;var s={tcb_js:"undefined"!=typeof TCB_Front?1:0,two_step_ids:[i.toString()],action:"tve_leads_ajax_load_forms",security:TL_Const.security,display_options:TL_Const.display_options,current_screen:TL_Const.current_screen,tve_flat_included:e("#tve_style_family_tve_flt-css").length};ThriveGlobal.$j.each(TL_Const.custom_post_data,(function(e,t){s[e]=t})),window.TVE_Dash&&!TVE_Dash.ajax_sent?ThriveGlobal.$j(document).on("tve-dash.load",(function(e){TVE_Dash.add_load_item("tl_lazy_load",s,TL_Front.ajax_load_callback)})):ThriveGlobal.$j.ajax({url:TL_Const.ajax_url,type:"post",dataType:"json",data:s,xhrFields:{withCredentials:!0}}).done((function(e){TL_Front.ajax_load_callback(e);var t=jQuery(".tl-2step-trigger-"+i);if(t.length){var n,s=jQuery('[data-tl-type="two_step_'+i+'"]');s.length&&((n=jQuery(s[0])).find('input[name="email"]').val(o.commentView.model.get("comment_author_email")),n.find('input[name="name"]').val(o.commentView.model.get("comment_author"))),setTimeout((function(){t.click()}),0)}}))},conv_facebook:function(e){var t,n=ThriveComments.post?ThriveComments.post.post_title:"",i=ThriveComments.post.featured_image?ThriveComments.post.featured_image:"",o=encodeURIComponent(ThriveComments.post.permalink);return t=e.currentTarget.getAttribute("data-href")+"?u="+o+"&title="+n+"&image_url="+encodeURIComponent(i),window.open(t,"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=350,width=500"),!1},conv_twitter:function(e){var t,n=ThriveComments.post?ThriveComments.post.post_title:"";return n.length>90&&(n=(n=n.substring(0,90)).split(" ").slice(0,-1).join(" ")),n=n+" "+ThriveComments.post.permalink,t=e.currentTarget.getAttribute("data-href")+"?text="+n,window.open(t,"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=483,width=672"),!1},conv_linkedin:function(e){var t,n=ThriveComments.post?ThriveComments.post.post_title:"";return t=e.currentTarget.getAttribute("data-href")+"?url="+encodeURIComponent(ThriveComments.post.permalink)+"&summary="+n+"&title="+n,window.open(t,"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=483,width=672"),!1},conv_pinterest:function(e){var t,n=ThriveComments.post?ThriveComments.post.post_title:"",i=ThriveComments.post.featured_image?ThriveComments.post.featured_image:"";return t=e.currentTarget.getAttribute("data-href")+"?url="+encodeURIComponent(ThriveComments.post.permalink)+"&description="+n+"&media="+i,window.open(t,"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=483,width=672"),!1},conv_google:function(e){var t,n=ThriveComments.post?ThriveComments.post.post_title:"";return t=e.currentTarget.getAttribute("data-href")+"?url="+encodeURIComponent(ThriveComments.post.permalink)+"&text="+n,window.open(t,"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=483,width=672"),!1},conv_xing:function(e){var t,n=ThriveComments.post?ThriveComments.post.post_title:"";return t=e.currentTarget.getAttribute("data-href")+"?url="+encodeURIComponent(ThriveComments.post.permalink)+"&title="+n,window.open(t,"","menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=483,width=672"),!1}}),ThriveComments.views.LiveUpdate=Backbone.View.extend({template:"",events:"",initialize:function(e){this.commentsView=e.commentsView,this.viewCreate=e.viewCreate,this.collection=e.collection,this.updateInterval=1e3*parseInt(ThriveComments.settings.tcm_live_update_refresh_rate),this.updateComments()},updateComments:function(){var e=this;!ThriveComments.settings.tcm_live_update||tve_frontend_options&&tve_frontend_options.is_editor_page||setTimeout((function(){e.startTimeout(jQuery(".tcm-comments-list")),e.updateComments()}),this.updateInterval)},startTimeout:function(t){var n=this;e.ajax({headers:{"X-WP-Nonce":ThriveComments.nonce},cache:!1,url:ThriveComments.routes.live_update,dataType:"JSON",type:"GET",data:{post_id:ThriveComments.post.ID,update_interval:this.updateInterval}}).done((function(e){e.comment_found?(_.each(e.comments,(function(e){var i=null,o=null,s=null;t&&(o=t.find("button[data-id="+e.top_parent_id+"]"),i=t.find("button[data-id="+e.comment_parent+"]"),s=new ThriveComments.models.Comment(e,{parse:!0}),0==e.comment_parent||i.length&&o.length?n.viewCreate.addNewCommentToList(i,s,1):ThriveComments.util.search_comment(n.collection,e.comment_ID)||ThriveComments.objects.Comments.push(s))})),n.updateInterval=1e3*parseInt(ThriveComments.settings.tcm_live_update_refresh_rate)):n.updateInterval=n.updateInterval+100}))}}),window.ThriveComments=window.ThriveComments||{},ThriveComments.objects=ThriveComments.objects||{},Backbone.emulateHTTP=!0,function(e){ThriveComments.objects.TCRouter=Backbone.Router.extend({view:null,routes:{"":"comments",comments:"comments","comments/:id":"comments","comments-:id":"comments","*n":"comments"},params:{},initialize:function(t){e.extend(!0,this,t),window.TVE_Dash&&!TVE_Dash.ajax_sent&&TVE_Dash.add_load_item("tcm_dash_data",ThriveComments.const.ajax_dash,this.dashResponse),this.facebook_init()},dashResponse:function(e){ThriveComments.secret_spam=e.secret,ThriveComments.has_plugin_cache&&(ThriveComments.nonce=e.nonce,Backbone.history.start({hashchange:!0}),Backbone.history.fragment||ThriveComments.router.navigate("",{trigger:!0}))},route:function(e,t,n){var i=this;return n||(n=this[t]),Backbone.Router.prototype.route.call(this,e,t,(function(){n.apply(i,arguments)}))},comments:function(t){var n,i,o;t=e.isNumeric(t)?t:null,ThriveComments.objects.Comments||(ThriveComments.objects.Comments=new ThriveComments.collections.Comments),i=this.get_me_a_view("LazyLoad",{collection:ThriveComments.objects.Comments,el:this.$el.find(".tcm-lazy-comments"),type:ThriveComments.settings.is_dynamic?"dynamic":"static"}),o=this.get_me_a_view("Comments",{collection:ThriveComments.objects.Comments,el:this.$el.find(".tcm-comments-list"),viewLazy:i}),i.viewList=o,this.get_me_a_view("SortComments",{el:this.$el.find(".tcm-comments-filter"),viewList:o}),o.close(),o.startLazy(t),(n=this.get_me_a_view("CreateComment",{el:this.$el.find(".tcm-comments-create"),viewList:o})).render({mainInput:1,id:0,level:0,photo_src:ThriveComments.current_user.photo_url,previousUser:ThriveComments.util.previousUser(),position:"top",close_comments:ThriveComments.close_comments}),this.get_me_a_view("LiveUpdate",{commentsView:o,id:t,viewCreate:n,collection:ThriveComments.objects.Comments})},get_me_a_view:function(e,t){var n="view"+e;return this[n]||(this[n]=new ThriveComments.views[e](t)),this[n]},facebook_init:function(){var e,t,n,i,o;"undefined"==typeof FB&&1===ThriveComments.settings.tcm_api_status.facebook&&1===ThriveComments.settings.tcm_api_status.facebook_api&&ThriveComments.settings.tcm_enable_social_signin&&(window.fbAsyncInit=function(){FB.init({appId:ThriveComments.tcm_social_apis.facebook.app_id,autoLogAppEvents:!0,status:!0,xfbml:!0,version:"v2.9"})},t="script",n="facebook-jssdk",o=(e=document).getElementsByTagName(t)[0],e.getElementById(n)||((i=e.createElement(t)).id=n,i.src="//connect.facebook.net/en_US/sdk.js",o.parentNode.insertBefore(i,o)))}}),e((function(){0!==e("#thrive-comments").length&&(ThriveComments.router=new ThriveComments.objects.TCRouter({$el:e("#thrive-comments")}),ThriveComments.has_plugin_cache||(Backbone.history.start({hashchange:!0}),Backbone.history.fragment||ThriveComments.router.navigate("",{trigger:!0})))}))}(jQuery)})();