var TF_Fields_Values_Applier=function(){function e(e,t){this.data=e,this.item=t,this.breakpoints=["desktop","tablet","mobile"],this.dimensions=["top","right","bottom","left"],this.border_radius_dimensions=["top_left","top_right","bottom_right","bottom_left"]}var t=e.prototype;return t.applyItemData=function(){this.data[this.item]&&(this.data=this.data[this.item],this.applyData())},t.applyData=function(){for(var e in this.data){var t=this.data[e];e.startsWith("[")||e.endsWith("]")||(e="["+e+"]"),t.responsive?t.dimensions?this.setDimensionsResponsiveValue(e,t):this.setResponsiveValue(e,t.type,t.value):this.setValue(e,t.type,t.value)}},t.setDimensionsResponsiveValue=function(e,t){var i=t.type,n=t.value,s=t.border_radius||!1,o=s?this.border_radius_dimensions:this.dimensions;if(null!==n&&"object"==typeof n)for(breakpoint in n){if(null!==n[breakpoint]&&"object"!=typeof n[breakpoint]){var a=n[breakpoint];if(n[breakpoint]={},s)for(index in this.border_radius_dimensions)n[breakpoint][this.border_radius_dimensions[index]]=a;else for(index in this.dimensions)n[breakpoint][this.dimensions[index]]=a}for(dimension in n[breakpoint]){var r=e+"["+breakpoint+"]["+dimension+"]";this.setValue(r,i,n[breakpoint][dimension])}}else for(breakpoint in this.breakpoints)for(dimension in o){var p=e+"["+this.breakpoints[breakpoint]+"]["+o[dimension]+"]";this.setValue(p,i,n)}},t.setResponsiveValue=function(e,t,i){if(null!==i&&"object"==typeof i)for(breakpoint in i){var n=e+"["+breakpoint+"]";this.setValue(n,t,i[breakpoint])}else for(breakpoint in this.breakpoints){var s=e+"["+this.breakpoints[breakpoint]+"]";this.setValue(s,t,i)}},t.setValue=function(e,t,i){switch(t){case"text":case"number":case"color":var n=document.querySelector('input[type="'+t+'"][name$="'+e+'"]');n.value=i,n.closest(".nr-responsive-control--item")&&n.dispatchEvent(new CustomEvent("input",{bubbles:!0})),n.parentElement&&n.parentElement.classList.contains("minicolors")&&jQuery(n).minicolors&&jQuery(n).minicolors("value",i);break;case"nrtoggle":n=document.querySelector('input[type="checkbox"][name$="'+e+'"]');n.checked=i,n.dispatchEvent(new CustomEvent("change",{bubbles:!0}));break;case"radio":n=document.querySelector('input[type="radio"][name$="'+e+'"][value="'+i+'"]');n.checked=!0,n.dispatchEvent(new CustomEvent("change",{bubbles:!0}));break;case"list":n=document.querySelector('select[name$="'+e+'"]');n.value=i,!Joomla.Modal&&n.classList.contains("hasChosen")&&(jQuery(n).chosen("destroy"),jQuery(n).chosen()),n.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}},e}();

