| Current Path : /home/xbodynamge/lebauwcentre/wp-content/themes/customify/assets/js/customizer/ |
| Current File : /home/xbodynamge/lebauwcentre/wp-content/themes/customify/assets/js/customizer/auto-css.min.js |
var CustomifyAutoCSS=window.CustomifyAutoCSS||null;!function(u,s){(CustomifyAutoCSS=function(){this.values={},this.lastValues={},this.devices=["desktop","tablet","mobile"]})._change=!1,CustomifyAutoCSS.prototype.fonts={},CustomifyAutoCSS.prototype.styling_fields={color:null,image:null,position:null,cover:null,repeat:null,attachment:null,border_width:null,border_color:null,border_style:null},CustomifyAutoCSS.prototype.subsets={},CustomifyAutoCSS.prototype.variants={},CustomifyAutoCSS.prototype.media_queries={all:"%s",desktop:"%s",tablet:"@media screen and (max-width: 1024px) { %s }",mobile:"@media screen and (max-width: 568px) { %s }"},CustomifyAutoCSS.prototype.css={all:"",desktop:"",tablet:"",mobile:""},CustomifyAutoCSS.prototype.box_shadow_fields={color:null,x:0,y:0,blur:0,spread:0,inset:null},CustomifyAutoCSS.prototype.reset=function(){this.fonts={},this.subsets={},this.variants={},this.css={all:"",desktop:"",tablet:"",mobile:""}},CustomifyAutoCSS.prototype.encodeValue=function(e){return encodeURI(JSON.stringify(e))},CustomifyAutoCSS.prototype.decodeValue=function(e){return JSON.parse(decodeURI(e))},CustomifyAutoCSS.prototype.loop_fields=function(e,s,i,n){_.isUndefined(i)&&(i=!1),_.isObject(s)||(s={});var o=this,r={};return _.each(e,function(e){var t=_.isUndefined(s[e.name])?null:s[e.name];if((!_.isNull(t)||!i)&&e.selector&&e.css_format)switch(e.type){case"css_ruler":r[e.name]=o.css_ruler(e,t,n);break;case"slider":r[e.name]=o.slider(e,t,n);break;case"color":r[e.name]=o.color(e,t,n);break;case"shadow":r[e.name]=o.shadow(e,t,n);break;case"checkbox":"html_class"==e.css_format?o.html_class(e,t):r[e.name]=o.checkbox(e,t,n);break;case"image":r[e.name]=o.image(e,t,n);break;case"text_align":case"text_align_no_justify":r[e.name]=o.text_align(e,t,n);break;case"font":r[e.name]=o.font(e,t,n);break;case"styling":r[e.name]=o.styling(e,t,n);break;case"typography":r[e.name]=o.typography(e,t,n);break;case"modal":o.modal(e,t);break;default:switch(e.css_format){case"background":case"styling":r[e.name]=o.styling(e,t,n);break;case"typography":r[e.name]=o.typography(e,t,n);break;case"html_class":o.html_class(e,t);break;case"html_replace":o.html_replace(e,t);break;default:r[e.name]=o.maybe_devices_setup(e,"setup_default",t,n)}}}),r},CustomifyAutoCSS.prototype.run=function(e){_.isUndefined(e)&&(e=!1),this.lastValues=this.values,this.values=s.get(),window.Customify_JS&&window.Customify_JS.css_media_queries&&(this.media_queries=window.Customify_JS.css_media_queries),this.reset();var i=this;i.loop_fields(Customify_Preview_Config.fields);var n="",o=0;_.each(i.css,function(e,t){var s="";0<o&&(s="\r\n\r\n\r\n\r\n\r"),n+=s+i.media_queries[t].replace(/%s/g,e)+"\r\n",o++});var t=i.get_google_fonts_url();u("#customify-google-font-css").length<=0&&u("head").prepend("<link rel='stylesheet' id='customify-google-font-css' href='' type='text/css' media='all' />"),t?u("#customify-google-font-css").attr("href",t):u("#customify-google-font-css").remove(),n=n.trim(),u("#customify-style-inline-css").length<=0&&u("head").append("<style id='customify-style-inline-css' type='text/css'></style>"),u("#customify-style-inline-css").html(n),u(document).trigger("header_builder_panel_changed",["auto_render_css",e]),u(document).trigger("after_auto_render_css",["after_auto_render_css",e])},CustomifyAutoCSS.prototype.get_setting=function(e,t,s){_.isUndefined(t)&&(t="desktop"),_.isUndefined(s)&&(s=!1);var i,n=null,o=!1;if(!_.isUndefined(Customify_Preview_Config.fields["setting|"+e])){var r=Customify_Preview_Config.fields["setting|"+e];o=!_.isUndefined(r.default)&&r.default}if(i=_.isUndefined(this.values[e])?o:this.values[e],_.isString(i))try{var a=this.decodeValue(i);_.isNull(a)||(i=a)}catch(e){}if(s){var l=!!_.isUndefined(i[s])&&i[s];n="all"!==t&&_.isObject(l)&&_.isObject(l)&&!_.isUndefined(l[t])?l[t]:l}else"all"!==t?_.isObject(i)&&!_.isUndefined(i[t])&&(n=i[t]):n=i;return n},CustomifyAutoCSS.prototype.get_google_fonts_url=function(){var e="//fonts.googleapis.com/css?family=",s="",i=this;return!_.isEmpty(i.fonts)&&(_.each(i.fonts,function(e){s&&(s+="|"),s+=e.replace(/\s/g,"+");var t={};_.isUndefined(i.variants[e])||_.each(i.variants[e],function(e){if("regular"!==e)switch(e){case"italic":t[e]="400i";break;default:_.isString(e)?t[e]=e.replace("italic","i"):t[e]=e}else t[e]="400"}),_.isEmpty(t)||(s+=":"+i.join(t,","))}),e+=s,_.isEmpty(i.subsets)||(e+="&subset="+i.join(i.subsets,",")),e)},CustomifyAutoCSS.prototype.join=function(e,t){return _.isUndefined(t)&&(t=""),_.isArray(e)?e.join(t):!_.isObject(e)||_.isEmpty(e)?"":_.values(e).join(t)},CustomifyAutoCSS.prototype.str_value=function(e,t,s){if(_.isEmpty(e))return"";if(!_.isString(t))return"";_.isUndefined(s)&&(s="");var i=new RegExp("{{value}}","g"),n=t.replace(i,e),o=new RegExp("{{value_no_unit}}","g");return n=n.replace(o,s)},CustomifyAutoCSS.prototype.setup_color=function(e,t){return!(!t||!e)&&this.str_value(e,t)},CustomifyAutoCSS.prototype.setup_checkbox=function(e,t){return!(!t||!e)&&t},CustomifyAutoCSS.prototype.setup_image=function(e,t){var s=this.sanitize_media(e);return!(!s.url||!t)&&this.str_value(s.url,t)},CustomifyAutoCSS.prototype.setup_slider=function(e,t){_.isObject(e)||(e={}),(e=_.defaults(e,{unit:"px",value:null})).unit||(e.unit="px");var s="",i="";return t&&e.value&&(i=e.value+e.unit,s=this.str_value(i,t,e.value)),s},CustomifyAutoCSS.prototype.setup_shadow=function(e,t){if(!_.isObject(e))return"";var s=_.defaults(e,this.box_shadow_fields),i=this.sanitize_color(s.color),n=s.inset?"inset":"";if(!i)return"";s.blur||(s.blur=0),s.spread||(s.spread=0),s.x||(s.x=0),s.y||(s.y=0);var o=s.x+"px "+s.y+"px "+s.blur+"px "+s.spread+"px "+i+" "+n;return this.str_value(o,t)},CustomifyAutoCSS.prototype.setup_default=function(e,t){return!(!t||!e)&&this.str_value(e,t)},CustomifyAutoCSS.prototype.setup_css_ruler=function(i,e){_.isObject(i)||(i={}),i=_.defaults(i,{unit:"",top:"",right:"",bottom:"",left:""}),_.isUndefined(i.unit)||(i.unit="px"),e=_.defaults(e,{top:"",right:"",bottom:"",left:""});var n=this,o={};return _.each(e,function(e,t){var s=i[t];s&&e&&e&&(s+=i.unit,o[t]=n.str_value(s,e))}),n.join(o,"\n\t")},CustomifyAutoCSS.prototype.setup_text_align=function(e,t){return!(!t||!e)&&this.str_value(e,t)},CustomifyAutoCSS.prototype.sanitize_color=function(e){return e},CustomifyAutoCSS.prototype.sanitize_slider=function(e){return e=_.defaults(e,{unit:"px",value:null})},CustomifyAutoCSS.prototype.sanitize_media=function(e){return _.isObject(e)||(e={}),_.defaults(e,{id:null,url:null,mime:null})},CustomifyAutoCSS.prototype.maybe_devices_setup=function(i,n,o,e){var t="",r={},s=!1,a=!_.isEmpty(i.css_format)&&i.css_format,l=this;_.isUndefined(e)&&(e=!1);var u=!1;return(_.isUndefined(o)||_.isNull(o))&&(o={},u=!0),!_.isUndefined(i.device_settings)&&i.device_settings?(s=!0,_.each(l.devices,function(e){var t=null;u?t=l.get_setting(i.name,e):_.isUndefined(o[e])||(t=o[e]);var s=!1;l[n]&&(s=l[n](t,a)),s&&(r[e]=s)})):(u&&(o=l.get_setting(i.name,"all")),l[n]&&(t=l[n](o,a)),r.no_devices=t),_.isEmpty(r),t="",e?r:(s?_.each(l.devices,function(e){if(!_.isUndefined(r[e])){var t=r[e];t&&("format"===i.selector?l.css[e]+="\r\n"+t+"\r\n":l.css[e]+="\r\n"+i.selector+" {\r\n\t"+t+"\r\n}\r\n")}}):r.no_devices&&("format"===i.selector?l.css.all+="\r\n"+r.no_devices+"\r\n":l.css.all+="\r\n"+i.selector+" {\r\n\t"+r.no_devices+"\r\n}\r\n"),t)},CustomifyAutoCSS.prototype.setup_font=function(e){if(_.isObject(e)||(e={}),!(e=_.defaults(e,{font:null,type:null,variant:null,subsets:null,font_data:null})).font)return"";if("google"==e.type){var t;if(this.fonts[e.font]=e.font,e.variant)if(_.isUndefined(this.variants[e.font]))if(this.variants[e.font]={},_.isString(e.variant))(t={})[e.variant]=e.variant,this.variants[e.font]=_.extend(this.variants[e.font],t);else this.variants[e.font]=_.extend(this.variants[e.font],e.variant);e.subsets&&(this.subsets=_.extend(this.subsets,e.subsets))}return'font-family: "'+e.font+'";'},CustomifyAutoCSS.prototype.font=function(i,n){var o="",r=this;return i.device_settings?_.each(this.devices,function(e){var t=null;_.isEmpty(n)?t=r.get_setting(i.name,e):_.isUndefined(n[e])||(e=n[e]);var s=r.setup_font(t);s&&(r.css[e]="\r\n"+i.selector+" {\r\n\t"+s+"\r\n}\r\n",o+="desktop"===e?"\r\n"+i.selector+" {\r\n\t"+s+"\r\n}":"\r\n."+e+" "+i.selector+" {\r\n\t"+s+"\r\n}\r\n")}):(_.isEmpty(n)&&(n=r.get_setting(i.name)),o=r.setup_font(n),r.css.all+=" "+i.selector+" {\r\n\t"+o+"\r\n}\r\n",o+=" "+i.selector+" {\r\n\t"+o+"\r\n}\r\n"),o},CustomifyAutoCSS.prototype.css_ruler=function(e,t,s){return this.maybe_devices_setup(e,"setup_css_ruler",t,s)},CustomifyAutoCSS.prototype.shadow=function(e,t,s){return this.maybe_devices_setup(e,"setup_shadow",t,s)},CustomifyAutoCSS.prototype.slider=function(e,t,s){return this.maybe_devices_setup(e,"setup_slider",t,s)},CustomifyAutoCSS.prototype.color=function(e,t,s){return this.maybe_devices_setup(e,"setup_color",t,s)},CustomifyAutoCSS.prototype.checkbox=function(e,t,s){return this.maybe_devices_setup(e,"setup_checkbox",t,s)},CustomifyAutoCSS.prototype.image=function(e,t,s){return this.maybe_devices_setup(e,"setup_image",t,s)},CustomifyAutoCSS.prototype.text_align=function(e,t,s){return this.maybe_devices_setup(e,"setup_text_align",t,s)},CustomifyAutoCSS.prototype.setup_styling_fields=function(t,e,s,i){var n,o=this;return _.isObject(s)||(s={}),_.isUndefined(i)&&(i="normal"),!1===t?null:(_.isObject(t)||(t={}),n={},0,_.each(e,function(e){_.isUndefined(o.box_shadow_fields[e.name])?(_.isUndefined(t[e.name])||t[e.name])&&(n[e.name]=e,_.isUndefined(s[i+"_"+e.name])?n[e.name].selector=s[i]:n[e.name].selector=s[i+"_"+e.name],0):(_.isUndefined(t[e.name])||t[e.name])&&(n[e.name]=e,n[e.name].selector=null)}),n)},CustomifyAutoCSS.prototype.styling=function(e){var i=this,t=this.get_setting(e.name,"all");_.isObject(t)||_.isArray(t)||(t={}),t=_.defaults(t,{normal:{},hover:{}});var s={};_.isString(e.selector)?(s.normal=e.selector,s.hover=e.selector):s=_.defaults(e.selector,{normal:null,hover:null});var n=null,o=-1,r=-1;!_.isUndefined(e.fields)&&_.isObject(e.fields)&&(_.isUndefined(e.fields.tabs)||(n=e.tabs),_.isUndefined(e.fields.normal_fields)||(o=e.normal_fields),_.isUndefined(e.fields.hover_fields)||(r=e.hover_fields));var a=i.setup_styling_fields(o,Customify_Preview_Config.styling_config.normal_fields,s,"normal"),l=i.setup_styling_fields(r,Customify_Preview_Config.styling_config.hover_fields,s,"hover"),u=_.clone(Customify_Preview_Config.styling_config.tabs);!1===n?u.hover=!1:_.isObject(n)&&(u=n);var f=function(e,t){_.each(e,function(s,e){_.isUndefined(c[s.selector])&&(c[s.selector]=""),_.isUndefined(t[e])||(_.isUndefined(t[e].no_devices)?_.each(t[e],function(e,t){_.isUndefined(d[t])&&(d[t]={}),_.isUndefined(d[t][s.selector])&&(d[t][s.selector]=""),e&&(d[t][s.selector]+=e)}):t[e].no_devices&&(c[s.selector]+=t[e].no_devices))})},c={},d={};_.isEmpty(t)||(_.isUndefined(t.normal.bg_image)||i.sanitize_media(t.normal.bg_image).url||(delete t.normal.bg_repeat,delete t.normal.bg_cover,delete t.normal.bg_position,delete t.normal.bg_attachment));var m=i.loop_fields(a,t.normal,!0,!0),p=i.loop_fields(l,t.hover,!0,!0);f(a,m),f(l,p),_.each(c,function(e,t){i.css.all+="\r\n"+t+" {\r\n\t"+e+"\r\n}\r\n"}),_.each(i.devices,function(e){var s="";if(!_.isUndefined(d[e])){var t=d[e];_.each(t,function(e,t){_.isString(e)?s+="\r\n"+t+" {\r\n\t"+e+"\r\n}\r\n":s+="\r\n"+t+" {\r\n\t"+i.join(e,"\n")+"\r\n}\r\n"})}i.css[e]+=s})},CustomifyAutoCSS.prototype.modal=function(s){var i=this,n=this.get_setting(s.name,"all");_.isObject(n)||(n={}),_.isObject(s.fields.tabs)&&_.each(s.fields.tabs,function(e,t){_.isObject(s.fields[t+"_fields"])&&i.loop_fields(s.fields[t+"_fields"],n[t])})},CustomifyAutoCSS.prototype.setup_font_style=function(e){_.isObject(e)||(e={});var t={};(e=_.defaults(e,{b:null,i:null,u:null,s:null,t:null})).b&&(t.b="font-weight: bold;"),e.i&&(t.i="font-style: italic;");var s={};return e.u&&(s.underline="underline"),e.s&&(s["line-through"]="line-through"),_.isEmpty(s)||(t.d="text-decoration: "+this.join(s," ")+";"),e.t&&(t.t="text-transform: uppercase;"),this.join(t,"\r\n\t")},CustomifyAutoCSS.prototype.html_replace=function(e,t){var s=e.selector,i=_.clone(t);(_.isUndefined(i)||_.isEmpty(i))&&(i=e.default),u(s).html(i)},CustomifyAutoCSS.prototype.html_class=function(i,e){var t;t=_.isUndefined(e)?_.clone(e):this.get_setting(i.name,"all");var n=i.selector,s=null,o="checkbox"===i.type;if(_.isUndefined(this.lastValues[i.name])||(s=this.lastValues[i.name]),_.isString(s))try{var r=this.decodeValue(s);_.isNull(r)||(s=r)}catch(e){}if(o&&(_.isUndefined(i.device_settings)||!i.device_settings)){var a,l=i.name.split("__");return a=1<l.length?l[1]+"-active":i.name+"-active",void(t?u(n).addClass(a):u(n).removeClass(a))}_.isString(s)&&!_.isEmpty(s)?u(n).removeClass(s):_.isObject(s)&&_.each(s,function(e,t){if(e){var s=t+"--"+e;o&&(s=i.name+"-"+s),u(n).removeClass(s)}}),_.isString(t)?u(n).addClass(t):_.isObject(t)&&_.each(t,function(e,t){if(e){var s=t+"--"+e;o&&(s=i.name+"-"+s),u(n).addClass(s)}})},CustomifyAutoCSS.prototype.typography=function(s,e){!_.isUndefined(e)&&_.isObject(e)||(e=this.get_setting(s.name,"all"));var i=this;_.isObject(e)||(e={}),e=_.defaults(e,{font:null,font_type:null,languages:null,font_size:null,font_weight:null,line_height:null,letter_spacing:null,style:null,text_decoration:null,text_transform:null});var n={},t={},o={};if(_.each(Customify_Preview_Config.typo_fields,function(e){t[e.name]=e}),_.isUndefined(t.font)||(n.font=this.setup_font({font:e.font,type:e.font_type,subsets:e.languages,variant:e.variant})),_.isUndefined(t.style)||e.style&&"default"!==e.style&&(n.style="font-style: "+e.style+";"),_.isUndefined(t.font_weight)||e.font_weight&&"default"!==e.font_weight&&"default"!==e.font_weight&&("regular"===e.font_weight&&(e.font_weight="normal"),n.font_weight="font-weight: "+e.font_weight+";"),_.isUndefined(t.text_decoration)||e.text_decoration&&"default"!==e.text_decoration&&(n.text_decoration="text-decoration: "+e.text_decoration+";"),_.isUndefined(t.text_transform)||e.text_transform&&"default"!==e.text_transform&&(n.text_transform="text-transform: "+e.text_transform+";"),!_.isUndefined(t.font_size)){t.font_size.css_format="font-size: {{value}};";var r=this.maybe_devices_setup(t.font_size,"setup_slider",e.font_size,!0);_.isEmpty(r)||(_.isUndefined(r.no_devices)?_.each(r,function(e,t){"desktop"==t?n.font_size=e:(_.isUndefined(o[t])&&(o[t]={}),o[t].font_size=e)}):n.font_size=r.no_devices)}if(!_.isUndefined(t.line_height)){t.line_height.css_format="line-height: {{value}};";var a=this.maybe_devices_setup(t.line_height,"setup_slider",e.line_height,!0);_.isEmpty(a)||(_.isUndefined(a.no_devices)?_.each(a,function(e,t){"desktop"==t?n.line_height=e:(_.isUndefined(o[t])&&(o[t]={}),o[t].line_height=e)}):n.line_height=a.no_devices)}if(!_.isUndefined(t.letter_spacing)){t.letter_spacing.css_format="letter-spacing: {{value}};";var l=this.maybe_devices_setup(t.letter_spacing,"setup_slider",e.letter_spacing,!0);l&&(_.isUndefined(l.no_devices)?_.each(l,function(e,t){"desktop"==t?n.letter_spacing=e:(_.isUndefined(o[t])&&(o[t]={}),o[t].letter_spacing=e)}):n.letter_spacing=l.no_devices)}_.each(o,function(e,t){i.css[t]+=" "+s.selector+" {\r\n\t"+i.join(e,"\r\n\t")+"\r\n}"}),i.css.all+=" "+s.selector+" {\r\n\t"+i.join(n,"\r\n\t")+"\r\n}"};var i=new CustomifyAutoCSS;s.bind("preview-ready",function(){i.lastValues=s.get(),i.values=s.get()}),s.bind("change",function(){}),_.each(Customify_Preview_Config.fields,function(t){(t.selector&&t.css_format||"modal"===t.type)&&wp.customize(t.name,function(e){e.bind(function(e){i.run(t.name)})})})}(jQuery,wp.customize);