| Server IP : 65.109.86.83 / Your IP : 216.73.217.84 Web Server : nginx/1.14.1 System : Linux libra 4.18.0-553.51.1.el8_10.x86_64 #1 SMP Wed Apr 30 20:24:04 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.31 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/html/wp-content/plugins/thrive-leads/admin/js-min/ |
Upload File : |
window.ThriveLeads=window.ThriveLeads||{},ThriveLeads.models=ThriveLeads.models||{},ThriveLeads.collections=ThriveLeads.collections||{},function(){function e(e){return null!=e}Backbone.emulateHTTP=!0,Backbone.ssajax=function(){var e=Array.prototype.slice.call(arguments,0);return void 0===e[0].data&&(e[0].data={}),e[0].data.security="security",e[0].type="POST",e[0].data.action="thrive_leads_backend_ajax",-1===e[0].url.indexOf("route=")&&(e[0].data.route=ThriveLeads.router.routes[Backbone.history.fragment]),delete ThriveLeads.ajax_no_route,Backbone.$.ajax.apply(Backbone.$,e)},ThriveLeads.collections.Variations=Backbone.Collection.extend({determineControl:function(){this.each((function(e,t){e.set("is_control",0===t)}))}}),ThriveLeads.models.Group=Backbone.Model.extend({idAttribute:"ID",defaults:function(){return{ID:"",post_title:"",impressions:"0",conversions:"0",conversion_rate:"N/A",order:0,active_tests:new ThriveLeads.collections.Tests,completed_tests:new ThriveLeads.collections.Tests,form_types:_.extend(ThriveLeads.const.default_form_types),details_expanded:!1,display_on_mobile:"No",display_status:"No",has_display_settings:0}},validate:function(e){var t={},i=!0;if(e.post_title.length<=0&&(t.post_title=ThriveLeads.const.translations.GroupNameRequired,i=!1),i&&TVE_Dash.isScriptOrStyle(e.post_title)&&(t.post_title=ThriveLeads.const.translations.TitleScript,i=!1),!i)return t},initialize:function(){var e=new ThriveLeads.collections.FormTypes;e.reset(this.get("form_types")),e.each(this.setFormTypeParent,this),this.set("form_types",e),this.listenTo(this,"change:ID",this.idChanged)},idChanged:function(){this.get("form_types").each(this.setFormTypeParent,this)},setFormTypeParent:function(e){e.set("post_parent",this.get("ID"))},url:function(){return ThriveLeads.ajaxurl("action=thrive_leads_backend_ajax&route=groupAPI&security="+ThriveLeadsConst.security+"&ID="+this.get("ID"))},ableForTest:function(){var e=0;return this.get("form_types").each((function(t){!t.get("active_test").get("id")&&t.get("variations").length>=1&&e++})),e>=2},decreaseStatistics:function(e){var t=this.get("impressions")-parseInt(e.get("impressions")),i=this.get("conversions")-parseInt(e.get("conversions"));this.set({impressions:t,conversions:i,conversion_rate:ThriveLeads.conversion_rate(t,i)}),e instanceof ThriveLeads.models.FormVariation?this.get("form_types").findWhere({ID:parseInt(e.get("post_parent"))}).decreaseStatistics(e):e instanceof ThriveLeads.models.FormType&&this.get("form_types").findWhere({ID:parseInt(e.get("ID"))}).set({impressions:0,conversions:0,conversion_rate:ThriveLeads.conversion_rate(0,0)})},ajaxGetEmptyVariations:function(){return jQuery.ajax({url:this.url()+"&get_empty_variations=1",dataType:"json"})}}),ThriveLeads.collections.Groups=Backbone.Collection.extend({model:ThriveLeads.models.Group,comparator:function(e){return e.get("order")},getTotalVariations:function(){var e=0;return this.each((function(t){t.get("form_types").each((function(t){e+=t.get("variations").length}))})),e}}),ThriveLeads.objects.groups=new ThriveLeads.collections.Groups,ThriveLeads.models.TestItem=Backbone.Model.extend({idAttribute:"id",defaults:function(){return{id:"",name:"",form_type:"",impressions:0,conversions:0,conversion_rate:0,percentage_improvement:0,beat_original:0,trigger:""}},url:function(){return ThriveLeads.ajaxurl("action=thrive_leads_backend_ajax&route=testItemAPI&security="+ThriveLeadsConst.security+"&id="+this.get("id"))},getConversionRate:function(){var e=parseInt(this.get("unique_impressions")),t=parseInt(this.get("conversions")),i=0;return!isNaN(e)&&!isNaN(t)&&e>0&&(i=t/e*100),(i=ThriveLeads.roundNumber(i,3)).toFixed(2)},getPercentageImprovementColor:function(){var e=parseFloat(this.get("percentage_improvement"));return isNaN(e)?"":e<0?ThriveLeads.const.CHART_RED:e>0?ThriveLeads.const.CHART_GREEN:""}}),ThriveLeads.models.TestChartModel=ThriveLeads.models.Group.extend({idAttribute:"ID",defaults:function(){return{interval:"day",chart_data:[],chart_title:"",chart_x_axis:[],chart_y_axis:""}},url:function(){return ThriveLeads.ajaxurl("action=thrive_leads_backend_ajax&route=chartAPI&chartType=testChart&security="+ThriveLeadsConst.security+"&ID="+this.get("ID")+"&interval="+this.get("interval"))}}),ThriveLeads.collections.TestItems=Backbone.Collection.extend({model:ThriveLeads.models.TestItem,getTotals:function(){return{impressions:this.getTotalImpressions(),conversions:this.getTotalConversions(),conversions_rate:this.getConversionRate()}},getTotalImpressions:function(){var e=0;return _.each(this.models,(function(t){e+=parseInt(t.get("unique_impressions"))})),e},getTotalConversions:function(){var e=0;return _.each(this.models,(function(t){e+=parseInt(t.get("conversions"))})),e},getConversionRate:function(){var e=this.getTotalImpressions(),t=this.getTotalConversions(),i=0;return!isNaN(e)&&!isNaN(t)&&e>0&&(i=t/e*100),i.toFixed(2)},getCandleStickData:function(){var e=[];_.each(this.models,(function(t){var i=parseInt(t.get("conversion_rate")),s=parseInt(t.get("unique_impressions"));if(isNaN(i)||isNaN(s)||0===s)e.push([0,0]);else{var n=Math.round(100*Math.sqrt(i*(100-i)/s))/100;e.push([i-n,i+n])}}));var t=ThriveLeads.const.CHART_RED,i=ThriveLeads.const.CHART_GREY,s=ThriveLeads.const.CHART_GREEN,n=e[0],o=[],a=[];return _.each(e,(function(e){var r=[],c=[];e[0]<n[0]?(c.push(t),r.push(e[0]),e[1]<n[0]?r.push(e[1]):e[1]<n[1]?(c.push(i),r.push(n[0]),r.push(e[1])):n[1]<e[1]&&(c.push(i),c.push(s),r.push(n[0]),r.push(n[1]),r.push(e[1]))):e[0]<n[1]?(c.push(i),r.push(e[0]),e[1]<=n[1]?r.push(e[1]):n[1]<e[1]&&(c.push(s),r.push(n[1]),r.push(e[1]))):n[1]<e[1]&&(c.push(s),r.push(e[0]),r.push(e[1])),o.push(r),a.push(c)})),{chartData:o,chartColors:a}},getHighestRateItem:function(){var e,t=0;return this.each((function(i){parseFloat(i.getConversionRate())>=t&&(e=i.get("id"),t=parseFloat(i.getConversionRate()))})),0===t?void 0:e}}),ThriveLeads.models.FormTypeBase=Backbone.Model.extend({ajaxGetEmptyVariations:function(){return jQuery.ajax({url:this.url()+"&get_empty_variations=1",dataType:"json"})},resetStatistics:function(e){var t=_.extend({type:"post",dataType:"json",url:ThriveLeads.ajaxurl("action=thrive_leads_backend_ajax&route=formTypeAPI&security="+ThriveLeadsConst.security+"&ID="+this.get("ID")+"&custom_action=reset_statistics")},e);return jQuery.ajax(t)},getPHPCode:function(){return this.get("ID")?"<?php if (function_exists('tve_leads_form_display')) { tve_leads_form_display("+this.get("post_parent")+", "+this.get("ID")+"); } ?>":""}}),ThriveLeads.models.FormType=ThriveLeads.models.FormTypeBase.extend({idAttribute:"ID",defaults:function(){return{ID:"",tve_form_type:"",post_parent:0,post_title:"",impressions:"0",conversions:"0",conversion_rate:"N/A",variations:new ThriveLeads.collections.FormVariations,variations_archived:new ThriveLeads.collections.FormVariations,parent:{},active_test:null,completed_tests:new ThriveLeads.collections.Tests,has_frequency_settings:!1,has_position_settings:!1,has_animation_settings:!1,display_on_mobile:0,display_status:0}},parse:function(e,t){return e&&e.variations&&(this.get("variations")instanceof ThriveLeads.collections.FormVariations?(this.get("variations").reset(e.variations),e.variations=this.get("variations")):e.variations=new ThriveLeads.collections.FormVariations(e.variations)),e&&e.variations_archived&&(this.get("variations_archived")instanceof ThriveLeads.collections.FormVariations?(this.get("variations_archived").reset(e.variations_archived),e.variations_archived=this.get("variations_archived")):e.variations_archived=new ThriveLeads.collections.FormVariations(e.variations_archived)),e&&e.completed_tests&&(this.get("completed_tests")instanceof ThriveLeads.collections.Tests?(this.get("completed_tests").reset(e.completed_tests),e.completed_tests=this.get("completed_tests")):e.completed_tests=new ThriveLeads.collections.Tests(e.completed_tests)),e},hasValidVariation:function(){var e=this.get("variations"),t=!1;return e&&e.length&&e.each((function(e){e.get("is_control")&&e.get("content")&&(t=!0)})),t},url:function(){return ThriveLeads.ajaxurl("action=thrive_leads_backend_ajax&route=formTypeAPI&security="+ThriveLeadsConst.security+"&ID="+this.get("ID"))},initialize:function(){if(!(this.get("variations")instanceof Backbone.Collection)){var e=new ThriveLeads.collections.FormVariations(this.get("variations"));this.set("variations",e)}!this.get("active_test")||this.get("active_test")instanceof Backbone.Model?this.set("active_test",new ThriveLeads.models.Test):this.set("active_test",new ThriveLeads.models.Test(this.get("active_test")))},setVariationParent:function(e){e.set("parent",this)},decreaseStatistics:function(e){var t=this.get("impressions")-parseInt(e.get("impressions")),i=this.get("conversions")-parseInt(e.get("conversions"));this.set({impressions:t,conversions:i,conversion_rate:ThriveLeads.conversion_rate(t,i)})}}),ThriveLeads.collections.FormTypes=Backbone.Collection.extend({model:ThriveLeads.models.FormType}),ThriveLeads.models.FormVariationBase=Backbone.Model.extend({defaults:function(){return{key:"",post_parent:0,post_title:"",post_status:"publish",trigger:"page_load",trigger_nice_name:"",trigger_config:{},impressions:"0",conversions:"0",conversion_rate:"N/A",parent:{},hide_buttons:!1,is_control:!0,has_frequency_settings:!1,has_position_settings:!1,has_animation_settings:!1,display_frequency:"0",display_position:"",display_animation:"",display_frequency_nice_name:"",display_position_nice_name:"",display_animation_nice_name:""}},idAttribute:"key",url:function(){return ThriveLeads.ajaxurl("action=thrive_leads_backend_ajax&route=formVariationAPI&security="+ThriveLeadsConst.security+"&key="+this.get("key")+"&form_type="+this.get("post_parent"))},resetStatistics:function(e){var t=_.extend({type:"post",dataType:"json",url:ThriveLeads.ajaxurl("action=thrive_leads_backend_ajax&route=formVariationAPI&security="+ThriveLeadsConst.security+"&key="+this.get("key")+"&form_type="+this.get("post_parent")+"&custom_action=reset_statistics")},e);return jQuery.ajax(t)}}),ThriveLeads.models.FormVariation=ThriveLeads.models.FormVariationBase.extend({initialize:function(){}}),ThriveLeads.collections.FormVariations=ThriveLeads.collections.Variations.extend({model:ThriveLeads.models.FormVariation}),ThriveLeads.models.Test=Backbone.Model.extend({idAttribute:"id",defaults:function(){return{id:"",item_ids:[],auto_win_min_conversions:100,auto_win_min_duration:14,auto_win_chance_original:95,test_type:ThriveLeads.const.variation_test_type}},validate:function(e){var t=!0,i={};if(e.title.length<=0&&(t=!1,i.title=ThriveLeads.const.translations.TestTitleRequired),t&&TVE_Dash.isScriptOrStyle(e.title)&&(i.post_title=ThriveLeads.const.translations.TitleScript,t=!1),e.auto_win_enabled&&(e.auto_win_min_conversions.length<=0?(t=!1,i.auto_win_min_conversions=ThriveLeads.const.translations.AutoWinMinConversionsRequired):(isNaN(e.auto_win_min_conversions)||e.auto_win_min_conversions<0||e.auto_win_min_conversions!=parseInt(e.auto_win_min_conversions,10))&&(t=!1,i.auto_win_min_conversions=ThriveLeads.const.translations.PositiveIntegerNumber),e.auto_win_min_duration.length<=0?(t=!1,i.auto_win_min_duration=ThriveLeads.const.translations.AutoWinMinDurationRequired):(isNaN(e.auto_win_min_duration)||e.auto_win_min_duration<0||e.auto_win_min_duration!=parseInt(e.auto_win_min_duration,10))&&(t=!1,i.auto_win_min_duration=ThriveLeads.const.translations.PositiveIntegerNumber),e.auto_win_chance_original.length<=0?(t=!1,i.auto_win_chance_original=ThriveLeads.const.translations.AutoWinChanceOriginalRequired):(isNaN(e.auto_win_chance_original)||e.auto_win_chance_original>100||e.auto_win_chance_original<0)&&(t=!1,i.auto_win_chance_original=ThriveLeads.const.translations.PositivePercentNumber)),e.form_types&&e.form_types.length<2&&(t=!1,i.form_types=ThriveLeads.const.translations.MinimumTwoFormTypesAreRequired),!t)return i},setAsGroupType:function(){this.set("test_type",ThriveLeads.const.group_test_type)},setAsShortcodeType:function(){this.set("test_type",ThriveLeads.const.shortcode_test_type)},setAsTwoStepLightboxType:function(){this.set("test_type",ThriveLeads.const.two_step_lightbox_test_type)},setAsVariationType:function(){this.set("test_type",ThriveLeads.const.variation_test_type)},url:function(){return ThriveLeads.ajaxurl("action=thrive_leads_backend_ajax&security="+ThriveLeadsConst.security+"&route=testAPI&id="+this.get("id"))},isRunning:function(){return this.get("status")===ThriveLeads.const.test_status.running}}),ThriveLeads.collections.Tests=Backbone.Collection.extend({model:ThriveLeads.models.Test}),ThriveLeads.models.Template=Backbone.Model.extend({defaults:{name:"",description:"",hangers:""},initialize:function(e,t){this.set("hangers",new Backbone.Collection([e.show_group_options,e.hide_group_options]))}}),ThriveLeads.collections.Templates=Backbone.Collection.extend({model:ThriveLeads.models.Template}),ThriveLeads.models.TemplateList=Backbone.Model.extend({defaults:{template_groups:[]},initialize:function(e){var t=[];_.each(e,(function(e,i){var s=new ThriveLeads.collections.Templates(e);s.group_name=i,s.size()&&(s.group_tag=s.at(0).get("tag")),t.push(s)})),this.set("template_groups",t)},get_template:function(e){var t=null;return _.every(this.get("template_groups"),(function(i){return!(t=i.findWhere(e))})),t},name_exists:function(e,t){var i=!1;return _.each(this.get("template_groups"),(function(s){return s.group_tag!=t||(s.findWhere({name:e})?(i=!0,!1):void 0)})),i},size:function(){return this.get("template_groups").length}}),ThriveLeads.models.Filter=Backbone.Model.extend({defaults:{cssClass:"",identifier:"",label:""}}),ThriveLeads.collections.Filters=Backbone.Collection.extend({model:ThriveLeads.models.Filter}),ThriveLeads.models.Option=Backbone.Model.extend({defaults:{label:"",isChecked:!1,id:"",type:null},validate:function(e){if(!e.label.length)return alert("Empty links are not accepted !"),"just return something"},toggle:function(){this.set("isChecked",!this.get("isChecked"))},check:function(){this.set("isChecked",!0)},uncheck:function(){this.set("isChecked",!1)}}),ThriveLeads.collections.Options=Backbone.Collection.extend({model:ThriveLeads.models.Option,countCheckedOptions:function(){var e=0;return this.each((function(t){e+=t.get("isChecked")?1:0})),e}}),ThriveLeads.models.Tab=Backbone.Model.extend({defaults:function(){return{identifier:"",label:"",isActive:!1,actions:[],filters:[]}},initialize:function(e){this.set("options",new ThriveLeads.collections.Options(e.options)),this.set("filters",new ThriveLeads.collections.Filters(e.filters))},getTabIdentifierFromTabId:function(e){return e.replace("tve_leads_tab_","")},getTabIdFromIdentifier:function(){return"tve_leads_"+(this.get("exclusion")?"hide":"show")+"_tab_"+this.get("identifier")},getTabContentIdentifier:function(){return"tve_leads_tab_content_"+this.get("identifier")},countCheckedOptions:function(){if("others"===this.get("identifier")){var e=0;return this.get("options").each((function(t){("direct_url"===t.get("type")||t.get("isChecked"))&&e++})),e}return this.get("options").countCheckedOptions()},uncheckAll:function(){var e=[],t=this.get("options");t.each((function(t){t.set("isChecked",!1),"direct_url"===t.get("type")&&e.push(t)})),_.forEach(e,(function(e){t.remove(e)}))}}),ThriveLeads.collections.Tabs=Backbone.Collection.extend({model:ThriveLeads.models.Tab}),ThriveLeads.models.Hanger=Backbone.Model.extend({defaults:function(){return{identifier:"",tabs:""}},initialize:function(e,t){this.set("tabs",new ThriveLeads.collections.Tabs(e.tabs))},countCheckedOptions:function(){var e=0;return this.get("tabs").each((function(t){e+=t.countCheckedOptions()})),e},uncheckAll:function(){this.get("tabs").each((function(e){e.uncheckAll()}))},getDataForSave:function(){var e={tabs:[]};return this.get("tabs").each((function(t,i){e.tabs[i]=[],t.get("options").each((function(t){(t.get("isChecked")||"direct_url"==t.get("type"))&&e.tabs[i].push(t.get("id"))}))})),e}}),ThriveLeads.collections.Hangers=Backbone.Collection.extend({model:ThriveLeads.models.Hanger,uncheckAll:function(){this.each((function(e){e.uncheckAll()}))}}),ThriveLeads.models.Shortcode=ThriveLeads.models.FormTypeBase.extend({idAttribute:"ID",defaults:function(){return{ID:"",post_title:"",post_parent:"0",impressions:"0",conversions:"0",conversion_rate:"N/A",variations:new ThriveLeads.collections.ShortcodeVariations,active_test:null,content_locking:0,shortcode_code:"",variations_archived:new ThriveLeads.collections.FormVariations,completed_tests:new ThriveLeads.collections.Tests}},url:function(){return ThriveLeads.ajaxurl("action=thrive_leads_backend_ajax&route=shortcodeAPI&security="+ThriveLeadsConst.security+"&ID="+this.get("ID"))},validate:function(e){var t={},i=!0;if(e.post_title.length<=0&&(t.post_title=ThriveLeads.const.translations.ShortcodeNameRequired,i=!1),i&&TVE_Dash.isScriptOrStyle(e.post_title)&&(t.post_title=ThriveLeads.const.translations.TitleScript,i=!1),!i)return t},initialize:function(){this.get("active_test")&&this.set("active_test",new ThriveLeads.models.Test(this.get("active_test"))),!this.get("variations")||this.get("variations")instanceof ThriveLeads.collections.ShortcodeVariations||this.set("variations",new ThriveLeads.collections.ShortcodeVariations(this.get("variations")))},setFormTypeParent:function(e){e.set("post_parent",this.get("ID"))},parse:function(e,t){return e&&e.variations&&(e.variations=new ThriveLeads.collections.ShortcodeVariations(e.variations)),e&&e.variations_archived&&(e.variations_archived=new ThriveLeads.collections.ShortcodeVariations(e.variations_archived)),e&&e.completed_tests&&(this.get("completed_tests")instanceof ThriveLeads.collections.Tests?(this.get("completed_tests").reset(e.completed_tests),e.completed_tests=this.get("completed_tests")):e.completed_tests=new ThriveLeads.collections.Tests(e.completed_tests)),e},getCode:function(){if(this.get("shortcode_code").length)return this.get("shortcode_code");var e=1==this.get("content_locking")?"[thrive_lead_lock id='"+this.get("ID")+"']Hidden Content[/thrive_lead_lock]":"[thrive_leads id='"+this.get("ID")+"']";return this.set("shortcode_code",e),this.get("shortcode_code")},decreaseStatistics:function(e){var t=this.get("impressions")-parseInt(e.get("impressions")),i=this.get("conversions")-parseInt(e.get("conversions"));this.set({impressions:t,conversions:i,conversion_rate:ThriveLeads.conversion_rate(t,i)})}}),ThriveLeads.collections.Shortcode=Backbone.Collection.extend({model:ThriveLeads.models.Shortcode,getTotalVariations:function(){var e=0;return this.each((function(t){e+=t.get("variations").length})),e}}),ThriveLeads.models.ShortcodeVariation=ThriveLeads.models.FormVariationBase.extend({initialize:function(){}}),ThriveLeads.collections.ShortcodeVariations=ThriveLeads.collections.Variations.extend({model:ThriveLeads.models.ShortcodeVariation}),ThriveLeads.models.TwoStepLightbox=ThriveLeads.models.FormTypeBase.extend({idAttribute:"ID",defaults:function(){return{ID:"",post_title:"",impressions:"0",conversions:"0",conversion_rate:"N/A",variations:new ThriveLeads.collections.TwoStepLightboxVariations,variations_archived:new ThriveLeads.collections.FormVariations,active_test:null,completed_tests:new ThriveLeads.collections.Tests}},url:function(){return ThriveLeads.ajaxurl("action=thrive_leads_backend_ajax&route=twoStepLightBoxAPI&security="+ThriveLeadsConst.security+"&ID="+this.get("ID"))},initialize:function(){this.get("active_test")&&this.set("active_test",new ThriveLeads.models.Test(this.get("active_test"))),!this.get("variations")||this.get("variations")instanceof ThriveLeads.collections.TwoStepLightboxVariations||this.set("variations",new ThriveLeads.collections.TwoStepLightboxVariations(this.get("variations")))},validate:function(e){var t={},i=!0;if(e.post_title.length<=0&&(t.post_title=ThriveLeads.const.translations.TwoStepLightboxNameRequired,i=!1),i&&TVE_Dash.isScriptOrStyle(e.post_title)&&(t.post_title=ThriveLeads.const.translations.TitleScript,i=!1),!i)return t},setFormTypeParent:function(e){e.set("post_parent",this.get("ID"))},parse:function(e,t){return e&&e.variations&&(e.variations=new ThriveLeads.collections.TwoStepLightboxVariations(e.variations)),e&&e.variations_archived&&(e.variations_archived=new ThriveLeads.collections.TwoStepLightboxVariations(e.variations_archived)),e&&e.completed_tests&&(this.get("completed_tests")instanceof ThriveLeads.collections.Tests?(this.get("completed_tests").reset(e.completed_tests),e.completed_tests=this.get("completed_tests")):e.completed_tests=new ThriveLeads.collections.Tests(e.completed_tests)),e},getCode:function(){return"[thrive_2step id='"+this.get("ID")+"']Trigger goes here[/thrive_2step]"},decreaseStatistics:function(e){var t=this.get("impressions")-parseInt(e.get("impressions")),i=this.get("conversions")-parseInt(e.get("conversions"));this.set({impressions:t,conversions:i,conversion_rate:ThriveLeads.conversion_rate(t,i)})}}),ThriveLeads.collections.TwoStepLightbox=Backbone.Collection.extend({model:ThriveLeads.models.TwoStepLightbox,getTotalVariations:function(){var e=0;return this.each((function(t){e+=t.get("variations").length})),e}}),ThriveLeads.models.TwoStepLightboxVariation=ThriveLeads.models.FormVariationBase.extend({defaults:function(){return{key:"",post_parent:0,post_title:"",post_status:"publish",trigger:"click",trigger_nice_name:"",trigger_config:{},impressions:"0",conversions:"0",conversion_rate:"N/A",parent:{},hide_buttons:!1,is_control:!0,has_frequency_settings:!1,has_position_settings:!1,has_animation_settings:!1,display_frequency:"0",display_position:"",display_animation:"",display_frequency_nice_name:"",display_position_nice_name:"",display_animation_nice_name:""}},initialize:function(){}}),ThriveLeads.collections.TwoStepLightboxVariations=ThriveLeads.collections.Variations.extend({model:ThriveLeads.models.TwoStepLightboxVariation}),ThriveLeads.models.OneClickSignup=ThriveLeads.models.FormTypeBase.extend({idAttribute:"ID",defaults:function(){return{ID:"",post_title:"",impressions:"0",conversions:"0",conversion_rate:"N/A",active_test:null,post_link:"",redirect_url:{},api_connections:{},signups:"0"}},url:function(){return ThriveLeads.ajaxurl("action=thrive_leads_backend_ajax&route=oneClickSignupAPI&security="+ThriveLeadsConst.security+"&ID="+this.get("ID"))},validate:function(e){var t={},i=!0;if(e.post_title.length<=0&&(t.post_title=ThriveLeads.const.translations.OneClickSignupNameRequired,i=!1),i&&TVE_Dash.isScriptOrStyle(e.post_title)&&(t.post_title=ThriveLeads.const.translations.TitleScript,i=!1),!i)return t},setFormTypeParent:function(e){e.set("post_parent",this.get("ID"))},getCode:function(){return this.get("post_link")+"&tl_name=[name]&tl_email=[email]"},decreaseStatistics:function(){this.set({signups:"0"})},isDataValid:function(){var t=!0,i=this.get("redirect_url"),s=jQuery.map(this.get("api_connections"),(function(e){return e}));return t=!!(e(i)&&e(i.type)&&("single-redirect"==i.type?i.single&&""!=i.single:i.before&&""!=i.before||i.during&&""!=i.during||i.after&&""!=i.after_event)),e(s)&&0!==s.length||(t&=!1),t}}),ThriveLeads.collections.OneClickSignup=Backbone.Collection.extend({model:ThriveLeads.models.OneClickSignup}),ThriveLeads.models.OneClickSignupVariation=ThriveLeads.models.FormVariationBase.extend({defaults:function(){return{key:"",post_parent:0,post_title:"",post_status:"publish",trigger:"click",trigger_nice_name:"",trigger_config:{},impressions:"0",conversions:"0",conversion_rate:"N/A",parent:{},hide_buttons:!1,is_control:!0,has_frequency_settings:!1,has_position_settings:!1,has_animation_settings:!1,display_frequency:"0",display_position:"",display_animation:"",display_frequency_nice_name:"",display_position_nice_name:"",display_animation_nice_name:""}},initialize:function(){}}),ThriveLeads.models.Message=Backbone.Model.extend({defaults:function(){return{text:"text",status:"success"}}}),ThriveLeads.collections.Messages=Backbone.Collection.extend({model:ThriveLeads.models.Message}),ThriveLeads.objects.messages=new ThriveLeads.collections.Messages,ThriveLeads.models.PageTitle=Backbone.Model.extend({defaults:function(){return{parts:[],separator:" ‹ ",default_title:""}},initialize:function(){this.set("parts",this.get("default_title").split(this.get("separator")))},prepend:function(e,t,i){void 0!==t&&t&&this.get("parts").length>1&&this.get("parts").shift(),void 0!==i&&i&&this.set("parts",this.get("default_title").split(this.get("separator"))),this.get("parts").unshift(e),this.trigger("title_change",this.getTitle())},replaceFirst:function(e){return this.prepend(e,!0)},getTitle:function(){return this.get("parts").join(this.get("separator"))}}),ThriveLeads.models.InboundLink=Backbone.Model.extend({defaults:function(){return{base_url:"",target_all:"1",groups:[],form_type:0,period_type:0,period_days:""}},getLink:function(){var e=this.get("base_url");e+=-1!==e.indexOf("?")?"":"?",e+="?"==e.substr(-1)?"":"&",e+="tl_inbound=1","0"!=this.get("target_all")&&(e+="&tl_target_all="+this.get("target_all"));var t=this.get("groups"),i=0;t.forEach((function(t){e+="&tl_groups["+i+"]="+t,i++})),"0"!=this.get("form_type")&&(e+="&tl_form_type="+this.get("form_type")),"0"!=this.get("period_type")&&(e+="&tl_period_type="+this.get("period_type"));var s=this.get("period_days");return""!=s&&(e+="&tl_period_days="+s),e}}),ThriveLeads.models.Breadcrumbs=Backbone.Model.extend({defaults:function(){return{name:"",url:"",last:0}}}),ThriveLeads.collections.BreadcrumbsCollection=Backbone.Collection.extend({model:ThriveLeads.models.Breadcrumbs})}();