Commit inicial - WordPress Análisis de Precios Unitarios

- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-03 21:04:30 -06:00
commit a22573bf0b
24068 changed files with 4993111 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
const TCBSeoPlugin = require( './tcb-seo-plugin' );
module.exports = class TCBRankMathPlugin extends TCBSeoPlugin {
/**
* Init the custom fields
*/
init() {
this.content = '';
this.hooks();
this.fetchContent();
}
/**
* Hook into Rank Math App eco-system
*/
hooks() {
if ( window.wp && wp.hooks ) {
wp.hooks.addFilter( 'rank_math_content', 'rank-math', content => {
return this.content ? this.content : content;
}, 11 );
}
}
/**
* Fetch Post Content from TCB
*
* @param fetchedContent
*/
sendContent( fetchedContent ) {
if ( ! this.isEditedWithTar ) {
this.content = fetchedContent;
}
if ( typeof window.rankMathEditor !== 'undefined' ) {
rankMathEditor.refresh( 'content' );
}
}
afterFetch( response ) {
this.sendContent( response );
}
};

View File

@@ -0,0 +1,30 @@
( $ => {
module.exports = class TCBSeoPlugin {
/**
* Fetch Post Content from TCB
*/
fetchContent() {
$.ajax( {
url: ajaxurl,
type: 'post',
dataType: 'json',
data: {
post_id: TCB_Post_Edit_Data.post_id,
action: 'tve_get_seo_content'
}
} ).done( response => {
const $content = $( `<div>${response.content}</div>` );
/* Remove TTB headers and footers from SEO analysis */
$content.find( 'header#thrive-header, footer#thrive-footer, aside#theme-sidebar-section' ).remove();
this.isEditedWithTar = response.is_edited_with_tar;
this.afterFetch( $content[ 0 ].outerHTML );
} );
}
afterFetch() {
throw Error( 'Class should implement the afterFetch function' );
}
}
} )( jQuery );

View File

@@ -0,0 +1,44 @@
( $ => {
const TCBSeoPlugin = require( './tcb-seo-plugin' );
module.exports = class TCBYoastPlugin extends TCBSeoPlugin {
init() {
YoastSEO.app.registerPlugin( 'tcbYoastPlugin', {status: 'loading'} );
this.fetchContent();
}
sendContent( fetchedContent ) {
YoastSEO.app.pluginReady( 'tcbYoastPlugin' );
/**
* @param modification {string} The name of the filter
* @param callable {function} The callable
* @param pluginName {string} The plugin that is registering the modification.
* @param priority {number} (optional) Used to specify the order in which the callables
* associated with a particular filter are called. Lower numbers
* correspond with earlier execution.
*/
YoastSEO.app.registerModification( 'content', content => this.parseTCBContent( content, fetchedContent ), 'tcbYoastPlugin', 5 );
}
parseTCBContent( content, architectContent ) {
/* Remove empty tags because yoast kind fails on parse here */
if ( architectContent ) {
const contentSelector = '.tcb-style-wrap',
$content = $( `<div>${architectContent}</div>` ).find( contentSelector );
$content.find( '*:empty:not(img,input,br)' ).remove();
architectContent = $content.html();
}
return architectContent ? architectContent : content;
}
afterFetch( response ) {
this.sendContent( response );
}
}
} )( jQuery );

View File

@@ -0,0 +1,84 @@
( $ => {
const TCBYoastPlugin = require( './classes/tcb-yoast-plugin' ),
TCBRankMathPlugin = require( './classes/tcb-rankmath-plugin' ),
RankMathInstance = new TCBRankMathPlugin(),
YoastInstance = new TCBYoastPlugin();
window.TCBYoastPlugin = TCBYoastPlugin;
/**
* YoastSEO content analysis integration
*/
$( window ).on( 'YoastSEO:ready', () => {
YoastInstance.init();
} );
/**
* RankMath content analysis integration
*/
$( document ).ready( function () {
if ( typeof window.rankMath !== 'undefined' ) {
RankMathInstance.init();
}
} );
/**
*/
function show_loader() {
$( '#tcb-admin-page-loader' ).show();
}
$( function () {
const $document = $( document );
$document.on( 'click.tcb', '#tcb2-migrate-post', ( index, element ) => {
show_loader();
$.ajax( {
type: 'post',
url: ajaxurl,
dataType: 'json',
data: {
_nonce: TCB_Post_Edit_Data.admin_nonce,
post_id: TCB_Post_Edit_Data.post_id,
action: 'tcb_admin_ajax_controller',
route: 'migrate_post_content'
}
} ).done( function () {
location.href = element.getAttribute( 'data-edit' );
} ).fail( function ( jqXHR ) {
alert( 'ERROR: ' + jqXHR.responseText );
} );
} )
.on( 'click', '#tcb2-show-wp-editor', function () {
/**
* Enable the hidden input that will disable TCB editor when saving the post
*/
const $editlink = $document.find( '.tcb-enable-editor' ),
$postbox = $editlink.closest( '.postbox' );
$postbox.next( '.tcb-flags' ).find( 'input' ).prop( 'disabled', false );
$postbox.before( $editlink );
$postbox.remove();
$( 'body' ).removeClass( 'tcb-hide-wp-editor' );
} )
.on( 'click', '.tcb-enable-editor', function () {
$( 'body' ).addClass( 'tcb-hide-wp-editor' );
$.ajax( {
type: 'post',
url: ajaxurl,
dataType: 'json',
data: {
_nonce: TCB_Post_Edit_Data.admin_nonce,
post_id: this.getAttribute( 'data-id' ),
action: 'tcb_admin_ajax_controller',
route: 'enable_tcb'
}
} ).done( function () {
$( window ).off( 'beforeunload.edit-post' );
$( 'input#save-post' ).trigger( 'click' );
} );
} );
} );
} )( jQuery );

View File

@@ -0,0 +1,204 @@
( function ( $ ) {
const EDITOR_SELECTORS = '.editor-block-list__layout,.block-editor-block-list__layout';
const ThriveGutenbergSwitch = {
/**
* Check if we're using the block editor
*
* @return {boolean}
*/
isGutenbergActive() {
return typeof wp !== 'undefined' && typeof wp.blocks !== 'undefined';
},
init() {
this.coreEditor = wp.data.select( 'core/editor' );
this.$gutenberg = $( '#editor' );
this.$architectNotificationContent = $( '#thrive-gutenberg-switch' ).html();
this.$architectDisplay = $( '<div id="tar-display">' ).append( this.$architectNotificationContent );
this.$architectLauncher = this.$architectDisplay.find( '#thrive_preview_button' );
this.isPostBox = this.$architectNotificationContent.indexOf( 'postbox' ) !== - 1;
$( window ).on( 'storage.tcb', event => {
if ( this.coreEditor ) {
const currentPost = this.coreEditor.getCurrentPost();
let post;
try {
post = JSON.parse( event.originalEvent.newValue );
} catch ( e ) {
}
if ( post && post.ID && event.originalEvent.key === 'tve_post_options_change' && post.ID === Number( currentPost.id ) ) {
window.location.reload();
}
}
} );
wp.data.subscribe( () => {
if ( this.coreEditor ) {
const isSavingPost = this.coreEditor.isSavingPost(),
isAutosavingPost = this.coreEditor.isAutosavingPost();
if ( isSavingPost && ! isAutosavingPost ) {
const data = JSON.stringify( this.coreEditor.getCurrentPost() );
window.localStorage.setItem( 'tve_post_options_change', data );
}
}
/**
* On data subscribe check if our elements exists
*/
setTimeout( () => {
this.render();
}, 1 );
} );
},
render() {
const $postTitle = this.$gutenberg.find( '.editor-post-title' ),
$wpContent = this.$gutenberg.find( EDITOR_SELECTORS ).not( $postTitle.closest( EDITOR_SELECTORS ) );
let shouldBindEvents = false;
if ( this.isPostBox ) {
if ( ! $( '#tar-display' ).length ) {
if ( $postTitle.length ) {
if ( $postTitle[ 0 ].tagName === 'DIV' ) {
$postTitle.append( this.$architectDisplay );
} else {
$postTitle.after( this.$architectDisplay );
}
}
$wpContent.hide();
this.$gutenberg.find( '.editor-post-title__block' ).css( 'margin-bottom', '0' );
this.$gutenberg.find( '.editor-writing-flow__click-redirect,.block-editor-writing-flow__click-redirect' ).hide();
this.$gutenberg.find( '.edit-post-header-toolbar' ).css( 'visibility', 'hidden' );
shouldBindEvents = true;
}
} else if ( ! $( '#thrive_preview_button' ).length ) {
this.$gutenberg.find( '.edit-post-header-toolbar' ).append( this.$architectLauncher );
this.$architectLauncher.on( 'click', function () {
$wpContent.hide();
} );
this.$gutenberg.find( '.edit-post-header-toolbar' ).css( 'visibility', 'visible' );
shouldBindEvents = true;
}
/* So we can use saved styles */
$( '.editor-block-list__layout,.block-editor-block-list__layout' ).addClass( 'tcb-style-wrap' );
if ( shouldBindEvents ) {
this.bindEvents();
}
},
bindEvents() {
const self = this;
$( '#tcb2-show-wp-editor' ).on( 'click', function () {
const $editlink = self.$gutenberg.find( '.tcb-enable-editor' ),
$postbox = $editlink.closest( '.postbox' );
$.ajax( {
type: 'post',
url: ajaxurl,
dataType: 'json',
data: {
_nonce: TCB_Post_Edit_Data.admin_nonce,
post_id: this.getAttribute( 'data-id' ),
action: 'tcb_admin_ajax_controller',
route: 'disable_tcb'
}
} );
$postbox.next( '.tcb-flags' ).find( 'input' ).prop( 'disabled', false );
$postbox.remove();
self.$gutenberg.find( '.editor-block-list__layout,.block-editor-block-list__layout' ).show();
self.isPostBox = false;
self.render();
self.fixBlocksPreview();
} );
this.$architectLauncher.on( 'click', function () {
$.ajax( {
type: 'post',
url: ajaxurl,
dataType: 'json',
data: {
_nonce: TCB_Post_Edit_Data.admin_nonce,
post_id: this.getAttribute( 'data-id' ),
action: 'tcb_admin_ajax_controller',
route: 'change_post_status_gutenberg'
}
} )
} );
},
/**
* Fix block height once returning to gutenberg editor
*/
fixBlocksPreview() {
const blocks = document.querySelectorAll( '[data-type*="thrive"] iframe' ),
tveOuterHeight = function ( el ) {
if ( ! el ) {
return 0;
}
let height = el.offsetHeight;
const style = getComputedStyle( el );
height += parseInt( style.marginTop ) + parseInt( style.marginBottom );
return height;
};
Array.prototype.forEach.call( blocks, function ( iframe ) {
const iframeDocument = iframe.contentDocument;
iframe.style.setProperty(
'height',
''
);
iframe.parentNode.style.setProperty(
'height',
''
);
/**
* Fix countdown resizing
*/
Array.prototype.forEach.call( iframeDocument.body.querySelectorAll( '.tve-countdown' ), function ( countdown ) {
countdown.style.setProperty(
'--tve-countdown-size',
''
);
} );
const height = tveOuterHeight(
iframeDocument.body
);
iframe.style.setProperty(
'height',
height + 'px'
);
iframe.parentNode.style.setProperty(
'height',
height + 'px'
);
} );
}
};
$( function () {
if ( ThriveGutenbergSwitch.isGutenbergActive() ) {
ThriveGutenbergSwitch.init();
}
window.addEventListener( 'load', function () {
$( '.tcb-revert' ).on( 'click', function () {
if ( confirm( 'Are you sure you want to DELETE all of the content that was created in this landing page and revert to the theme page? \n If you click OK, any custom content you added to the landing page will be deleted.' ) ) {
location.href = location.href + '&tve_revert_theme=1&nonce=' + this.dataset.nonce;
$( '#editor' ).find( '.edit-post-header-toolbar' ).css( 'visibility', 'visible' );
}
} );
} );
} );
}( jQuery ) );

View File

@@ -0,0 +1,62 @@
/**
* Common jquery plugins - used both in inner frame and main frame
*/
module.exports = {
tcbShow( display = 'block' ) {
return this.each( function () {
this.style.display = display;
} );
},
tcbHide() {
return this.each( function () {
this.style.display = 'none';
} );
},
tcbRemoveClass( cls ) {
cls = cls.split( ' ' );
return this.each( function () {
this.classList.remove.apply( this.classList, cls );
} );
},
tcbAddClass( cls ) {
cls = cls.split( ' ' );
return this.each( function () {
this.classList.add.apply( this.classList, cls );
} );
},
/**
*
* @param cls
* @param {Boolean} atLeasOne check that at least one class exists if multiple classes are provided
* @return {*|boolean}
*/
tcbHasClass( cls, atLeasOne = false ) {
if ( ! this.length ) {
return false;
}
cls = cls.split( ' ' );
if ( atLeasOne ) {
return cls.some( item => this[ 0 ].classList.contains( item ) );
}
/* check if element has every class from the provided list */
return cls.every( item => this[ 0 ].classList.contains( item ) );
},
tcbToggleClass( cls, state ) {
let fn = false;
if ( typeof state !== 'undefined' ) {
fn = state ? 'add' : 'remove';
}
return this.each( function () {
if ( ! fn ) {
const localFn = this.classList.contains( cls ) ? 'remove' : 'add';
this.classList[ localFn ]( cls );
} else {
this.classList[ fn ]( cls );
}
} );
},
};

View File

@@ -0,0 +1 @@
(()=>{var t={22507:(t,e,o)=>{const n=o(79152);t.exports=class extends n{init(){this.content="",this.hooks(),this.fetchContent()}hooks(){window.wp&&wp.hooks&&wp.hooks.addFilter("rank_math_content","rank-math",(t=>this.content?this.content:t),11)}sendContent(t){this.isEditedWithTar||(this.content=t),void 0!==window.rankMathEditor&&rankMathEditor.refresh("content")}afterFetch(t){this.sendContent(t)}}},42071:(t,e,o)=>{(e=>{const n=o(79152);t.exports=class extends n{init(){YoastSEO.app.registerPlugin("tcbYoastPlugin",{status:"loading"}),this.fetchContent()}sendContent(t){YoastSEO.app.pluginReady("tcbYoastPlugin"),YoastSEO.app.registerModification("content",(e=>this.parseTCBContent(e,t)),"tcbYoastPlugin",5)}parseTCBContent(t,o){if(o){const t=".tcb-style-wrap",n=e(`<div>${o}</div>`).find(t);n.find("*:empty:not(img,input,br)").remove(),o=n.html()}return o||t}afterFetch(t){this.sendContent(t)}}})(jQuery)},79152:t=>{var e;e=jQuery,t.exports=class{fetchContent(){e.ajax({url:ajaxurl,type:"post",dataType:"json",data:{post_id:TCB_Post_Edit_Data.post_id,action:"tve_get_seo_content"}}).done((t=>{const o=e(`<div>${t.content}</div>`);o.find("header#thrive-header, footer#thrive-footer, aside#theme-sidebar-section").remove(),this.isEditedWithTar=t.is_edited_with_tar,this.afterFetch(o[0].outerHTML)}))}afterFetch(){throw Error("Class should implement the afterFetch function")}}}},e={};function o(n){var i=e[n];if(void 0!==i)return i.exports;var a=e[n]={exports:{}};return t[n](a,a.exports,o),a.exports}(t=>{const e=o(42071),n=new(o(22507)),i=new e;window.TCBYoastPlugin=e,t(window).on("YoastSEO:ready",(()=>{i.init()})),t(document).ready((function(){void 0!==window.rankMath&&n.init()})),t((function(){const e=t(document);e.on("click.tcb","#tcb2-migrate-post",((e,o)=>{t("#tcb-admin-page-loader").show(),t.ajax({type:"post",url:ajaxurl,dataType:"json",data:{_nonce:TCB_Post_Edit_Data.admin_nonce,post_id:TCB_Post_Edit_Data.post_id,action:"tcb_admin_ajax_controller",route:"migrate_post_content"}}).done((function(){location.href=o.getAttribute("data-edit")})).fail((function(t){alert("ERROR: "+t.responseText)}))})).on("click","#tcb2-show-wp-editor",(function(){const o=e.find(".tcb-enable-editor"),n=o.closest(".postbox");n.next(".tcb-flags").find("input").prop("disabled",!1),n.before(o),n.remove(),t("body").removeClass("tcb-hide-wp-editor")})).on("click",".tcb-enable-editor",(function(){t("body").addClass("tcb-hide-wp-editor"),t.ajax({type:"post",url:ajaxurl,dataType:"json",data:{_nonce:TCB_Post_Edit_Data.admin_nonce,post_id:this.getAttribute("data-id"),action:"tcb_admin_ajax_controller",route:"enable_tcb"}}).done((function(){t(window).off("beforeunload.edit-post"),t("input#save-post").trigger("click")}))}))}))})(jQuery)})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
!function(t){const e=".editor-block-list__layout,.block-editor-block-list__layout",i={isGutenbergActive:()=>"undefined"!=typeof wp&&void 0!==wp.blocks,init(){this.coreEditor=wp.data.select("core/editor"),this.$gutenberg=t("#editor"),this.$architectNotificationContent=t("#thrive-gutenberg-switch").html(),this.$architectDisplay=t('<div id="tar-display">').append(this.$architectNotificationContent),this.$architectLauncher=this.$architectDisplay.find("#thrive_preview_button"),this.isPostBox=-1!==this.$architectNotificationContent.indexOf("postbox"),t(window).on("storage.tcb",(t=>{if(this.coreEditor){const e=this.coreEditor.getCurrentPost();let i;try{i=JSON.parse(t.originalEvent.newValue)}catch(t){}i&&i.ID&&"tve_post_options_change"===t.originalEvent.key&&i.ID===Number(e.id)&&window.location.reload()}})),wp.data.subscribe((()=>{if(this.coreEditor){const t=this.coreEditor.isSavingPost(),e=this.coreEditor.isAutosavingPost();if(t&&!e){const t=JSON.stringify(this.coreEditor.getCurrentPost());window.localStorage.setItem("tve_post_options_change",t)}}setTimeout((()=>{this.render()}),1)}))},render(){const i=this.$gutenberg.find(".editor-post-title"),o=this.$gutenberg.find(e).not(i.closest(e));let n=!1;this.isPostBox?t("#tar-display").length||(i.length&&("DIV"===i[0].tagName?i.append(this.$architectDisplay):i.after(this.$architectDisplay)),o.hide(),this.$gutenberg.find(".editor-post-title__block").css("margin-bottom","0"),this.$gutenberg.find(".editor-writing-flow__click-redirect,.block-editor-writing-flow__click-redirect").hide(),this.$gutenberg.find(".edit-post-header-toolbar").css("visibility","hidden"),n=!0):t("#thrive_preview_button").length||(this.$gutenberg.find(".edit-post-header-toolbar").append(this.$architectLauncher),this.$architectLauncher.on("click",(function(){o.hide()})),this.$gutenberg.find(".edit-post-header-toolbar").css("visibility","visible"),n=!0),t(".editor-block-list__layout,.block-editor-block-list__layout").addClass("tcb-style-wrap"),n&&this.bindEvents()},bindEvents(){const e=this;t("#tcb2-show-wp-editor").on("click",(function(){const i=e.$gutenberg.find(".tcb-enable-editor").closest(".postbox");t.ajax({type:"post",url:ajaxurl,dataType:"json",data:{_nonce:TCB_Post_Edit_Data.admin_nonce,post_id:this.getAttribute("data-id"),action:"tcb_admin_ajax_controller",route:"disable_tcb"}}),i.next(".tcb-flags").find("input").prop("disabled",!1),i.remove(),e.$gutenberg.find(".editor-block-list__layout,.block-editor-block-list__layout").show(),e.isPostBox=!1,e.render(),e.fixBlocksPreview()})),this.$architectLauncher.on("click",(function(){t.ajax({type:"post",url:ajaxurl,dataType:"json",data:{_nonce:TCB_Post_Edit_Data.admin_nonce,post_id:this.getAttribute("data-id"),action:"tcb_admin_ajax_controller",route:"change_post_status_gutenberg"}})}))},fixBlocksPreview(){const t=document.querySelectorAll('[data-type*="thrive"] iframe');Array.prototype.forEach.call(t,(function(t){const e=t.contentDocument;t.style.setProperty("height",""),t.parentNode.style.setProperty("height",""),Array.prototype.forEach.call(e.body.querySelectorAll(".tve-countdown"),(function(t){t.style.setProperty("--tve-countdown-size","")}));const i=function(t){if(!t)return 0;let e=t.offsetHeight;const i=getComputedStyle(t);return e+=parseInt(i.marginTop)+parseInt(i.marginBottom),e}(e.body);t.style.setProperty("height",i+"px"),t.parentNode.style.setProperty("height",i+"px")}))}};t((function(){i.isGutenbergActive()&&i.init(),window.addEventListener("load",(function(){t(".tcb-revert").on("click",(function(){confirm("Are you sure you want to DELETE all of the content that was created in this landing page and revert to the theme page? \n If you click OK, any custom content you added to the landing page will be deleted.")&&(location.href=location.href+"&tve_revert_theme=1&nonce="+this.dataset.nonce,t("#editor").find(".edit-post-header-toolbar").css("visibility","visible"))}))}))}))}(jQuery);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
void 0===TCB_Front.js_modules.audio&&TCB_Front.setModuleLoadedStatus("audio",!1),(t=>{if(TCB_Front.isModuleLoaded("audio"))return;const a=".thrv_audio";t(window).on("tcb_after_dom_ready",(()=>{tve_frontend_options.is_editor_page||(o.maybeAutoplayAudio(t("body")),t(a).each(((t,a)=>{a.querySelector(".tve_audio-no_audio")&&a.remove()})))})).on("tcb_after_lightbox_open",((e,d)=>{t(d).find(`${a}:not([data-type="dynamic"]) audio, ${a}[data-type="soundcloud"][data-auto_play="1"]`).each(((t,a)=>o.autoplayAudio(a)))})).on("tcb_before_lightbox_close",((a,o)=>{t(o).find("audio").each(((t,a)=>a.pause()))}));const o={maybeAutoplayAudio(o){o.find(`${a}:not([data-type="dynamic"]) audio, ${a}[data-type="soundcloud"][data-auto_play="1"]`).each(((a,o)=>{0===t(o).parents(".tve_p_lb_content").length&&this.autoplayAudio(o)}))},autoplayAudio(a){if("audio"===a.tagName.toLowerCase()&&a.hasAttribute("data-autoplay")){const t=a.play();null!==t&&t.catch((()=>{a.play()}))}else t(a).find("iframe").each(((t,a)=>{let o=a.getAttribute("src")||a.getAttribute("data-src");o=`${o.replace("&auto_play=0","")}&auto_play=1`,a.setAttribute("src",o)}))}};TCB_Front.setModuleLoadedStatus("audio",!0)})(ThriveGlobal.$j);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
(()=>{var t={94185:t=>{void 0===TCB_Front.js_modules.carousel&&TCB_Front.setModuleLoadedStatus("carousel",!1),function(s,e){if(TCB_Front.isModuleLoaded("carousel"))return;const i={tablet:1023,mobile:767};class o{constructor(t){this.carousel=t,this.$carousel=t.$element,this.isEditor=t.isEditor,this.isEditor||this.bindFrontEvents()}static get elementsWithLinks(){return TCB_Front.Hooks.applyFilters("tve.carousel.element_with_links",".tcb-col[data-href],.thrv-content-box[data-href]")}static get carouselContainerSelector(){return".tcb-image-gallery-container, .tcb-carousel-container"}static get carouselSelector(){return'[data-type="carousel"]'}static getResponsiveSetting(t,s,e){const o=JSON.parse(JSON.stringify(t.responsive))["tablet"===e?0:1];let a;return a="desktop"!==e&&o&&o.breakpoint===i[e]&&void 0!==o.settings[s]?o.settings[s]:t[s],a}static setDots(t,s){const e=t.parents('.tcb-image-gallery,[data-type="carousel"]');s&&(t.length&&0===e.find(" > ul.tcb-carousel-dots").length&&e.append(t),t.addClass("tcb-carousel-dots-styled"),t.attr("data-selector",`[data-css="${e.attr("data-css")}"] .tcb-carousel-dots`).find("li").attr("data-selector",`[data-css="${e.attr("data-css")}"] .tcb-carousel-dots li.tcb-dot`).addClass("tcb-dot").html(s))}static isSlickBroken(t){return t.jquery&&(t=t[0]),void 0===t.slick&&t.classList.contains("slick-initialized")}static fixSlick(t){const s=e.Utils.jsonParse(t,"data-carousel-settings");t.removeClass("slick-initialized slick-slider slick-dotted"),t.find(".slick-dots,.slick-prev,.slick-next").remove(),t.find(".tve_image_caption.slick-cloned").remove(),t.find(".thrv_wrapper.tve_image_caption").appendTo(t),t.find(".slick-list").remove(),t.slick(s)}bindFrontEvents(){this.$carousel.on("touchstart.slick mousedown.slick",".slick-list",(()=>{this.CAROUSEL_FOCUS=!0})),this.$carousel.on("touchmove.slick mousemove.slick",".slick-list",(()=>{this.CAROUSEL_FOCUS&&this.$carousel.find(o.elementsWithLinks).addClass("tcb-during-drag")})),this.$carousel.on("touchend.slick mouseup.slick touchcancel.slick mouseleave.slick",".slick-list",(()=>{delete this.CAROUSEL_FOCUS,setTimeout((()=>{this.$carousel.find(o.elementsWithLinks).removeClass("tcb-during-drag")}),50)}))}initCarousel(t=!1){const i=this.$carousel.find(o.carouselContainerSelector),a=e.Utils.jsonParse(i,"data-carousel-settings"),l=a.tcbDots;if(0===Object.keys(a).length)return;delete a.tcbDots,a.rtl=e.isRTL,t&&i.slick("slickRemove"),(this.isEditor&&(i.data("loaded")||void 0!==i[0].slick)||t)&&i.slick("unslick"),(this.isEditor||!i.data("loaded")||t)&&(o.isSlickBroken(i)?o.fixSlick(i):i.slick(a),i.data("loaded",!0)),a.uniformSlidesHeight&&this.$carousel.find(".slick-track").toggleClass("uniform-display-heights",a.uniformSlidesHeight),a.verticalPosition&&this.$carousel.find(".slick-track").attr("vertical-position",a.verticalPosition);const r=o.getResponsiveSetting(a,"centerMode",TCB_Front.getDisplayType());this.$carousel.find(o.carouselContainerSelector).toggleClass("tcb-carousel-center",r),r&&this.$carousel.css("--tcb-carousel-overlap",o.getResponsiveSetting(a,"centerPadding",TCB_Front.getDisplayType())),this.$carousel.find(".slick-list").addClass("tve-prevent-content-edit"),o.setDots(this.$carousel.find("ul.tcb-carousel-dots"),l),this.$carousel.toggleClass("tcb-has-arrows",!!this.$carousel.find(".tcb-carousel-arrow").length),this.isEditor&&i.slick("slickPause"),i.off("breakpoint").on("breakpoint",(()=>{s(o.carouselSelector).each(((t,i)=>{const a=s(i),l=e.Utils.jsonParse(a.find(o.carouselContainerSelector),"data-carousel-settings"),r=a.hasClass("tcb-gallery-crop");o.setDots(a.find("ul.tcb-carousel-dots"),l.tcbDots),this.isEditor&&r&&TVE.Components.image_gallery.cropImages(a,r),this.isEditor&&!TVE.main.EditMode.in_edit()&&a.find(".slick-list").addClass("tve-prevent-content-edit")}))})),this.isEditor||this.$carousel.attr("data-cwv-ready","1"),i.removeClass("tve-loading load-bot")}}t.exports=o,window.TCB_Front.Carousel=o,TCB_Front.setModuleLoadedStatus("carousel",!0)}(ThriveGlobal.$j,TCB_Front)}},s={};!function e(i){var o=s[i];if(void 0!==o)return o.exports;var a=s[i]={exports:{}};return t[i](a,a.exports,e),a.exports}(94185)})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
void 0===TCB_Front.js_modules["content-reveal"]&&TCB_Front.setModuleLoadedStatus("content-reveal",!1),(t=>{if(TCB_Front.isModuleLoaded("content-reveal"))return;t(window).on("tcb_after_dom_ready",(()=>{t(".thrv_content_reveal").each(((n,o)=>e.init(t(o))))}));const e={init(n){e.initTestimonialSlider(n);const o=n.parents(".tve_p_lb_content"),r=n.children("thrv_tabs_shortcode").length,i=n.children(".thrv_toggle_shortcode").length;let a=parseInt(n.attr("data-after"));a=isNaN(a)?0:a,TCB_Front.$window.trigger("tve_after_content_toggle",[n,!1]);const l=function(){setTimeout((function(){n.slideDown(200,(function(){n.trigger("lbresize")})),n.data("scroll")&&t("html, body").animate({scrollTop:n.offset().top-270});const e=n.parents("#tve_editor").length,o=n.attr("data-redirect-url");tve_frontend_options.is_editor_page||e&&1!==parseInt(tve_frontend_options.is_single)||"string"!=typeof o||!o.length||!TCB_Front.isValidUrl(o)||(window.location=o),n.find("iframe").not(".thrv_social_default iframe, .tcb-responsive-video").each((function(){const e=t(this);e.attr("src")||r&&i||e.attr("src",e.attr("data-src"))})),n.find(".thrlider-slider").each((function(){t(this).parent().thrlider("init_elements")})),n.trigger("tve-content-revealed",n),TCB_Front.Utils.handleContent(n)}),1e3*a)};o.length?o.bind("tve.lightbox-open",l):l()},initTestimonialSlider(e){const n=e.find(".thrlider-slider");n.length>0&&n.each((function(){t(this).parent().attr("data-no-init","true")}))}};TCB_Front.setModuleLoadedStatus("content-reveal",!0)})(ThriveGlobal.$j);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
void 0===TCB_Front.js_modules.country&&TCB_Front.setModuleLoadedStatus("country",!1),(t=>{if(TCB_Front.isModuleLoaded("country"))return;const e={init(t){e.setupDefaultValue(t),e.buildAutocomplete(t)},onlyOneCountry:t=>"include"===t.attr("data-display-type")&&1===JSON.parse(t.attr("data-display-list")).length,setupDefaultValue(e){const a=t(e),o=a.find("input");o.attr("default-value",o.val()),o.attr("placeholder",o.attr("data-placeholder"));const i=a.find(".tve-lg-dropdown-trigger").find(".tve-disabled-text-inner"),n=a.closest(".tve_lead_generated_inputs_container").find(`.thrv_text_element[data-label-for="${a.attr("data-label")}"]`);if(this.onlyOneCountry(a)){const t=JSON.parse(a.attr("data-display-list"))[0].name,e="1"===a.attr("data-display-hide");n.removeClass("tve-hide-country"),a.removeClass("tve-hide tve-disabled"),o.val(t),o.attr("default-value",t),i.text(t),e?(n.addClass("tve-hide-country"),a.addClass("tve-hide-country")):a.addClass("tve-disabled")}},afterInit(e){const a=t(e),o=a.find("input");a.on("mousedown",(e=>{const a=t(e.target);if(a.hasClass("ui-autocomplete-input")){if(a.autocomplete("widget").is(":visible"))return void a.autocomplete("close");t(e.currentTarget).trigger("blur"),a.autocomplete("search",""),a.trigger("focus")}})),o.on("focus",(e=>{const a=t(e.target);a.autocomplete("widget").is(":visible")?a.autocomplete("close"):a.autocomplete("search","")}))},buildAutocomplete(a){const o=t(a),i=o.find("input"),n=o.find(".tve-lg-dropdown-list");i.on("input.tve",(function(){const e=t(this);let a=null;e.val()&&(a=o.find(`.tve-lg-country-list [data-value="${i.val()}"]`),a=a.length?a:null),window.setTimeout((()=>{e.trigger("changevalue.tveDropdown",a)}),0)})),i.trigger("input.tve"),o.find(".tve-lg-dropdown-list").remove(),i.autocomplete({source:e.buildData(n),appendTo:o,minLength:0,classes:{"ui-autocomplete":"tve-lg-dropdown-list tve-lg-country-list"},create(){t(this).css({opacity:0,padding:o.css("padding"),border:0,background:"transparent",color:o.find(".tve-disabled-text-inner").css("color"),font:o.find(".tve-disabled-text-inner").css("font"),letterSpacing:o.find(".tve-disabled-text-inner").css("letter-spacing"),textTransform:o.find(".tve-disabled-text-inner").css("text-transform")}),t(this).autocomplete("widget").attr("data-selector",`${o.attr("data-selector")} .tve-lg-dropdown-list:not(.tcb-excluded-from-group-item)`),t(this).data("ui-autocomplete")._renderItem=function(e,a){return t('<li class="tve-lg-dropdown-option">').data("item.autocomplete",a).attr("data-value",a.label).attr("data-code",a.code).attr("data-label-value",1).attr("data-custom-option",1).attr("data-selector",`${o.attr("data-selector")} .tve-lg-dropdown-list:not(.tcb-excluded-from-group-item) .tve-lg-dropdown-option:not(.tcb-excluded-from-group-item)`).append(`<span class="tve-input-option-text tcb-plain-text">${a.label}</span>`).appendTo(e)}},open(){t(this).siblings(".tve-lg-dropdown-trigger").find(".tve-disabled-text-inner").css({opacity:0}),t(this).css({opacity:1}),t(this).autocomplete("widget").css({top:"",left:"",width:"",display:""})},close(){const a=t(this).val();e.buildData(n).some((t=>t.label.toLowerCase()===a.toLowerCase()))||t(this).trigger("changevalue.tveDropdown",null),t(this).parent().trigger("focus")},select(e,a){t(this).val(a.item.label),t(this).parent().find(".tve-disabled-text-inner").text(a.item.label),t(this).trigger("changevalue.tveDropdown",e.currentTarget.querySelector(`[data-code="${a.item.code}"]`))}}),i.on("blur",(function(){t(this).parent().removeClass("tve-state-expanded"),t(this).parent().find(".tve-disabled-text-inner").text(t(this).val()||t(this).attr("data-placeholder")),t(this).siblings(".tve-lg-dropdown-trigger").find(".tve-disabled-text-inner").css({opacity:1}),t(this).css({opacity:0})}))},buildData(e){const a=[],o=e.find(".tve-lg-dropdown-option");return t.each(o,((e,o)=>{const i=t(o).attr("data-value"),n=t(o).attr("data-code");""!==i&&a.push({label:i,code:n})})),a},moveA11yElementsTo(e,a){const o=t(a),i=t("body").find(".ui-helper-hidden-accessible");i.length&&(i.addClass("screen-reader-text"),o.append(i.get(e)))}};t(window).on("tcb_after_dom_ready",(()=>{t(".tve_lg_country").each((function(t){TCB_Front.Utils.isEditorPage()||(e.init(this),e.afterInit(this),e.moveA11yElementsTo(t,this))}))})),TCB_Front.setModuleLoadedStatus("country",!0)})(ThriveGlobal.$j);

View File

@@ -0,0 +1 @@
(()=>{var t;void 0===TCB_Front.js_modules.datepicker&&TCB_Front.setModuleLoadedStatus("datepicker",!1),t=ThriveGlobal.$j,TCB_Front.isModuleLoaded("datepicker")||(t(".tve_lg_date").each((function(){const a=t(this);if(!a.find(".flatpickr-calendar").length){const t=a.find(".lg-date-picker"),i=a.find(".thrv_icon");try{const e=a.data("date-configs"),r=Number(t.attr("data-is-limit-days")),n=Number(t.attr("data-is-limit-hours"));if(e.onReady=function(t,a,i){i.calendarContainer.classList.add("tve-lg-date-calendar")},r){const a=JSON.parse(t.attr("data-limit-days")),{disable:i,locale:r}={disable:[function(t){return!a.includes(t.getDay())}],locale:{firstDayOfWeek:1}};e.disable=i,e.locale=r}if(n){const a=t.attr("data-start-hour"),i=t.attr("data-start-minute"),r=t.attr("data-start-meridiem");e.defaultHour="PM"===r?12===a?a:Number(a)+12:12===a?0:Number(a),i&&(e.defaultMinute=i)}t.flatpickr(e),i.length&&"inline"in e&&(i.addClass("thrv_field_inner"),t.addClass("thrv_field_inner"),a.find(".thrv_field_inner").wrapAll('<div class="thrv_field_wrapper" style="position: relative;"></div>')),"inline"in e&&a.find(".flatpickr-current-month input.cur-year").attr("style","padding: 0 !important; border: 0 !important; background-color: transparent !important; background-image: none !important; color: inherit !important; font-size: inherit !important; font-size: inherit !important; font-weight: inherit !important; line-height: inherit !important;")}catch(t){}}})),TCB_Front.setModuleLoadedStatus("datepicker",!0))})();

View File

@@ -0,0 +1 @@
void 0===TCB_Front.js_modules.divider&&TCB_Front.setModuleLoadedStatus("divider",!1),((t,d)=>{if(TCB_Front.isModuleLoaded("divider"))return;const e={init(){d.addResizeCallback(e.customDividerStyle),e.customDividerStyle()},customDividerStyle(){t(".thrv-divider").each((function(){const i=t(this),s=i.find("hr");TCB_Front.Utils.windowWidth()>1023?e.removeOldClass(s).addClass(d.getMediaAttr(i,"data-style","desktop")):TCB_Front.Utils.windowWidth()>767?e.removeOldClass(s).addClass(d.getMediaAttr(i,"data-style","tablet")):e.removeOldClass(s).addClass(d.getMediaAttr(i,"data-style","mobile"))}))},removeOldClass:t=>(t.removeClass((function(t,d){return(d.match(/(^|\s)tve_sep-\S+/g)||[]).join(" ")})),t)};t(window).on("tcb_after_dom_ready",(()=>e.init())),window.addEventListener("load",(()=>e.init())),TCB_Front.setModuleLoadedStatus("divider",!0)})(ThriveGlobal.$j,TCB_Front);

View File

@@ -0,0 +1 @@
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);

View File

@@ -0,0 +1 @@
(()=>{var t,e={88669:t=>{class e{constructor(t,e="v15.0"){this.appId=t,this.apiVersion=e,this.userId=null,this.callbacks={}}static get fb(){return window.FB}static isLoaded(){return void 0!==e.fb}static loadSdk(){const t=document.createElement("script");t.id="facebook-jssdk",t.setAttribute("src","https://connect.facebook.net/en_US/sdk.js"),document.head.appendChild(t)}static addButton(t,e="medium"){t.html(`<div class="fb-login-button" \n\t\t\t\t\t\t\t\tdata-width=""\n\t\t\t\t\t\t\t\tdata-size="${e}" \n\t\t\t\t\t\t\t\tdata-onlogin="tve_on_facebook_login_click" \n\t\t\t\t\t\t\t\tdata-button-type="continue_with" \n\t\t\t\t\t\t\t\tdata-layout="default" \n\t\t\t\t\t\t\t\tdata-auto-logout-link="false" \n\t\t\t\t\t\t\t\tdata-use-continue-as="true">\n\t\t\t\t\t\t</div>`)}isConnected(){return!!this.appId}registerCallback(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}trigger(t,...e){this.callbacks[t]&&this.callbacks[t].forEach((t=>t(...e)))}init(){window.fbAsyncInit=()=>{e.fb.init({appId:this.appId,cookie:!1,xfbml:!0,version:this.apiVersion}),this.trigger("init")},e.isLoaded()||e.loadSdk()}handleAuth(t,e=!0){"connected"===t.status?(this.userId=t.authResponse.userID,this.trigger("auth",t)):e&&this.login()}login(){e.fb.login((t=>{this.handleAuth(t,!1)}))}getProfilePicture(t=420){return new Promise(((o,i)=>{e.fb.api(`/${this.userId}/picture?redirect=false`,"GET",{width:t},(t=>{t&&!t.error?o(t.data.url):i(t.error)}))}))}}t.exports=t=>{const o=new e(tve_frontend_options.facebook_app_id);return t.tve_on_facebook_login_click=t=>o.handleAuth(t),o}}},o={};void 0===TCB_Front.js_modules["facebook-api"]&&TCB_Front.setModuleLoadedStatus("facebook-api",!1),t=ThriveGlobal.$j,TCB_Front.isModuleLoaded("facebook-api")||(TCB_Front.facebookApi=function t(i){var a=o[i];if(void 0!==a)return a.exports;var n=o[i]={exports:{}};return e[i](n,n.exports,t),n.exports}(88669)(window),t(window).on("tcb_after_dom_ready",(()=>{TCB_Front.facebookApi.init()})),TCB_Front.setModuleLoadedStatus("facebook-api",!0))})();

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
void 0===TCB_Front.js_modules["fill-counter"]&&TCB_Front.setModuleLoadedStatus("fill-counter",!1),(t=>{if(TCB_Front.isModuleLoaded("fill-counter"))return;t(window).on("tcb_after_dom_ready",(()=>{t(".thrv_fill_counter").each(((o,i)=>e.init(t(i))))}));const e={init(e){e.one("tve.start-animation",(function(){const o=e.find(".tve_fill_counter").attr("data-fill"),i=2*o,l=["-webkit-transform","-ms-transform","transform"];for(const e in l)t(".tve_fill_c_in, .tve_fill_circle.tve_fill_circle1",this).css(l[e],"rotate("+o+"deg)"),t(".tve_fill_c_in-d",this).css(l[e],"rotate("+i+"deg)")}))}};TCB_Front.setModuleLoadedStatus("fill-counter",!0)})(ThriveGlobal.$j);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
void 0===TCB_Front.js_modules.modal&&TCB_Front.setModuleLoadedStatus("modal",!1),(t=>{if(!TCB_Front.isModuleLoaded("modal")){TCB_Front.Utils.isEditorPage()||t(window).on("tcb_after_dom_ready",(()=>{const t=Array.from(TCB_Front.$body.find('[data-action="open-modal"]')),a=t.map((t=>t.getAttribute("data-modal-type")));TVE_Dash.add_load_item("tcb-modals",a,(a=>{t.forEach((t=>{const o=t.getAttribute("data-modal-type");if(a[o]){const r=e.instance(a[o],o,{size:t.getAttribute("data-modal-size")||"medium"});t.addEventListener("click",(()=>r.open())),TCB_Front.Hooks.doAction("tcb-modal.loaded",o,r,t)}}))}))}));class e{constructor(e,a,o={}){this.$element=t("<div></div>").html(e),this.type=a,this.options=o,this.callbacks={}}static get $wrapper(){return e.$_wrapper||(e.$_wrapper=t('<div class="tve-modal-wrapper"><div class="tve-modal-inner"></div></div>').appendTo(t("body")),e.$_wrapper.on("mousedown",(t=>{t.target===e.$_wrapper[0]&&e.close()})),document.addEventListener("keyup",(t=>{"Escape"===t.key&&e.isOpen()&&e.close()}))),e.$_wrapper}static get $inner(){return e.$_inner||(e.$_inner=e.$wrapper.find(".tve-modal-inner"),e.$_inner.on("click",'[data-dismiss="true"]',(()=>e.close())),e.$_inner.on("click change input keyup","[data-trigger]",(t=>{const a=t.currentTarget,o=a.getAttribute("data-trigger"),r=a.getAttribute("data-fn");(o===t.type||"onEnter"===o&&"keyup"===t.type&&"Enter"===t.key)&&r&&e.getCurrentOpenModal().executeCallback(r,t,a)}))),e.$_inner}static get closeButton(){return'<button class="tve-modal-x" data-dismiss="true"></button>'}static isOpen(){return e.$wrapper.hasClass("tve-modal-open")}static close(){if(e.isOpen()){const t=e.$wrapper.data("modal");t&&t.executeCallback("before-close")}e.$wrapper.removeClass("tve-modal-open").removeData("modal"),e.$inner.empty(),TCB_Front.Hooks.doAction("tcb-modal.close")}static getCurrentOpenModal(){return e.$wrapper.data("modal")}static instance(t,a,o){return new e(t,a,o)}registerCallback(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}executeCallback(t,...e){this.callbacks[t]&&this.callbacks[t].forEach((t=>t(...e))),TCB_Front.Hooks.doAction(`tcb-modal.${t}`,this.type,this)}open(){this.executeCallback("before-open"),e.$wrapper.addClass("tve-modal-open").attr("data-modal-type",this.type).data("modal",this),e.$inner.empty().append(e.closeButton).append(this.$element).attr("data-size",this.options.size),this.executeCallback("after-open")}isOpen(){return e.isOpen()&&this===e.$wrapper.data("modal")}}TCB_Front.modal=e,TCB_Front.setModuleLoadedStatus("modal",!0)}})(ThriveGlobal.$j);

View File

@@ -0,0 +1 @@
void 0===TCB_Front.js_modules["number-counter-compat"]&&TCB_Front.setModuleLoadedStatus("number-counter-compat",!1),(t=>{if(TCB_Front.isModuleLoaded("number-counter-compat"))return;t(window).on("tcb_after_dom_ready",(()=>{t(".thrv_number_counter").each(((o,n)=>e.init(t(n))))}));const e={init(e){e.on("tve.start-animation",(function(){const e=t(".tve_numberc_text",this),o=e.attr("data-counter"),n=e.attr("data-counter-start")?e.attr("data-counter-start"):0,r=parseInt(n);let a=null,u=Math.ceil((o>r?o:r)/100);u=u||1,r<o?function t(o,n){o<=n?(e.text(o),(o+=u)+u>n&&(e.text(n),clearTimeout(a)),a=setTimeout((function(){t(o,n)}),50)):clearTimeout(a)}(r,o):function t(o,n){o>=n?(e.text(o),(o-=u)-u<n&&(e.text(n),clearTimeout(a)),a=setTimeout((function(){t(o,n)}),50)):clearTimeout(a)}(r,o)}))}};TCB_Front.setModuleLoadedStatus("number-counter-compat",!0)})(ThriveGlobal.$j);

View File

@@ -0,0 +1 @@
(()=>{var t={87344:t=>{class e{static defaultOptions={from:100,to:15e3,speed:2500,"refresh-interval":10,"decimal-character":".","thousand-divider":",",decimals:0};constructor(t,e=window){this.$element=t,this.$number=this.$element.find(".tve-number"),this.window=e,this.window.TCB_Front.Utils.isEditorPage()||this.$element.attr("data-init",1)}init(){this.currentValue=Number(this.getData("from")),this.started=!1,this.finished=!1,this.type=this.getData("anim");const t=this.getData("speed")+7;return this.loops=Math.ceil(t/100),this.increment=(this.getData("to")-this.getData("from"))/this.loops,this}getData(t=""){let i=this.$element.attr(`data-${t}`);return void 0===i&&(i=e.defaultOptions[t]),i}start(){"function"==typeof this[`${this.type}Animation`]&&(this.started=!0,this[`${this.type}Animation`]())}tickerAnimation(){this.loopCount=0,this.interval&&clearInterval(this.interval),this.interval=setInterval(this.updateValue.bind(this),this.getData("refresh-interval"))}slideAnimation(){this.recalculateDigitWidth();let t=this.getData("formatted-from"),e=this.getData("final-number");[t,e]=this.compareNumberRange(t,e),this.$number.empty(),e.split("").forEach(((e,i)=>{const r=this.window.ThriveGlobal.$j(`<div class="tcb-digit">${e}</div>`).appendTo(this.$number);if([",","."," ","-"].includes(e))r.addClass("tcb-character-digit");else{r.empty(),e=parseInt(e);const n=this.getSize(),s=this.window.Scroller.getNewInstance({width:n,amount:n||25,direction:this.window.Scroller.DIRECTION.DOWN,interval:this.getData("speed"),separatorType:this.window.Scroller.SEPARATOR.THOUSAND});s.appendTo(r[0]);const a=t[i];[",","."," ","-"].includes(a)||s.scrollFromTo(a,e)}}))}recalculateDigitWidth(){const t=this.$number.clone();t.addClass("tve-number-counter-temporary-clone").insertAfter(this.$number);let e=t.text("1").width();"italic"===t.css("font-style")&&(e+=e/10),this.window.TCB_Front.inlineCssVariable(this.$element,"--tve-number-counter-digit-width",`${e}px`),t.remove()}compareNumberRange(t,e){const i=e.length-t.length;return i>0?t="0".repeat(Math.abs(i))+t:i<0&&(e="0".repeat(Math.abs(i))+e),[t,e]}getDividerSize(){const t=this.getSize();return t<=50?10:t/5}getSize(){return parseFloat(this.$element.css("font-size"))}updateValue(){this.currentValue+=this.increment,this.loopCount++,this.render(),this.loopCount>=this.loops&&(clearInterval(this.interval),this.onFinish())}onFinish(){this.finished=!0;const t=this.getData("final-number");this.$element.find(".tve-number").html(t)}render(t){void 0===t&&(t=this.currentValue);let e=t.toFixed(this.getData("decimals"));e=e.replace(/\B(?=(?:\d{3})+(?!\d))/g,this.getData("thousand-divider"));const i=`.(?=${new Array(parseInt(this.getData("decimals"))).fill(".").join("")}$)`;0!==parseInt(this.getData("decimals"))&&(e=e.replace(new RegExp(i),this.getData("decimal-character"))),this.$number.html(e)}}t.exports=e}},e={};function i(r){var n=e[r];if(void 0!==n)return n.exports;var s=e[r]={exports:{}};return t[r](s,s.exports,i),s.exports}void 0===TCB_Front.js_modules["number-counter"]&&TCB_Front.setModuleLoadedStatus("number-counter",!1),((t,e)=>{if(TCB_Front.isModuleLoaded("number-counter"))return;const r=i(87344),n=[];t(window).on("tcb_after_dom_ready",(()=>{let i=!1;t('.tve-number-counter .tve-number-wrapper:not([data-init="1"])').each(((e,s)=>{const a=new r(t(s));a.$number.html(a.getData("final-number")),a.init().render(),n.push(a),i=!0})),i&&e.$window.trigger("scroll")})),e.add_scroll_callback((()=>{n.forEach((t=>{!t.started&&e.isInViewport(t.$element)&&t.start()}))}),e),window.TCB_Front.NumberCounter=r,e.setModuleLoadedStatus("number-counter",!0)})(ThriveGlobal.$j,TCB_Front)})();

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
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);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
void 0===TCB_Front.js_modules["post-list"]&&TCB_Front.setModuleLoadedStatus("post-list",!1),(t=>{if(!TCB_Front.isModuleLoaded("post-list")){t(window).on("tcb_after_dom_ready",(()=>{t(".tcb-post-list").each(((i,s)=>{new e(t(s)).renderPagination()}))}));class e{constructor(e){this.$element=e,this.content="",this.listArgs={};let i=this.getAttr("data-css");const s=t.Event("tcb_post_list_identifier.tcb");if(this.$element.trigger(s),s.identifier&&(i=s.identifier),this.identifier=i,this.listIdentifier="article",tve_frontend_options.is_editor_page?this.editorInit():this.frontendInit(),this.isCarousel()){this.isEditor=tve_frontend_options.is_editor_page;const t=this.$element.find(".tcb-carousel-container");t.attr("data-carousel-settings",decodeURI(t.attr("data-carousel-settings"))),this.carousel=new TCB_Front.Carousel(this),this.carousel.initCarousel()}}getPaginationInstance(){if(this.listArgs&&this.listArgs.attr){const t=this.listArgs.attr["pagination-type"];if(t.length&&"none"!==t&&void 0!==TCB_Front.Pagination)return TCB_Front.Pagination.factory(t,this)}}renderPagination(){this.pagination=this.getPaginationInstance(),this.pagination&&(tve_frontend_options.is_editor_page||this.pagination.addLoadListeners(),this.pagination.render())}editorInit(){this.listArgs={attr:{"pagination-type":this.getAttr("data-pagination-type"),total_post_count:this.getAttr("data-total_post_count")?this.getAttr("data-total_post_count"):100,pages_near_current:this.getAttr("data-pages_near_current")?this.getAttr("data-pages_near_current"):2},query:{posts_per_page:this.getAttr("data-posts_per_page")?this.getAttr("data-posts_per_page"):6,paged:1}}}frontendInit(){"undefined"==typeof tcb_post_lists?console.warn("Error initializing the post list parameters"):(this.listArgs=tcb_post_lists.find((t=>this.$element.is(t.identifier))),this.listArgs&&(this.listArgs.query&&void 0!==this.listArgs.query.offset&&delete this.listArgs.query.offset,this.listArgs.attr.queried_object=0,this.listArgs.query.queried_object=tve_frontend_options.queried_object,this.content=t('.tcb-post-list-template[data-identifier="'+this.listArgs.template+'"]').html()))}getAttr(t){return this.$element.attr(t)}getItems(t,e=this.listArgs){TCB_Front.Utils.restAjax({route:tve_frontend_options.routes.posts+"/html",data:{content:this.content,args:e}}).done((e=>{"function"==typeof t&&t(e),this.initItems(),TCB_Front.event_triggers(this.$element)})).fail((()=>{console.warn("There was an error and the content could not be loaded.")}))}insertItems(e,i=!1){if(e.count&&e.posts){const s=this.$element.clone().empty();for(const t in e.posts)e.posts.hasOwnProperty(t)&&s.append(e.posts[t]);i?(this.$element.replaceWith(s),this.identifier.includes("tve-u-")?this.$element=t(`.tcb-post-list[data-css=${this.identifier}]`):this.$element=t(this.identifier),t(window).trigger("tcb_post_list_after_item_insert")):this.isCarousel()&&this.carousel?(this.$element.find(".slick-track").append(s.html()),this.carousel.initCarousel(!0)):(this.$element.append(s.html()),this.masonryRedo()),e.total_post_count&&(this.listArgs.attr.total_post_count=e.total_post_count)}}isLoading(){return this.$element.data("loading")}enableLoading(t=""){this.$element.addClass("tve-loading"+(t.length?" "+t:"")),this.$element.data("loading",!0)}disableLoading(){setTimeout((()=>this.$element.removeClass("tve-loading load-bot")),100),this.$element.data("loading",!1)}masonryRedo(t=this.$element){if(t.length&&t.data("masonry")){const e=t.find(`${this.listIdentifier}:not(.masonry-brick)`);t.masonry("appended",e),t.masonry("layout")}}initItems(){(this.$element.find(".tcb-custom-field-source.thrv-rating").length||this.$element.find("[data-shortcode-id*='acf_']").length)&&TCB_Front.dynamicElements.init()}isCarousel(){return"carousel"===this.$element.attr("data-type")}}window.TCB_Front.PostList=e,TCB_Front.setModuleLoadedStatus("post-list",!0)}})(ThriveGlobal.$j);

View File

@@ -0,0 +1 @@
void 0===TCB_Front.js_modules["pricing-table"]&&TCB_Front.setModuleLoadedStatus("pricing-table",!1),(t=>{if(TCB_Front.isModuleLoaded("pricing-table"))return;t(window).on("tcb_after_dom_ready",(()=>{TCB_Front.Utils.isEditorPage()||t(".thrv-pricing-table").each(((i,n)=>e.init(t(n))))}));const e={init(t){e.bindEvents(t.find(".thrv-button-group")),t.find('.thrv-button-group-item[data-default="true"]').trigger("click")},bindEvents(t){t.off("click.thrv-button-group-item").on("click.thrv-button-group-item",".thrv-button-group-item",e.showPriceBox)},showPriceBox(e){e.stopPropagation(),e.preventDefault();const i=t(this),n=i.closest(".thrv-pricing-table");n.find(".tcb-active-state").removeClass("tcb-active-state"),n.find(".tcb-pricing-table-box-container").addClass("tcb-permanently-hidden"),i.addClass("tcb-active-state");const o=n.find(`.tcb-pricing-table-box-container[data-instance="${i.attr("data-instance")}"]`).removeClass("tcb-permanently-hidden");TCB_Front.$window.trigger("tve_after_content_toggle",[o])}};TCB_Front.setModuleLoadedStatus("pricing-table",!0)})(ThriveGlobal.$j);

View File

@@ -0,0 +1 @@
void 0===TCB_Front.js_modules["progress-bar"]&&TCB_Front.setModuleLoadedStatus("progress-bar",!1),function(e,t){if(TCB_Front.isModuleLoaded("progress-bar"))return;e(window).on("tcb_after_dom_ready",(()=>s.init(e("body"))));const s={},a=e=>{if(!e)return 0;let t=e.offsetWidth;const s=getComputedStyle(e);return t+=parseInt(s.marginLeft)+parseInt(s.marginRight),t},r=(e,s=!1)=>{const a=t.inlineCssVariable(e,"--nodes-completed"+(s?"-dual":"")),r=parseInt(a),l=a-r,o=e.querySelectorAll(".tve-progress-line--fill"+(s?"-dual":""));Array.prototype.forEach.call(o,(e=>{t.inlineCssVariable(e,{["--progress"+(s?"-dual":"")]:"0%"})}));for(let e=0;e<r;e++)o[e]&&t.inlineCssVariable(o[e],{["--progress"+(s?"-dual":"")]:"100%"});if(l&&o[r]&&t.inlineCssVariable(o[r],{["--progress"+(s?"-dual":"")]:"50%"}),tve_frontend_options.is_editor_page&&e.classList.contains("thrv_data_element_start")&&(e.classList.remove("thrv_data_element_start"),setTimeout((()=>{e.classList.add("thrv_data_element_start")}),100)),!s){const t=e.querySelectorAll(".tve-progress-node"),s=e.querySelectorAll(".tve-progress-icon"),a=e.querySelectorAll(".tve-progress-label-wrapper--nodes .tve-progress-label");for(let e=0;e<=t.length;e++)t[e]&&(t[e].classList.remove("tve-state-expanded"),s[e].classList.remove("tve-state-expanded"),a[e].classList.remove("tve-state-expanded"));if(r)for(let e=0;e<=r;e++)t[e]&&(t[e].classList.add("tve-state-expanded"),s[e].classList.add("tve-state-expanded"),a[e].classList.add("tve-state-expanded"));l&&t[r]&&(t[r].classList.add("tve-state-expanded"),s[r].classList.add("tve-state-expanded"),a[r].classList.add("tve-state-expanded"))}},l=(e,s=!1,a=!1)=>{if(s&&["apprentice"].includes(e.dataset.field))return;const r=e.getAttribute(`data${s?"-dual":""}-field`),l=e.getAttribute(`data${s?"-dual":""}-fd`),o=e.getAttribute(`data${s?"-dual":""}-value`),d=e.getAttribute(`data${s?"-dual":""}-dv`),i=e.getAttribute(`data${s?"-dual":""}-value-shortcode`),n=e.querySelectorAll(".tve-progress-label-wrapper--nodes .tve-progress-label").length;let p;if("request_data"===r){switch(l){case"query":p=t.queryString.get(o);break;case"post":p=tve_frontend_options.post_request_data?tve_frontend_options.post_request_data[o]:0;break;case"cookie":p=t.getCookie(o)}p=p||d}else if("apprentice"===r){try{let s={total:a?n:4,completed:a?n/2:2};try{s=JSON.parse(i)}catch(e){}const r=Number(s.is_current_completed)?s.completed:s.completed+1;if(a)p=s.completed,t.inlineCssVariable(e,{"--nodes-completed-dual":Math.min(r,n)});else{if(!s.total)return void e.remove();p=s.completed/s.total*100,t.inlineCssVariable(e,{"--progress-dual":`${Math.min(r/s.total*100,100)}%`})}}catch(e){}p=p||d}else p=i;p=Number(p),p=isNaN(p)?0:Math.min(p,a?n:100),t.inlineCssVariable(e,{[a?"--nodes-completed"+(s?"-dual":""):"--progress"+(s?"-dual":"")]:`${p}${a?"":"%"}`})},o=(e=t.$body)=>e.find(".tve-progress-bar-wrapper").addBack(".tve-progress-bar-wrapper");s.handleLabelPosition=(e=t.$body)=>{o(e).each(((e,t)=>{if("nodes"===t.dataset.type){const e=t.querySelectorAll(".tve-progress-label-wrapper--nodes .tve-progress-label"),s=t.querySelectorAll(".tve-progress-node");for(let t=0;t<s.length;t++)e[t].style.setProperty("left",s[t].offsetLeft+Math.ceil(s[t].offsetWidth/2)-a(e[t])/2+"px"),tve_frontend_options.is_editor_page||e[t].style.setProperty("visibility","visible")}}))},s.fillNodes=e=>{e.each(((e,t)=>{r(t),t.classList.contains("with-dual-progress")&&r(t,!0)})),s.toggleLabels(e)},s.handleDynamicValues=e=>{e.hasClass("tve-progress-bar-wrapper")||(e=e.find(".tve-progress-bar-wrapper")),e.filter("[data-field],[data-dual-field]").each(((e,s)=>{const a=s.classList.contains("with-dual-progress"),o="nodes"===s.dataset.type;l(s,!1,o),a&&l(s,!0,o),o&&(r(s),a&&r(s,!0)),s.dataset.field&&!tve_frontend_options.is_editor_page&&((e,s)=>{let a="block",r=parseFloat(t.inlineCssVariable(e,s?"--nodes-completed":"--progress"));s&&e.querySelectorAll(".tve-progress-node").length===r&&(r=100),(0===r&&parseInt(e.dataset.hideEmpty)||100===r&&parseInt(e.dataset.hideFull))&&(a="none"),e.style.setProperty("display",a,"important")})(s,o)}))},s.toggleLabels=(s=t.$body)=>{o(s).each(((s,a)=>{const r=e(a),l=r.find(".tve-progress-label-wrapper--nodes .tve-progress-label");if("current"===TCB_Front.getMediaAttr(r,"data-label-display")){const e=parseInt(t.inlineCssVariable(r,"--nodes-completed"));l.css("visibility","hidden"),l.eq(e).css("visibility","visible")}else l.css("visibility","visible")}))},s.init=e=>{const a=(e=t.$body)=>{s.handleLabelPosition(e),s.toggleLabels()};s.handleDynamicValues(o(e)),a(),t.addResizeCallback((()=>{a()})),t.$document.on("switchstate",(function(e,t){a(t)}))},window.TCB_Front.progressBar=s,TCB_Front.setModuleLoadedStatus("progress-bar",!0)}(ThriveGlobal.$j,TCB_Front);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
void 0===TCB_Front.js_modules.table&&TCB_Front.setModuleLoadedStatus("table",!1),(t=>{if(TCB_Front.isModuleLoaded("table"))return;const e=".tve_make_sortable",o=/[$£€]/;t(window).on("tcb_after_dom_ready",(()=>r.tableSort(t(`${e} tr th`))));const r={tableSort(n){n.find(".tva-t-sort").remove(),n.append('<span class="tva-t-sort thrv-svg-icon">'+TCB_Front.icons.get("sort")+TCB_Front.icons.get("sort-desc")+TCB_Front.icons.get("sort-asc")),n.off("click.table_sort").on("click.table_sort",(function(){const a=t(this),s=a.index(),d=a.parents(e),c=d.find("tbody"),i=[],l=[],x="down"===a.attr("data-direction")?"up":"down";a.attr("data-direction",x),t(d).find("tbody tr").each(((e,r)=>{const n=t(r),a=n.find("> td").eq(s).text().trim().replace(/\u200B/g,"").toLowerCase(),d=o.test(a);let c=d?a:parseFloat(a);isNaN(c)&&!d?i.push({tr:n,text:a,oText:a}):(d&&(c=parseFloat(c.replace(o,""))),l.push({tr:n,text:c,oText:a}))})),i.sort("down"===x?r.sortArrayAscending:r.sortArrayDescending),l.sort("down"===x?r.sortArrayAscending:r.sortArrayDescending);const T="down"===x?l.concat(i):i.concat(l);t.each(T,(function(t,e){c.append(e.tr)})),n.attr("data-direction",""),a.attr("data-direction",x)}))},sortArrayAscending(t,e){let o;return o=t.text===e.text?t.oText>e.oText?1:t.oText<e.oText?-1:0:t.text>e.text?1:-1,o},sortArrayDescending(t,e){let o;return o=t.text===e.text?t.oText>e.oText?-1:t.oText<e.oText?1:0:t.text>e.text?-1:1,o}};window.TCB_Front.tableSort=r.tableSort,TCB_Front.setModuleLoadedStatus("table",!0)})(ThriveGlobal.$j);

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
({62694:function(){void 0===TCB_Front.js_modules.timer&&TCB_Front.setModuleLoadedStatus("timer",!1),(t=>{if(TCB_Front.isModuleLoaded("timer"))return;const e=[".thrv-countdown_timer_evergreen",".tve_countdown_timer_evergreen",".thrv-countdown_timer_plain",".thrv_countdown_timer:not(.tve_countdown_timer_evergreen)"].join(", ");t(window).on("tcb_after_dom_ready",(()=>{TCB_Front.Utils.isEditorPage()||t(e).each(((e,a)=>n(t(a))))}));const n=e=>{let n,a=new Date,o=new Date(e.attr("data-date")+"T"+e.attr("data-hour")+":"+e.attr("data-min")+":"+(e.attr("data-sec")||"00")+e.attr("data-timezone")),r=0,i=0,d=0,s=0,_=2;if(e.data("tcb_timer_done"))return this;const f=e.attr("data-text"),l=e.hasClass("thrv-countdown_timer_evergreen")||e.hasClass("tve_countdown_timer_evergreen"),c=e.attr("data-norestart"),p=parseInt(e.attr("data-day")),u=parseInt(e.attr("data-hour")),m=parseInt(e.attr("data-min")),v=parseInt(e.attr("data-sec"));if(e.data("tcb_timer_done",!0),l){o=new Date;let t=TCB_Front.getCookie(e.attr("data-id"));if(t){t=t.split("-");const e=new Date(t[0],t[1]-1,t[2],t[3],t[4],t[5]);o.setTime(e)}else{o.setTime(a.getTime()+24*p*3600*1e3+3600*u*1e3+60*m*1e3+1e3*v);const t=o.getFullYear()+"-"+(o.getMonth()+1)+"-"+o.getDate()+"-"+o.getHours()+"-"+o.getMinutes()+"-"+o.getSeconds();let n=new Date("2034-01-01");if(!parseInt(c)){const t=new Date(o.getTime());n=t.setDate(o.getDate()+parseInt(e.attr("data-expday"))),n=t.setHours(o.getHours()+parseInt(e.attr("data-exphour"))),n=new Date(n)}TCB_Front.setCookie(e.attr("data-id"),t,{expires:n})}}function g(){setTimeout((function(){e.find(".tve_t_day .t-digits").css("min-width",e.find(".tve_t_sec .t-digits > span").outerWidth()*_+"px")}),10)}e.parents(".thrv_content_reveal").on("tve-content-revealed",g),e.parents(".tve_p_lb_content").on("tve.before-lightbox-open",g);const h=function(t,e){if(t.html()===e)return t;t.removeClass("next");const n=t.clone().removeClass("go-down").addClass("next").html(e);return t.before(n).next(".go-down").remove(),t.addClass("go-down"),setTimeout((function(){n.addClass("go-down")}),20),t},w=function(t,e,n){void 0===n&&(n=!1);let a=0;if(e<=99)h(t.find(".part-1").first(),e%10),h(t.find(".part-2").first(),Math.floor(e/10)),a=2;else for(;e;)a++,h(t.find(".part-"+a).first(),e%10),e=Math.floor(e/10);if(!1!==n&&a<n)for(let e=a+1;e<=n;e++)h(t.find(".part-"+e).first(),0)},C=function(){e.addClass("tve_cd_expired"),e.find(".t-digits span").html("0"),f&&(e.find(".tve_t_part").addClass("ct_finished"),e.find(".tve_t_text").html(f).fadeIn(200));const n=t.Event("tve.countdown-finished");e.trigger(n),setTimeout((function(){e.find(".t-digits span:not(.ct-d-placeholder)").hide()}),100)},T=function(){a=new Date,s=Math.floor((o.getTime()-a.getTime())/1e3),d=Math.floor(s/60),s%=60,i=Math.floor(d/60),d%=60,r=Math.floor(i/24),i%=24,r>99&&(_=r.toString().length)};!l&&a>=o?C():(T(),function(){const n=function(e,n){return t('<span class="part-p ct-d-placeholder">&nbsp;</span><span class="part-'+e+'">'+n+"</span>")};e.find(".tve_t_sec .t-digits").empty().append(n(2,Math.floor(s/10))).append(n(1,s%10)),e.find(".tve_t_min .t-digits").empty().append(n(2,Math.floor(d/10))).append(n(1,d%10)),e.find(".tve_t_hour .t-digits").empty().append(n(2,Math.floor(i/10))).append(n(1,i%10));const a=e.find(".tve_t_day .t-digits").empty();let o=r;for(let t=1;t<=_;t++)a.append(n(t,o%10)),o=Math.floor(o/10);a.css("min-width","")}(),e.addClass("init_done"),n=setInterval((function(){T(),w(e.find(".tve_t_sec .t-digits"),s),w(e.find(".tve_t_min .t-digits"),d),w(e.find(".tve_t_hour .t-digits"),i),w(e.find(".tve_t_day .t-digits"),r,_),r<=0&&i<=0&&d<=0&&s<=0&&(r=i=d=s=0,clearInterval(n),C())}),1e3)),l&&a>=o&&(clearInterval(n),C())};TCB_Front.setModuleLoadedStatus("timer",!0)})(ThriveGlobal.$j)}})[62694]();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
void 0===TCB_Front.js_modules.twitter&&TCB_Front.setModuleLoadedStatus("twitter",!1),(t=>{if(TCB_Front.isModuleLoaded("twitter"))return;t(window).on("tcb_after_dom_ready",(()=>{tve_frontend_options.is_editor_page||t(".thrv_tw_qs").each(((e,n)=>{const a=t(n);a.data("tve_front_tw_qs_done")||(o.init(a),a.data("tve_front_tw_qs_done",!0))}))}));const o={init(t){t.on("click",(function(){window.open(o.getUrl(t),"_blank")}))},getUrl(t){const o=t.attr("data-use_custom_url")&&t.attr("data-custom_url")?t.attr("data-custom_url"):window.location.href;let e=t.data("url")+"?text="+encodeURIComponent(t.find("p").text())+"&url="+encodeURIComponent(o);return t.data("via").length>0&&(e+="&via="+t.data("via")),e}};TCB_Front.setModuleLoadedStatus("twitter",!0)})(ThriveGlobal.$j);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
(e=>{const i={init(){},editorInit(){TVE.Editor_Page.selection_manager.init(TVE.inner_$(".notifications-editor-wrapper")),TVE.main.sidebar_extra.$(".sidebar-item:not(.click):not(.add-element)").remove(),TVE.main.sidebar_extra.$(".sidebar-item.add-element").hide()}};e(window).on("tcb_after_dom_ready",(()=>{TVE.main.on("tcb-ready",i.init.bind(i)),i.editorInit()}))})(jQuery);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,33 @@
( $ => {
/**
* Displays toast message from storage, it is used when the user is redirected after login
*/
if ( window.sessionStorage ) {
$( window ).on( 'tcb_after_dom_ready', () => {
const message = sessionStorage.getItem( 'tcb_toast_message' );
if ( message ) {
tcbToast( sessionStorage.getItem( 'tcb_toast_message' ), false );
sessionStorage.removeItem( 'tcb_toast_message' );
}
} );
}
/**
* Displays toast message
*
* @param {string} message - message to display
* @param {Boolean} error - whether the message is an error or not
* @param {Function} callback - callback function to be called after the message is closed
*/
function tcbToast( message, error, callback ) {
/* Also allow "message" objects */
if ( typeof message !== 'string' ) {
message = message.message || message.error || message.success;
}
if ( ! error ) {
error = false;
}
TCB_Front.notificationElement.toggle( message, error ? 'error' : 'success', callback );
}
} )( typeof ThriveGlobal === 'undefined' ? jQuery : ThriveGlobal.$j );

View File

@@ -0,0 +1,45 @@
compare = function ( country, arg ) {
arg = arg.toLowerCase();
return country.code.toLowerCase() == arg || country.name.toLowerCase() == arg || country.dial_code.toLowerCase() == arg
};
exports.getCountries = function () {
return require( './data/countries.json' );
};
exports.getCountry = function ( arg ) {
let countries = require( './data/countries.json' );
for ( let i = 0; i < countries.length; i ++ ) {
if ( compare( countries[ i ], arg ) ) {
return countries[ i ];
}
}
return null;
};
exports.getFilteredCountries = function ( args ) {
let countries = require( './data/countries.json' );
let filteredCountries = [];
for ( let arg of args ) {
for ( let i = 0; i < countries.length; i ++ ) {
if ( compare( countries[ i ], arg ) ) {
filteredCountries.push( countries[ i ] );
break;
}
}
}
return filteredCountries;
};
exports.getStates = function ( countryCode ) {
let states = require( './data/states.json' );
try {
return states[ countryCode ];
} catch ( error ) {
return 'Invalid country code';
}
};

View File

@@ -0,0 +1,916 @@
/*! dom-to-image 14-09-2020 cors requests go through //cors-anywhere.herokuapp.com/ */
( function ( global ) {
'use strict';
const util = newUtil();
const inliner = newInliner();
const fontFaces = newFontFaces();
const images = newImages();
// Default impl options
const defaultOptions = {
// Default is to fail on error, no placeholder
imagePlaceholder: undefined,
// Default cache bust is false, it will use the cache
cacheBust: false,
// Use (existing) authentication credentials for external URIs (CORS requests)
useCredentials: false
};
const domtoimage = {
toSvg: toSvg,
toPng: toPng,
toJpeg: toJpeg,
toBlob: toBlob,
toPixelData: toPixelData,
toCanvas: toCanvas,
impl: {
fontFaces,
images,
util,
inliner,
options: {}
}
};
if ( typeof window === "object" ) {
window.domtoimage = domtoimage;
}
if ( typeof exports === "object" && typeof module === "object" ) {
module.exports = domtoimage;
} else {
global.domtoimage = domtoimage;
}
/**
* @param {Node} node - The DOM Node object to render
* @param {Object} options - Rendering options
* @param {Function} options.filter - Should return true if passed node should be included in the output
* (excluding node means excluding it's children as well). Not called on the root node.
* @param {String} options.bgcolor - color for the background, any valid CSS color value.
* @param {Number} options.width - width to be applied to node before rendering.
* @param {Number} options.height - height to be applied to node before rendering.
* @param {Object} options.style - an object whose properties to be copied to node's style before rendering.
* @param {Number} options.quality - a Number between 0 and 1 indicating image quality (applicable to JPEG only),
defaults to 1.0.
* @param {Number} options.scale - a Number multiplier to scale up the canvas before rendering to reduce fuzzy images, defaults to 1.0.
* @param {String} options.imagePlaceholder - dataURL to use as a placeholder for failed images, default behaviour is to fail fast on images we can't fetch
* @param {Boolean} options.cacheBust - set to true to cache bust by appending the time to the request url
* @return {Promise} - A promise that is fulfilled with a SVG image data URL
* */
function toSvg( node, options ) {
options = options || {};
copyOptions( options );
return Promise.resolve( node )
.then( function ( node ) {
return cloneNode( node, options.filter, true );
} )
.then( embedFonts )
.then( inlineImages )
.then( applyOptions )
.then( function ( clone ) {
return makeSvgDataUri( clone,
options.width || util.width( node ),
options.height || util.height( node )
);
} );
function applyOptions( clone ) {
if ( options.bgcolor ) {
clone.style.backgroundColor = options.bgcolor;
}
if ( options.width ) {
clone.style.width = options.width + 'px';
}
if ( options.height ) {
clone.style.height = options.height + 'px';
}
if ( options.style ) {
Object.keys( options.style ).forEach( function ( property ) {
clone.style[ property ] = options.style[ property ];
} );
}
return clone;
}
}
/**
* @param {Node} node - The DOM Node object to render
* @param {Object} options - Rendering options, @see {@link toSvg}
* @return {Promise} - A promise that is fulfilled with a Uint8Array containing RGBA pixel data.
* */
function toPixelData( node, options ) {
return draw( node, options || {} )
.then( function ( canvas ) {
return canvas.getContext( '2d' ).getImageData(
0,
0,
util.width( node ),
util.height( node )
).data;
} );
}
/**
* @param {Node} node - The DOM Node object to render
* @param {Object} options - Rendering options, @see {@link toSvg}
* @return {Promise} - A promise that is fulfilled with a PNG image data URL
* */
function toPng( node, options ) {
return draw( node, options || {} )
.then( function ( canvas ) {
return canvas.toDataURL();
} );
}
/**
* @param {Node} node - The DOM Node object to render
* @param {Object} options - Rendering options, @see {@link toSvg}
* @return {Promise} - A promise that is fulfilled with a JPEG image data URL
* */
function toJpeg( node, options ) {
options = options || {};
return draw( node, options )
.then( function ( canvas ) {
return canvas.toDataURL( 'image/jpeg', options.quality || 1.0 );
} );
}
/**
* @param {Node} node - The DOM Node object to render
* @param {Object} options - Rendering options, @see {@link toSvg}
* @return {Promise} - A promise that is fulfilled with a PNG image blob
* */
function toBlob( node, options ) {
return draw( node, options || {} )
.then( util.canvasToBlob );
}
/**
* @param {Node} node - The DOM Node object to render
* @param {Object} options - Rendering options, @see {@link toSvg}
* @return {Promise} - A promise that is fulfilled with a canvas object
* */
function toCanvas( node, options ) {
return draw( node, options || {} );
}
function copyOptions( options ) {
// Copy options to impl options for use in impl
if ( typeof ( options.imagePlaceholder ) === 'undefined' ) {
domtoimage.impl.options.imagePlaceholder = defaultOptions.imagePlaceholder;
} else {
domtoimage.impl.options.imagePlaceholder = options.imagePlaceholder;
}
if ( typeof ( options.cacheBust ) === 'undefined' ) {
domtoimage.impl.options.cacheBust = defaultOptions.cacheBust;
} else {
domtoimage.impl.options.cacheBust = options.cacheBust;
}
if ( typeof ( options.useCredentials ) === 'undefined' ) {
domtoimage.impl.options.useCredentials = defaultOptions.useCredentials;
} else {
domtoimage.impl.options.useCredentials = options.useCredentials;
}
}
function draw( domNode, options ) {
return toSvg( domNode, options )
.then( util.makeImage )
.then( util.delay( 100 ) )
.then( function ( image ) {
var scale = typeof ( options.scale ) !== 'number' ? 1 : options.scale;
var canvas = newCanvas( domNode, scale );
var ctx = canvas.getContext( '2d' );
if ( image ) {
ctx.scale( scale, scale );
ctx.drawImage( image, 0, 0 );
}
return canvas;
} );
function newCanvas( domNode, scale ) {
var canvas = document.createElement( 'canvas' );
canvas.width = ( options.width || util.width( domNode ) ) * scale;
canvas.height = ( options.height || util.height( domNode ) ) * scale;
if ( options.bgcolor ) {
var ctx = canvas.getContext( '2d' );
ctx.fillStyle = options.bgcolor;
ctx.fillRect( 0, 0, canvas.width, canvas.height );
}
return canvas;
}
}
function cloneNode( node, filter, root ) {
if ( ! root && filter && ! filter( node ) ) {
return Promise.resolve();
}
return Promise.resolve( node )
.then( makeNodeCopy )
.then( function ( clone ) {
return cloneChildren( node, clone, filter );
} )
.then( function ( clone ) {
return processClone( node, clone );
} );
function makeNodeCopy( node ) {
if ( node instanceof HTMLCanvasElement ) {
return util.makeImage( node.toDataURL() );
}
return node.cloneNode( false );
}
function cloneChildren( original, clone, filter ) {
var children = original.childNodes;
if ( children.length === 0 ) {
return Promise.resolve( clone );
}
return cloneChildrenInOrder( clone, util.asArray( children ), filter )
.then( function () {
return clone;
} );
function cloneChildrenInOrder( parent, children, filter ) {
var done = Promise.resolve();
children.forEach( function ( child ) {
done = done
.then( function () {
return cloneNode( child, filter );
} )
.then( function ( childClone ) {
if ( childClone ) {
parent.appendChild( childClone );
}
} );
} );
return done;
}
}
function processClone( original, clone ) {
if ( [ 'Text', 'Comment' ].includes( clone.constructor.name ) ) {
return clone;
}
return Promise.resolve()
.then( cloneStyle )
.then( clonePseudoElements )
.then( copyUserInput )
.then( fixSvg )
.then( function () {
return clone;
} );
function cloneStyle() {
if ( original instanceof HTMLIFrameElement ) {
return;
}
copyStyle( window.getComputedStyle( original ), clone.style );
function copyFont( source, target ) {
target.font = source.font;
target.fontFamily = source.fontFamily;
target.fontFeatureSettings = source.fontFeatureSettings;
target.fontKerning = source.fontKerning;
target.fontSize = source.fontSize;
target.fontStretch = source.fontStretch;
target.fontStyle = source.fontStyle;
target.fontVariant = source.fontVariant;
target.fontVariantCaps = source.fontVariantCaps;
target.fontVariantEastAsian = source.fontVariantEastAsian;
target.fontVariantLigatures = source.fontVariantLigatures;
target.fontVariantNumeric = source.fontVariantNumeric;
target.fontVariationSettings = source.fontVariationSettings;
target.fontWeight = source.fontWeight;
}
function copyStyle( source, target ) {
if ( source.cssText ) {
target.cssText = source.cssText;
copyFont( source, target ); // here we re-assign the font props.
} else {
copyProperties( source, target );
}
function copyProperties( source, target ) {
util.asArray( source ).forEach( function ( name ) {
target.setProperty(
name,
source.getPropertyValue( name ),
source.getPropertyPriority( name )
);
} );
}
}
}
function clonePseudoElements() {
[ ':before', ':after' ].forEach( function ( element ) {
clonePseudoElement( element );
} );
function clonePseudoElement( element ) {
var style = window.getComputedStyle( original, element );
var content = style.getPropertyValue( 'content' );
if ( content === '' || content === 'none' ) {
return;
}
var className = util.uid();
var currentClass = clone.getAttribute( 'class' );
if ( currentClass ) {
clone.setAttribute( 'class', currentClass + ' ' + className );
}
var styleElement = document.createElement( 'style' );
styleElement.appendChild( formatPseudoElementStyle( className, element, style ) );
clone.appendChild( styleElement );
function formatPseudoElementStyle( className, element, style ) {
var selector = '.' + className + ':' + element;
var cssText = style.cssText ? formatCssText( style ) : formatCssProperties( style );
return document.createTextNode( selector + '{' + cssText + '}' );
function formatCssText( style ) {
var content = style.getPropertyValue( 'content' );
return style.cssText + ' content: ' + content + ';';
}
function formatCssProperties( style ) {
return util.asArray( style )
.map( formatProperty )
.join( '; ' ) + ';';
function formatProperty( name ) {
return name + ': ' +
style.getPropertyValue( name ) +
( style.getPropertyPriority( name ) ? ' !important' : '' );
}
}
}
}
}
function copyUserInput() {
if ( original instanceof HTMLTextAreaElement ) {
clone.innerHTML = original.value;
}
if ( original instanceof HTMLInputElement ) {
clone.setAttribute( "value", original.value );
}
}
function fixSvg() {
if ( ! ( clone instanceof SVGElement ) ) {
return;
}
clone.setAttribute( 'xmlns', 'http://www.w3.org/2000/svg' );
if ( ! ( clone instanceof SVGRectElement ) ) {
return;
}
[ 'width', 'height' ].forEach( function ( attribute ) {
var value = clone.getAttribute( attribute );
if ( ! value ) {
return;
}
clone.style.setProperty( attribute, value );
} );
}
}
}
function embedFonts( node ) {
return fontFaces.resolveAll()
.then( function ( cssText ) {
var styleNode = document.createElement( 'style' );
node.appendChild( styleNode );
styleNode.appendChild( document.createTextNode( cssText ) );
return node;
} );
}
function inlineImages( node ) {
return images.inlineAll( node )
.then( function () {
return node;
} );
}
function makeSvgDataUri( node, width, height ) {
return Promise.resolve( node )
.then( function ( node ) {
node.setAttribute( 'xmlns', 'http://www.w3.org/1999/xhtml' );
return new XMLSerializer().serializeToString( node );
} )
.then( util.escapeXhtml )
.then( function ( xhtml ) {
return '<foreignObject x="0" y="0" width="100%" height="100%">' + xhtml + '</foreignObject>';
} )
.then( function ( foreignObject ) {
return '<svg xmlns="http://www.w3.org/2000/svg" width="' + width + '" height="' + height + '">' +
foreignObject + '</svg>';
} )
.then( function ( svg ) {
return 'data:image/svg+xml;charset=utf-8,' + svg;
} );
}
function newUtil() {
return {
escape: escape,
parseExtension: parseExtension,
mimeType: mimeType,
dataAsUrl: dataAsUrl,
isDataUrl: isDataUrl,
canvasToBlob: canvasToBlob,
resolveUrl: resolveUrl,
getAndEncode: getAndEncode,
uid: uid(),
delay: delay,
asArray: asArray,
escapeXhtml: escapeXhtml,
makeImage: makeImage,
width: width,
height: height
};
function mimes() {
/*
* Only WOFF and EOT mime types for fonts are 'real'
* see http://www.iana.org/assignments/media-types/media-types.xhtml
*/
var WOFF = 'application/font-woff';
var JPEG = 'image/jpeg';
return {
'woff': WOFF,
'woff2': WOFF,
'ttf': 'application/font-truetype',
'eot': 'application/vnd.ms-fontobject',
'png': 'image/png',
'jpg': JPEG,
'jpeg': JPEG,
'gif': 'image/gif',
'tiff': 'image/tiff',
'svg': 'image/svg+xml'
};
}
function parseExtension( url ) {
var match = /\.([^\.\/]*?)(\?|$)/g.exec( url );
if ( match ) {
return match[ 1 ];
} else {
return '';
}
}
function mimeType( url ) {
var extension = parseExtension( url ).toLowerCase();
return mimes()[ extension ] || '';
}
function isDataUrl( url ) {
return url.search( /^(data:)/ ) !== - 1;
}
function toBlob( canvas ) {
return new Promise( function ( resolve ) {
var binaryString = window.atob( canvas.toDataURL().split( ',' )[ 1 ] );
var length = binaryString.length;
var binaryArray = new Uint8Array( length );
for ( var i = 0; i < length; i ++ ) {
binaryArray[ i ] = binaryString.charCodeAt( i );
}
resolve( new Blob( [ binaryArray ], {
type: 'image/png'
} ) );
} );
}
function canvasToBlob( canvas ) {
if ( canvas.toBlob ) {
return new Promise( function ( resolve ) {
canvas.toBlob( resolve );
} );
}
return toBlob( canvas );
}
function resolveUrl( url, baseUrl ) {
var doc = document.implementation.createHTMLDocument();
var base = doc.createElement( 'base' );
doc.head.appendChild( base );
var a = doc.createElement( 'a' );
doc.body.appendChild( a );
base.href = baseUrl;
a.href = url;
return a.href;
}
function uid() {
var index = 0;
return function () {
return 'u' + fourRandomChars() + index ++;
function fourRandomChars() {
/* see http://stackoverflow.com/a/6248722/2519373 */
return ( '0000' + ( Math.random() * Math.pow( 36, 4 ) << 0 ).toString( 36 ) ).slice( - 4 );
}
};
}
function makeImage( uri ) {
if ( uri === 'data:,' ) {
return Promise.resolve();
}
return new Promise( function ( resolve, reject ) {
var image = new Image();
if ( domtoimage.impl.options.useCredentials ) {
image.crossOrigin = 'use-credentials';
}
image.onload = function () {
resolve( image );
};
image.onerror = reject;
image.src = uri;
} );
}
function getAndEncode( url ) {
var TIMEOUT = 30000;
if ( domtoimage.impl.options.cacheBust ) {
// Cache bypass so we dont have CORS issues with cached images
// Source: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache
url += ( ( /\?/ ).test( url ) ? "&" : "?" ) + ( new Date() ).getTime();
}
return new Promise( function ( resolve ) {
if ( TVE.fetchedExternalLinks[ url ] ) {
resolve( TVE.fetchedExternalLinks[ url ] );
}
var placeholder;
if ( domtoimage.impl.options.imagePlaceholder ) {
var split = domtoimage.impl.options.imagePlaceholder.split( /,/ );
if ( split && split[ 1 ] ) {
placeholder = split[ 1 ];
}
}
/**
* dont fetch spotlight previews
*/
if ( url.includes( 'spotlightr' ) ) {
resolve( placeholder );
return;
}
var request = new XMLHttpRequest();
request.onreadystatechange = done;
request.ontimeout = timeout;
request.responseType = 'blob';
request.timeout = TIMEOUT;
if ( domtoimage.impl.options.useCredentials ) {
request.withCredentials = true;
}
let hostname = window.location.hostname;
//strip the www from the hostname if it exists because some links don't include it
if ( hostname.substring( 0, 4 ) === 'www.' ) {
hostname = hostname.substring( 4 );
}
if ( ! url.includes( hostname ) && ! url.includes( 'gravatar' ) && ! url.includes( 'fonts.gstatic' ) ) {
url = '//cors-anywhere.herokuapp.com/' + url;
}
request.open( 'GET', url, true );
request.send();
function done() {
if ( request.readyState !== 4 ) {
return;
}
if ( request.status !== 200 ) {
if ( placeholder ) {
resolve( placeholder );
} else {
fail( 'cannot fetch resource: ' + url + ', status: ' + request.status );
}
return;
}
var encoder = new FileReader();
encoder.onloadend = function () {
var content = encoder.result.split( /,/ )[ 1 ];
if ( TVE.fetchedExternalLinks ) {
TVE.fetchedExternalLinks[ url ] = content;
}
resolve( content );
};
encoder.readAsDataURL( request.response );
}
function timeout() {
if ( placeholder ) {
resolve( placeholder );
} else {
fail( 'timeout of ' + TIMEOUT + 'ms occured while fetching resource: ' + url );
}
}
function fail( message ) {
console.warn( message );
resolve( '' );
}
} );
}
function dataAsUrl( content, type ) {
return 'data:' + type + ';base64,' + content;
}
function escape( string ) {
return string.replace( /([.*+?^${}()|\[\]\/\\])/g, '\\$1' );
}
function delay( ms ) {
return function ( arg ) {
return new Promise( function ( resolve ) {
setTimeout( function () {
resolve( arg );
}, ms );
} );
};
}
function asArray( arrayLike ) {
var array = [];
var length = arrayLike.length;
for ( var i = 0; i < length; i ++ ) {
array.push( arrayLike[ i ] );
}
return array;
}
function escapeXhtml( string ) {
return string.replace( /%/g, "%25" ).replace( /#/g, '%23' ).replace( /\n/g, '%0A' );
}
function width( node ) {
var leftBorder = px( node, 'border-left-width' );
var rightBorder = px( node, 'border-right-width' );
return node.scrollWidth + leftBorder + rightBorder;
}
function height( node ) {
var topBorder = px( node, 'border-top-width' );
var bottomBorder = px( node, 'border-bottom-width' );
return node.scrollHeight + topBorder + bottomBorder;
}
function px( node, styleProperty ) {
var value = window.getComputedStyle( node ).getPropertyValue( styleProperty );
return parseFloat( value.replace( 'px', '' ) );
}
}
function newInliner() {
var URL_REGEX = /url\(['"]?([^'"]+?)['"]?\)/g;
return {
inlineAll: inlineAll,
shouldProcess: shouldProcess,
impl: {
readUrls: readUrls,
inline: inline
}
};
function shouldProcess( string ) {
return string.search( URL_REGEX ) !== - 1;
}
function readUrls( string ) {
var result = [];
var match;
while ( ( match = URL_REGEX.exec( string ) ) !== null ) {
result.push( match[ 1 ] );
}
return result.filter( function ( url ) {
return ! util.isDataUrl( url );
} );
}
function inline( string, url, baseUrl, get ) {
return Promise.resolve( url )
.then( function ( url ) {
return baseUrl ? util.resolveUrl( url, baseUrl ) : url;
} )
.then( get || util.getAndEncode )
.then( function ( data ) {
return util.dataAsUrl( data, util.mimeType( url ) );
} )
.then( function ( dataUrl ) {
return string.replace( urlAsRegex( url ), '$1' + dataUrl + '$3' );
} );
function urlAsRegex( url ) {
return new RegExp( '(url\\([\'"]?)(' + util.escape( url ) + ')([\'"]?\\))', 'g' );
}
}
function inlineAll( string, baseUrl, get ) {
if ( nothingToInline() ) {
return Promise.resolve( string );
}
return Promise.resolve( string )
.then( readUrls )
.then( function ( urls ) {
var done = Promise.resolve( string );
urls.forEach( function ( url ) {
done = done.then( function ( string ) {
return inline( string, url, baseUrl, get );
} );
} );
return done;
} );
function nothingToInline() {
return ! shouldProcess( string );
}
}
}
function newFontFaces() {
return {
resolveAll: resolveAll,
impl: {
readAll: readAll
}
};
function resolveAll() {
return readAll( document )
.then( function ( webFonts ) {
return Promise.all(
webFonts.map( function ( webFont ) {
return webFont.resolve();
} )
);
} )
.then( function ( cssStrings ) {
return cssStrings.join( '\n' );
} );
}
function readAll() {
return Promise.resolve( util.asArray( document.styleSheets ) )
.then( getCssRules )
.then( selectWebFontRules )
.then( function ( rules ) {
return rules.map( newWebFont );
} );
function selectWebFontRules( cssRules ) {
return cssRules
.filter( function ( rule ) {
return rule.type === CSSRule.FONT_FACE_RULE;
} )
.filter( function ( rule ) {
return inliner.shouldProcess( rule.style.getPropertyValue( 'src' ) );
} );
}
function getCssRules( styleSheets ) {
var cssRules = [];
styleSheets.forEach( function ( sheet ) {
if ( Object.getPrototypeOf( sheet ).hasOwnProperty( 'cssRules' ) ) {
try {
util.asArray( sheet.cssRules || [] ).forEach( cssRules.push.bind( cssRules ) );
} catch ( e ) {
if ( ! sheet.href.includes( 'google' ) ) {
console.log( 'Error while reading CSS rules from ' + sheet.href, e.toString() );
}
}
}
} );
return cssRules;
}
function newWebFont( webFontRule ) {
return {
resolve: function resolve() {
var baseUrl = ( webFontRule.parentStyleSheet || {} ).href;
return inliner.inlineAll( webFontRule.cssText, baseUrl );
},
src: function () {
return webFontRule.style.getPropertyValue( 'src' );
}
};
}
}
}
function newImages() {
return {
inlineAll: inlineAll,
impl: {
newImage: newImage
}
};
function newImage( element ) {
return {
inline: inline
};
function inline( get ) {
if ( util.isDataUrl( element.src ) ) {
return Promise.resolve();
}
return Promise.resolve( element.src )
.then( get || util.getAndEncode )
.then( function ( data ) {
return util.dataAsUrl( data, util.mimeType( element.src ) );
} )
.then( function ( dataUrl ) {
return new Promise( function ( resolve, reject ) {
element.onload = resolve;
// for any image with invalid src(such as <img src />), just ignore it
element.onerror = resolve;
element.src = dataUrl;
} );
} );
}
}
function inlineAll( node ) {
if ( ! ( node instanceof Element ) ) {
return Promise.resolve( node );
}
return inlineBackground( node )
.then( function () {
if ( node instanceof HTMLImageElement ) {
return newImage( node ).inline();
} else {
return Promise.all(
util.asArray( node.childNodes ).map( function ( child ) {
return inlineAll( child );
} )
);
}
} );
function inlineBackground( node ) {
var background = node.style.getPropertyValue( 'background' );
if ( ! background ) {
return Promise.resolve( node );
}
return inliner.inlineAll( background )
.then( function ( inlined ) {
node.style.setProperty(
'background',
inlined,
node.style.getPropertyPriority( 'background' )
);
} )
.then( function () {
return node;
} );
}
}
}
} )( this );

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
/*! dom-to-image 14-09-2020 cors requests go through //cors-anywhere.herokuapp.com/ */

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,90 @@
//! moment.js locale configuration
//! locale : German [de]
//! author : lluchs : https://github.com/lluchs
//! author: Menelion Elensúle: https://github.com/Oire
//! author : Mikolaj Dadela : https://github.com/mik01aj
;( function ( global, factory ) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory( require( '../moment' ) ) :
typeof define === 'function' && define.amd ? define( [ '../moment' ], factory ) :
factory( global.moment )
}( this, ( function ( moment ) {
'use strict';
//! moment.js locale configuration
function processRelativeTime( number, withoutSuffix, key, isFuture ) {
var format = {
m: [ 'eine Minute', 'einer Minute' ],
h: [ 'eine Stunde', 'einer Stunde' ],
d: [ 'ein Tag', 'einem Tag' ],
dd: [ number + ' Tage', number + ' Tagen' ],
w: [ 'eine Woche', 'einer Woche' ],
M: [ 'ein Monat', 'einem Monat' ],
MM: [ number + ' Monate', number + ' Monaten' ],
y: [ 'ein Jahr', 'einem Jahr' ],
yy: [ number + ' Jahre', number + ' Jahren' ],
};
return withoutSuffix ? format[ key ][ 0 ] : format[ key ][ 1 ];
}
var de = moment.defineLocale( 'de', {
months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split(
'_'
),
monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split(
'_'
),
monthsParseExact: true,
weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split(
'_'
),
weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split( '_' ),
weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split( '_' ),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D. MMMM YYYY',
LLL: 'D. MMMM YYYY HH:mm',
LLLL: 'dddd, D. MMMM YYYY HH:mm',
},
calendar: {
sameDay: '[heute um] LT [Uhr]',
sameElse: 'L',
nextDay: '[morgen um] LT [Uhr]',
nextWeek: 'dddd [um] LT [Uhr]',
lastDay: '[gestern um] LT [Uhr]',
lastWeek: '[letzten] dddd [um] LT [Uhr]',
},
relativeTime: {
future: 'in %s',
past: 'vor %s',
s: 'ein paar Sekunden',
ss: '%d Sekunden',
m: processRelativeTime,
mm: '%d Minuten',
h: processRelativeTime,
hh: '%d Stunden',
d: processRelativeTime,
dd: processRelativeTime,
w: processRelativeTime,
ww: '%d Wochen',
M: processRelativeTime,
MM: processRelativeTime,
y: processRelativeTime,
yy: processRelativeTime,
},
dayOfMonthOrdinalParse: /\d{1,2}\./,
ordinal: '%d.',
week: {
dow: 1, // Monday is the first day of the week.
doy: 4, // The week that contains Jan 4th is the first week of the year.
},
} );
return de;
} ) ) );

View File

@@ -0,0 +1,114 @@
//! moment.js locale configuration
//! locale : French [fr]
//! author : John Fischer : https://github.com/jfroffice
;( function ( global, factory ) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory( require( '../moment' ) ) :
typeof define === 'function' && define.amd ? define( [ '../moment' ], factory ) :
factory( global.moment )
}( this, ( function ( moment ) {
'use strict';
//! moment.js locale configuration
var monthsStrictRegex = /^(janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
monthsShortStrictRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?)/i,
monthsRegex = /(janv\.?|févr\.?|mars|avr\.?|mai|juin|juil\.?|août|sept\.?|oct\.?|nov\.?|déc\.?|janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
monthsParse = [
/^janv/i,
/^févr/i,
/^mars/i,
/^avr/i,
/^mai/i,
/^juin/i,
/^juil/i,
/^août/i,
/^sept/i,
/^oct/i,
/^nov/i,
/^déc/i,
];
var fr = moment.defineLocale( 'fr', {
months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split(
'_'
),
monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split(
'_'
),
monthsRegex: monthsRegex,
monthsShortRegex: monthsRegex,
monthsStrictRegex: monthsStrictRegex,
monthsShortStrictRegex: monthsShortStrictRegex,
monthsParse: monthsParse,
longMonthsParse: monthsParse,
shortMonthsParse: monthsParse,
weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split( '_' ),
weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split( '_' ),
weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split( '_' ),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd D MMMM YYYY HH:mm',
},
calendar: {
sameDay: '[Aujourdhui à] LT',
nextDay: '[Demain à] LT',
nextWeek: 'dddd [à] LT',
lastDay: '[Hier à] LT',
lastWeek: 'dddd [dernier à] LT',
sameElse: 'L',
},
relativeTime: {
future: 'dans %s',
past: 'il y a %s',
s: 'quelques secondes',
ss: '%d secondes',
m: 'une minute',
mm: '%d minutes',
h: 'une heure',
hh: '%d heures',
d: 'un jour',
dd: '%d jours',
w: 'une semaine',
ww: '%d semaines',
M: 'un mois',
MM: '%d mois',
y: 'un an',
yy: '%d ans',
},
dayOfMonthOrdinalParse: /\d{1,2}(er|)/,
ordinal: function ( number, period ) {
switch ( period ) {
// block for masculine words below.
// See https://github.com/moment/moment/issues/3375
case 'D':
return number + ( number === 1 ? 'er' : '' );
// Words with masculine grammatical gender: mois, trimestre, jour
default:
case 'M':
case 'Q':
case 'DDD':
case 'd':
return number + ( number === 1 ? 'er' : 'e' );
// Words with feminine grammatical gender: semaine
case 'w':
case 'W':
return number + ( number === 1 ? 're' : 'e' );
}
},
week: {
dow: 1, // Monday is the first day of the week.
doy: 4, // The week that contains Jan 4th is the first week of the year.
},
} );
return fr;
} ) ) );

View File

@@ -0,0 +1,68 @@
//! moment.js locale configuration
//! locale : Portuguese (Brazil) [pt-br]
//! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira
;(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory(require('../moment')) :
typeof define === 'function' && define.amd ? define(['../moment'], factory) :
factory(global.moment)
}(this, (function (moment) { 'use strict';
//! moment.js locale configuration
var ptBr = moment.defineLocale('pt-br', {
months: 'janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro'.split(
'_'
),
monthsShort: 'jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez'.split('_'),
weekdays: 'domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado'.split(
'_'
),
weekdaysShort: 'dom_seg_ter_qua_qui_sex_sáb'.split('_'),
weekdaysMin: 'do_2ª_3ª_4ª_5ª_6ª_sá'.split('_'),
weekdaysParseExact: true,
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD/MM/YYYY',
LL: 'D [de] MMMM [de] YYYY',
LLL: 'D [de] MMMM [de] YYYY [às] HH:mm',
LLLL: 'dddd, D [de] MMMM [de] YYYY [às] HH:mm',
},
calendar: {
sameDay: '[Hoje às] LT',
nextDay: '[Amanhã às] LT',
nextWeek: 'dddd [às] LT',
lastDay: '[Ontem às] LT',
lastWeek: function () {
return this.day() === 0 || this.day() === 6
? '[Último] dddd [às] LT' // Saturday + Sunday
: '[Última] dddd [às] LT'; // Monday - Friday
},
sameElse: 'L',
},
relativeTime: {
future: 'em %s',
past: 'há %s',
s: 'poucos segundos',
ss: '%d segundos',
m: 'um minuto',
mm: '%d minutos',
h: 'uma hora',
hh: '%d horas',
d: 'um dia',
dd: '%d dias',
M: 'um mês',
MM: '%d meses',
y: 'um ano',
yy: '%d anos',
},
dayOfMonthOrdinalParse: /\d{1,2}º/,
ordinal: '%dº',
invalidDate: 'Data inválida',
});
return ptBr;
})));

View File

@@ -0,0 +1,118 @@
//! moment.js locale configuration
//! locale : Turkish [tr]
//! authors : Erhan Gundogan : https://github.com/erhangundogan,
//! Burak Yiğit Kaya: https://github.com/BYK
;( function ( global, factory ) {
typeof exports === 'object' && typeof module !== 'undefined'
&& typeof require === 'function' ? factory( require( '../moment' ) ) :
typeof define === 'function' && define.amd ? define( [ '../moment' ], factory ) :
factory( global.moment )
}( this, ( function ( moment ) {
'use strict';
//! moment.js locale configuration
var suffixes = {
1: "'inci",
5: "'inci",
8: "'inci",
70: "'inci",
80: "'inci",
2: "'nci",
7: "'nci",
20: "'nci",
50: "'nci",
3: "'üncü",
4: "'üncü",
100: "'üncü",
6: "'ncı",
9: "'uncu",
10: "'uncu",
30: "'uncu",
60: "'ıncı",
90: "'ıncı",
};
var tr = moment.defineLocale( 'tr', {
months: 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split(
'_'
),
monthsShort: 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split( '_' ),
weekdays: 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split(
'_'
),
weekdaysShort: 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split( '_' ),
weekdaysMin: 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split( '_' ),
meridiem: function ( hours, minutes, isLower ) {
if ( hours < 12 ) {
return isLower ? 'öö' : 'ÖÖ';
} else {
return isLower ? 'ös' : 'ÖS';
}
},
meridiemParse: /öö|ÖÖ|ös|ÖS/,
isPM: function ( input ) {
return input === 'ös' || input === 'ÖS';
},
longDateFormat: {
LT: 'HH:mm',
LTS: 'HH:mm:ss',
L: 'DD.MM.YYYY',
LL: 'D MMMM YYYY',
LLL: 'D MMMM YYYY HH:mm',
LLLL: 'dddd, D MMMM YYYY HH:mm',
},
calendar: {
sameDay: '[bugün saat] LT',
nextDay: '[yarın saat] LT',
nextWeek: '[gelecek] dddd [saat] LT',
lastDay: '[dün] LT',
lastWeek: '[geçen] dddd [saat] LT',
sameElse: 'L',
},
relativeTime: {
future: '%s sonra',
past: '%s önce',
s: 'birkaç saniye',
ss: '%d saniye',
m: 'bir dakika',
mm: '%d dakika',
h: 'bir saat',
hh: '%d saat',
d: 'bir gün',
dd: '%d gün',
w: 'bir hafta',
ww: '%d hafta',
M: 'bir ay',
MM: '%d ay',
y: 'bir yıl',
yy: '%d yıl',
},
ordinal: function ( number, period ) {
switch ( period ) {
case 'd':
case 'D':
case 'Do':
case 'DD':
return number;
default:
if ( number === 0 ) {
// special case for zero
return number + "'ıncı";
}
var a = number % 10,
b = ( number % 100 ) - a,
c = number >= 100 ? 100 : null;
return number + ( suffixes[ a ] || suffixes[ b ] || suffixes[ c ] );
}
},
week: {
dow: 1, // Monday is the first day of the week.
doy: 7, // The week that contains Jan 7th is the first week of the year.
},
} );
return tr;
} ) ) );

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,77 @@
const {applyDefaultRules, initializeNotificationEditor, _updateMainFrameVars, updatePreviewLink, updateNotificationSidebarOptions} = require( './utils' );
module.exports = {
'tcb-ready': () => {
const $notificationWrapper = TVE.inner_$( TVE.identifier( 'notification' ) ),
$notificationContent = $notificationWrapper.find( '.notifications-content' );
$notificationWrapper.addClass( 'thrv_wrapper' );
$notificationContent.removeClass( 'thrv_wrapper' );
/* add the dataset of the default template when nothing else is set */
if ( typeof $notificationWrapper.attr( 'data-ct' ) === 'undefined' ) {
$notificationWrapper.attr( {
'data-ct': 'notification-0',
'data-ct-name': 'Default notification'
} );
}
const displayedState = $notificationWrapper.attr( 'data-state' );
/* Focus the notification element, open its Main Controls and update them */
TVE.Editor_Page.focus_element( $notificationWrapper );
initializeNotificationEditor( displayedState );
_updateMainFrameVars( displayedState );
updatePreviewLink();
/* Only display a set of allowed elements that can be added inside the Notification element */
const allowedElements = [ 'text', 'image', 'button', 'columns', 'contentbox', 'divider', 'icon', 'notification_message' ];
const hiddenElements = Object.keys( TVE.Elements ).filter( element => ! allowedElements.includes( element ) );
TVE.main.sidebar_toggle_elements( hiddenElements, false );
if ( TVE.stylesheet.cssRules.length === 0 ) {
applyDefaultRules( true )
}
},
'tcb.element.focus': $element => {
const isNotification = $element.is( TVE.identifier( 'notification' ) );
if ( isNotification ) {
/* Disable Margin Control for the Notification Element */
TVE.Components.layout.disable_extra_controls( [ 'top', 'right', 'bottom', 'left' ].map( side => 'margin-' + side ) );
/* Update available sidebar options for the Notification Element */
updateNotificationSidebarOptions( TVE.$body.hasClass( 'edit-mode-active' ) );
}
TVE.Components.layout.$el.find( '.tve-control[data-prop="width"] .tve-input-um[data-value="%"]' ).toggle( ! isNotification );
TVE.main.$( '.tve-active-element' ).addClass( 'no-states' );
},
'tcb.after-insert': $element => {
if ( $element.is( '.thrv-notification_message' ) ) {
$element.addClass( 'tcb-selector-no_save tcb-selector-no_clone' )
}
TVE.main.$( '.tve-active-element' ).addClass( 'no-states' );
},
/**
* @param $element
*/
'tcb_after_cloud_template': $element => {
if ( $element.is( TVE.identifier( 'notification' ) ) ) {
$element.addClass( 'notification-edit-mode' );
updatePreviewLink( $element.attr( 'data-state' ) );
initializeNotificationEditor( $element.attr( 'data-state' ) );
if ( $element.attr( 'data-ct' ) === 'notification--1' ) {
applyDefaultRules( false );
}
}
},
};

View File

@@ -0,0 +1,4 @@
module.exports = {
Notification: require( './notification' ),
NotificationMessage: require( './notification-message' ),
};

View File

@@ -0,0 +1,33 @@
const typography = require( '../../main/views/components/typography' );
module.exports = typography.extend( {
getTargetElement() {
return TVE.ActiveElement.add( TVE.ActiveElement.find( '.tve_editable' ) ).not( '.tcb-el-group' );
},
controls_init( controls ) {
typography.prototype.controls_init.apply( this, Array.from( arguments ) );
controls.LineSpacing.getElement = function () {
return TVE.ActiveElement;
};
controls.LineSpacing.readValues = function () {
const $element = this.getElement();
return {
top: $element.css( 'padding-top' ),
bottom: $element.css( 'padding-bottom' )
};
};
controls.LineSpacing.writeStyle = function ( css ) {
this.applyElementCss( css, TVE.ActiveElement, '', '' );
};
TVE.add_action( 'tcb.typography.notification_message.clear_formatting', () => {
TVE.ActiveElement[ 0 ].style.setProperty( 'padding-top', '0px', 'important' );
TVE.ActiveElement[ 0 ].style.setProperty( 'padding-bottom', '0px', 'important' );
} );
},
lineSpacingControl() {
return require( '../../main/views/controls/text/line-spacing' );
},
} );

View File

@@ -0,0 +1,338 @@
module.exports = TVE.Views.Base.component.extend( {
after_init() {
/* backwards compatibility stuff */
TVE.Editor_Page.editor.find( '.animated' ).removeClass( 'animated' );
},
controls_init( controls ) {
let startAnimation, displayAnimation, endAnimation;
/* Display Position Control */
controls.DisplayPosition.input = function ( $element, dom ) {
const positionAttribute = dom.getAttribute( 'data-value' ),
verticalPosition = positionAttribute.split( '-' )[ 0 ];
let horizontalPosition = positionAttribute.split( '-' )[ 1 ];
if ( TVE.main.device === 'mobile' ) {
horizontalPosition = $element.attr( 'data-position' ).split( '-' )[ 1 ];
}
$element.attr( 'data-position', verticalPosition.concat( '-', horizontalPosition ) );
updateVerticalSpacing( $element );
updateHorizontalSpacing( $element );
};
controls.DisplayPosition.update = function ( $element ) {
let positionAttribute = $element.attr( 'data-position' );
this.$( '.items-9' ).removeClass( 'mobile' );
this.$( '.active' ).removeClass( 'active' );
if ( TVE.main.device === 'mobile' ) {
positionAttribute = positionAttribute.split( '-' )[ 0 ].concat( '-center' );
this.$( '.items-9' ).addClass( 'mobile' );
}
this.$( `[data-value=${positionAttribute}]` ).addClass( 'active' );
};
/* Vertical Spacing Control */
controls.VerticalSpacing.input = function ( $element, dom ) {
/* Only allow numerical values */
if ( isNaN( dom.value ) ) {
controls.VerticalSpacing.setValue( 0 );
}
const verticalPosition = $element.attr( 'data-position' ).split( '-' )[ 0 ];
$element.head_css( {[ verticalPosition ]: dom.value + 'px'}, false, `${TVE.identifier( 'notification' )}[data-position*="${verticalPosition}"]`, true, '' );
};
controls.VerticalSpacing.update = function ( $element ) {
updateVerticalSpacing( $element );
};
/* Horizontal Spacing Control */
controls.HorizontalSpacing.input = function ( $element, dom ) {
/* Only allow numerical values */
if ( isNaN( dom.value ) ) {
controls.VerticalSpacing.setValue( 0 );
}
const horizontalPosition = $element.attr( 'data-position' ).split( '-' )[ 1 ];
$element.head_css( {[ horizontalPosition ]: dom.value + 'px'}, false, `${TVE.identifier( 'notification' )}[data-position*="${horizontalPosition}"]`, true, '' );
};
controls.HorizontalSpacing.update = function ( $element ) {
updateHorizontalSpacing( $element );
};
/* Animation Direction Control */
controls.AnimationDirection.input = function ( $element, dom ) {
$element.attr( 'data-animation', dom.value );
$element.toggleClass( 'tcb-animated', dom.value !== 'none' );
animateNotification( $element );
};
controls.AnimationDirection.update = function ( $element ) {
this.setValue( $element.attr( 'data-animation' ) );
};
/* Animation Time Control */
controls.AnimationTime.input = function ( $element, dom ) {
$element.attr( 'data-timer', dom.value * 1000 );
};
controls.AnimationTime.change = function ( $element ) {
animateNotification( $element, true );
};
controls.AnimationTime.update = function ( $element ) {
let timerValue = $element.attr( 'data-timer' );
if ( timerValue < 0 ) {
$element.attr( 'data-timer', 3000 );
} else if ( timerValue > 10 ) {
timerValue = timerValue / 1000;
}
this.setValue( timerValue );
};
controls.VerticalPosition.applyStyles = function ( $element, dom ) {
const state = $element.attr( 'data-state' );
$element.find( `.notifications-content.notification-${state}` ).css( 'justify-content', dom.getAttribute( 'data-value' ) );
};
controls.VerticalPosition.update = function ( $element ) {
const state = $element.attr( 'data-state' );
let verticalPosition = $element.find( `.notifications-content.notification-${state}` ).css( 'justify-content' );
verticalPosition = verticalPosition === 'normal' ? 'flex-start' : verticalPosition;
this.setActive( verticalPosition );
};
controls.MaximumWidth.input = function ( $element, dom ) {
const state = $element.attr( 'data-state' );
this.applyElementCss( {'max-width': dom.value + 'px'}, $element.find( `.notifications-content.notification-${state}` ), '', '' )
};
controls.MaximumWidth.update = function ( $element ) {
const state = $element.attr( 'data-state' );
let maxWidth = $element.find( `.notifications-content.notification-${state}` ).css( 'max-width' ).split( 'px' )[ 0 ];
const width = $element.find( `.notifications-content.notification-${state}` ).css( 'width' ).split( 'px' )[ 0 ];
if ( maxWidth === 'none' ) {
maxWidth = width;
$element.find( `.notifications-content.notification-${state}` ).head_css( {'max-width': width + 'px'} );
}
this.setValue( maxWidth );
};
controls.MinimumHeight.input = function ( $element, dom ) {
const state = $element.attr( 'data-state' );
this.applyElementCss( {'min-height': dom.value + 'px'}, $element.find( `.notifications-content.notification-${state}` ), '', '' )
};
controls.MinimumHeight.update = function ( $element ) {
const state = $element.attr( 'data-state' );
this.setValue( $element.find( `.notifications-content.notification-${state}` ).css( 'min-height' ).split( 'px' )[ 0 ] );
};
/**
* Animate the Notification in the editor (slide-out is only triggered by changing the AnimationTime value)
*
* @param $element
* @param animationCanStop
*/
function animateNotification( $element, animationCanStop = false ) {
clearTimeouts();
setAnimation( $element );
const timer = $element.attr( 'data-timer' ),
animation = $element.attr( 'data-animation' );
$element.hide();
$element.addClass( 'editor-preview' );
/* Only allow animations to be stopped when they are triggered from the AnimationTime */
if ( animationCanStop ) {
TVE.inner_$( 'html, body' ).on( 'mousedown.notification', () => {
stopNotificationAnimation( $element );
} );
TVE.$( 'html, body' ).on( 'mousedown.notification_main', () => {
stopNotificationAnimation( $element );
} );
}
startAnimation = setTimeout( () => {
/* Slide in */
$element.show();
$element.removeAttr( 'data-animation' );
if ( animationCanStop ) {
/* Slide out */
displayAnimation = setTimeout( () => {
if ( animation !== 'none' ) {
setAnimation( $element );
} else {
$element.hide();
}
stopNotificationAnimation( $element );
}, timer );
} else {
setTimeout( () => {
$element.removeClass( 'editor-preview' );
setAnimation( $element );
}, 1000 )
}
}, 300 );
}
/**
* End the current Notification animation
*
* @param $element
*/
function stopNotificationAnimation( $element ) {
clearTimeouts();
endAnimation = setTimeout( () => {
$element.removeClass( 'editor-preview' );
if ( typeof $element.attr( 'data-animation' ) === 'undefined' ) {
setAnimation( $element );
}
$element.show();
TVE.inner_$( 'html, body' ).off( 'mousedown.notification' );
TVE.inner_$( 'html, body' ).off( 'mousedown.notification_main' );
}, 500 );
}
/**
* Stop previous animations by clearing the timeouts
*/
function clearTimeouts() {
/* Stop previous animations by clearing the timeouts */
[ startAnimation, displayAnimation, endAnimation ].forEach( timeout => {
if ( typeof timeout !== 'undefined' ) {
clearTimeout( timeout );
}
} );
}
/**
* Set animation on the Notification Element
*
* @param $element
*/
function setAnimation( $element ) {
const animation = controls.AnimationDirection.$el.find( '.tve-select' )[ 0 ].value;
if ( animation !== 'none' ) {
$element.attr( 'data-animation', animation );
}
}
/**
* @param $element
*/
function updateVerticalSpacing( $element ) {
const position = $element.attr( 'data-position' ).split( '-' ),
verticalPosition = position[ 0 ];
/* Vertical Spacing Control Update */
if ( [ 'top', 'bottom' ].includes( verticalPosition ) ) {
controls.VerticalSpacing.$el.show();
controls.VerticalSpacing.$el.find( '.input-label' ).text( `${verticalPosition} spacing` );
controls.VerticalSpacing.setValue( $element.css( `${verticalPosition}` ).split( 'px' )[ 0 ] );
} else {
controls.VerticalSpacing.hide();
}
}
/**
* @param $element
*/
function updateHorizontalSpacing( $element ) {
const position = $element.attr( 'data-position' ).split( '-' ),
horizontalPosition = position[ 1 ];
/* Horizontal Spacing Control Update */
if ( ( [ 'left', 'right' ].includes( horizontalPosition ) ) && ( TVE.main.device !== 'mobile' ) ) {
controls.HorizontalSpacing.$el.show();
controls.HorizontalSpacing.setValue( $element.css( `${horizontalPosition}` ).split( 'px' )[ 0 ] );
} else {
controls.HorizontalSpacing.hide();
}
}
},
editNotifications() {
const $notificationWrapper = TVE.inner_$( TVE.identifier( 'notification' ) ),
currentState = $notificationWrapper.attr( 'data-state' ),
utils = require( '../utils' );
TVE.main.sidebar_extra.$( '.sidebar-item.add-element' ).show();
$notificationWrapper.find( '.tve-prevent-content-edit' ).removeClass( 'tve-prevent-content-edit' );
/* Update available sidebar options for the Notification Element */
utils.updateNotificationSidebarOptions( true );
TVE.main.EditMode.enter( $notificationWrapper, {
show_default_message: true,
can_insert_elements: true,
view_label: 'Editing Notification',
element_selectable: true,
restore_state: false,
states: [
{
label: 'Success',
value: 'success',
default: currentState === 'success',
},
{
label: 'Warning',
value: 'warning',
default: currentState === 'warning',
},
{
label: 'Error',
value: 'error',
default: currentState === 'error',
}
],
callbacks: {
exit: () => {
/* Restore editor settings */
const state = $notificationWrapper.attr( 'data-state' );
$notificationWrapper.addClass( 'tve_no_icons' );
TVE.main.sidebar_extra.$( '.sidebar-item.add-element' ).hide();
TVE.inner_$( `.notifications-content.notification-${state}` ).children().addClass( 'tve-prevent-content-edit' );
/* Set focus on the notification element */
TVE.Editor_Page.focus_element( $notificationWrapper );
/* Update available sidebar options for the Notification Element */
utils.updateNotificationSidebarOptions( false );
/* Add corresponding link for the preview button */
utils.updatePreviewLink( state );
},
state_change: state => {
$notificationWrapper.attr( 'data-state', state );
TVE.Components.notification.controls.VerticalPosition.update( $notificationWrapper );
TVE.Editor_Page.focus_element( $notificationWrapper );
utils._updateMainFrameVars( state );
}
}
} );
},
} );

View File

@@ -0,0 +1,144 @@
module.exports = {
/**
* Include the custom components
*
* @param TVE
* @return {*}
*/
'tcb.includes': TVE => {
TVE.Views.Components = {...TVE.Views.Components, ...( require( './components/_includes' ) )};
return TVE;
},
/**
* Remove classes and attributes that are not necessary
*
* @param $content
* @return {*}
*/
'tcb_filter_html_before_save': $content => {
const $notificationWrapper = $content.find( TVE.identifier( 'notification' ) );
if ( $notificationWrapper.attr( 'data-timer' ) < 0 ) {
$notificationWrapper.attr( 'data-timer', 3000 );
}
$content.find( '.notification-edit-mode' ).removeClass( 'notification-edit-mode' );
$content.find( '.tve_no_icons' ).removeClass( 'tve_no_drag tve_no_icons' );
return $content;
},
/**
* Update the selected notification template
*
* @param data
* @return {*}
*/
'tcb_save_post_data_after': data => {
if ( TVE.CONST.post.post_type === 'tve_notifications' ) {
TVE.$.ajax( {
url: ajaxurl,
type: 'post',
data: {
action: 'notification_update_template',
post_id: data.post_id,
}
} );
}
return data;
},
/**
* Do not allow elements to be dropped elsewhere than inside the Notification element
*
* @param elements
* @return {*}
*/
'only_inner_drop': elements => {
elements += ',.notifications-content';
return elements;
},
/* Do not allow elements to be inserted outside the notification element */
'tve.drag.position.insert': ( dir, $newElement, $target ) => {
if ( $target.is( '.notifications-content' ) ) {
dir = 'mid';
}
return dir;
},
/* Insert new elements inside the corresponding notification */
'tve.insert.near.target': $target => {
if ( $target.is( TVE.identifier( 'notification' ) ) ) {
$target = $target.find( `.notifications-content.notification-${$target.attr( 'data-state' )}` );
}
return $target;
},
/* Allow custom refocus after exiting the Edit Mode */
'tve.edit.mode.refocus': () => {
return false;
},
/* Add prefix in order to successfully override the default style */
'tcb_head_css_prefix': ( prefix, element ) => {
/* Check if element is part of the notification & is not one of the following components */
if ( element.parents( '.notifications-content-wrapper' ).length > 0 && ! element.is( '.notifications-content,.thrv-notification_message,.notifications-content-wrapper' ) ) {
const state = TVE.FLAGS.notification_state || TVE.inner_$( TVE.identifier( 'notification' ) ).attr( 'data-state' );
prefix = `.notification-${state} `;
}
return prefix;
},
/**
* Add the local default notification template to the list of cloud templates
*
* @param data
* @return {*}
*/
'tcb.cloud_templates.notification': data => {
const defaultNotificationTemplate = {
/* set the ID as negative to mark this as a local template */
id: '-1',
name: 'Default Notifications',
local: true,
thumb: `${TVE.CONST.plugin_url}editor/css/images/notification_template_default.jpg`,
thumb_size: {w: 655, h: 326},
v: 1
};
data.unshift( defaultNotificationTemplate );
return data;
},
/**
* Instead of rendering the default notification template from the cloud, render it from localize
*
* @param tpl
* @param id
* @return {{v: number, head_css: string, name: string, custom_css: string, id: number, type: string, content: *}|boolean}
*/
'tcb.cloud_template.notification': ( tpl, id ) => {
/* local templates have negative IDs */
if ( id < 0 ) {
return {
content: `${TVE.tpl( 'elements/notification' )()}`,
custom_css: '',
head_css: '',
id: '-1',
name: 'Default Notifications',
type: 'notification',
v: 1
};
}
return false;
},
};

View File

@@ -0,0 +1,12 @@
( $ => {
$( window ).on( 'tcb.register-hooks', () => {
_.each( require( './filters' ), ( callback, tag ) => {
TVE.add_filter( tag, callback );
} );
/* register all actions */
_.each( require( './actions' ), ( callback, tag ) => {
TVE.add_action( tag, callback );
} );
} );
} )( jQuery );

View File

@@ -0,0 +1,18 @@
( $ => {
const Notifications = {
init() {
},
editorInit() {
TVE.Editor_Page.selection_manager.init( TVE.inner_$( '.notifications-editor-wrapper' ) );
TVE.main.sidebar_extra.$( '.sidebar-item:not(.click):not(.add-element)' ).remove();
TVE.main.sidebar_extra.$( '.sidebar-item.add-element' ).hide();
},
};
$( window ).on( 'tcb_after_dom_ready', () => {
/* Initialize the typography settings */
TVE.main.on( 'tcb-ready', Notifications.init.bind( Notifications ) );
Notifications.editorInit();
} );
} )( jQuery );

View File

@@ -0,0 +1,159 @@
module.exports = {
applyDefaultRules( shouldSave ) {
const
iconSize = 27,
mobileIconSize = 24,
defaultRules = {
[ TVE.main.responsive.desktop.media ]: {
'.notifications-content': {
'box-shadow': 'rgba(0, 0, 0, 25%) 0px 4px 9px 0px',
'margin': 0,
'padding': 0,
'width': '501px',
'min-height': '20px',
'border-radius': '2px',
'border': '2px solid',
'border-color': 'var(--notification-color)',
'background-color': 'rgb(255, 255, 255)',
},
'.thrv-columns': {
'margin': '0!important'
},
'.tcb-flex-row': {
'padding': '0!important',
'margin-left': '0px',
},
'.tcb-flex-col': {
'padding-left': '0px'
},
'.thrv_icon': {
'border': 'none',
'border-radius': 0,
'width': `${iconSize}px`,
'height': `${iconSize}px`,
'--tve-icon-size': `${iconSize}px`,
'font-size': `${iconSize}px`,
'margin': '0!important',
'color': 'rgb(255, 255, 255)',
'--tcb-local-color-icon': 'var(--notification-color)',
'--tcb-local-color-var': 'var(--notification-color)',
'background-image': 'linear-gradient(var(--tcb-local-color-icon), var(--tcb-local-color-icon))',
'padding': '16px !important',
},
'.thrv-notification_message': {
'margin': 0,
'text-align': 'center',
'font-size': '16px',
'color': '#191f28'
},
'.tcb-flex-col:first-child': {
'max-width': '12%'
}
},
[ TVE.main.responsive.mobile.media ]: {
'.notifications-content': {
'width': 'unset',
'min-width': '360px',
'background-color': 'var(--notification-color) !important',
'border': 'none',
'border-radius': 0,
},
'.thrv-notification_message': {
'min-width': 'auto',
'color': 'rgb(255, 255, 255)',
'text-align': 'left',
},
'.thrv_icon': {
'width': `${mobileIconSize}px`,
'height': `${mobileIconSize}px`,
'--tve-icon-size': `${mobileIconSize}px`,
'font-size': `${mobileIconSize}px`,
},
'.thrv-columns': {
'width': '65%',
'margin-left': 'auto !important',
'margin-right': 'auto !important',
'float': 'none',
},
'.tcb-flex-col:first-child': {
'max-width': '27%'
}
}
};
/* when we open the template for the first time, we apply the default styles */
[ 'success', 'warning', 'error' ].forEach( state => {
TVE.FLAGS.notification_state = state;
for ( const media in defaultRules ) {
for ( const selector in defaultRules[ media ] ) {
TVE.inner_$( selector ).head_css( defaultRules[ media ][ selector ], media )
}
}
} );
delete TVE.FLAGS.notification_state;
/* and silently save so we can have the changes in preview */
if ( shouldSave ) {
TVE.Editor_Page.save( true, null, {}, true );
}
},
initializeNotificationEditor( displayedState ) {
/* Do not allow the content to be edited when it is not in edit mode */
TVE.inner_$( `.notifications-content.notification-${displayedState}` ).children().addClass( 'tve-prevent-content-edit' );
/* Initialize selectors */
tve_notification.elements.forEach( elementKey => {
const selector = TVE.identifier( elementKey );
TVE.inner_$( selector ).each( ( index, element ) => {
if ( elementKey === 'notification_message' ) {
/* we want to drag the notification message */
element.classList.add( 'tcb-selector-no_save', 'tcb-selector-no_clone' )
} else {
element.classList.add( 'tve_no_icons' );
}
} )
} );
},
/**
* Add current notification color to the main frame for the controls to properly display the current color
*
* @param state
* @private
*/
_updateMainFrameVars( state ) {
const color = {
'success': 'rgb(74, 178, 93)',
'warning': 'rgb(243, 156, 15)',
'error': 'rgb(214, 54, 56)'
};
TVE.changeCssVariableValue( '--notification-color', color[ state ] );
},
/**
* Add corresponding link for the preview button
*
* @param state
*/
updatePreviewLink: ( state = 'success' ) => {
const $previewButton = TVE.$( '.preview-content' );
let previewLink = $previewButton.attr( 'href' );
if ( previewLink.includes( 'notification-state' ) ) {
previewLink = previewLink.split( '&notification-state=' )[ 0 ];
}
$previewButton.attr( 'href', previewLink.concat( `&notification-state=${state}` ) );
},
updateNotificationSidebarOptions( isEditMode ) {
const hiddenComponents = '#tve-layout-component,#tve-background-component,#tve-borders-component,#tve-shadow-component,#tve-responsive-component,#tve-styles-templates-component';
TVE.main.EditMode.$componentPanel.find( hiddenComponents ).toggle( isEditMode );
TVE.main.EditMode.$componentPanel.find( '#tve-notification-component .non-edit-mode-controls' ).toggle( ! isEditMode );
TVE.main.EditMode.$componentPanel.find( '#tve-notification-component .edit-mode-controls' ).toggle( isEditMode );
TVE.main.EditMode.$componentPanel.find( '#tve-cloud-templates-component' ).toggle( ! isEditMode );
},
};