"undefined"===typeof window.tdcPostSettings&&(window.tdcPostSettings={tdbTemplateType:"all"});if(window.tdbVue&&"undefined"!==typeof window.tdbVue.router){var eventHub=new CloudLibraryVue;CloudLibraryVue.component("image-links",{template:'\n {{text}} \n ',props:{classes:[],link:"",text:""}});new CloudLibraryVue({el:"#tdb-modal",router:window.tdbVue.router})}
window.tdbVueManager&&"undefined"!==typeof window.tdbVueManager.router&&new CloudLibraryVue({el:"#tdb-modal-website-manager",router:window.tdbVueManager.router});
(function(){function m(a,b,c,d,f,g,h){var e=jQuery(".tdb-"+a+"-templates");e.length&&"undefined"===typeof e.data("tdb-templates")&&("undefined"!==typeof g&&g.call(),tdbGetMobileTemplates(a,b,e),g="","undefined"!==typeof tdcState&&(g=tdcState.isMobileComposer()?"1":""),g={action:"tdb_get_"+a+"_templates",mobile_templates:g,_nonce:window.tdb_globals.wpRestNonce},"cpt_tax"===a?g.data_id=b:g[a+"_id"]=b,jQuery.ajax({type:"POST",url:td_ajax_url,data:g,success:function(g,k,p){e.html("");g=jQuery.parseJSON(g);
k='
';var l=p="",m=!1;_.isArray(g)&&g.length?(_.each(g,
function(e,g,h){h="";"true"===e.is_current.toString()&&(h=" tdb-current",m=!0);var k="";g="";switch(a){case "single":k=e.template_title+" - Set template for this post";break;case "category":k=e.template_title+" - Set template for this category";break;case "author":k=e.template_title+" - Set template for this author";break;case "tag":k=e.template_title+" - Set template for this tag";break;case "search":""!==e.cpt?(k=e.template_title+" - Set this template for the "+e.cpt.label+" custom post type",g=
' data-cpt="'+e.cpt.name+'"'):k=e.template_title+" - Set this template for post search results";break;case "woo_product":k=e.template_title+" - Set template for this product";break;case "woo_archive":k=e.template_title+" - Set template for this product archive";break;case "cpt":k=e.template_title+" - Set template for this custom post type";break;case "cpt_tax":""!==e.cpt?(k=e.template_title+" - Set this template for the "+e.cpt.label+" custom post type archive",g=' data-cpt="'+e.cpt.name+'"'):k=e.template_title+
" - Set template for this taxonomy"}h=''+e.template_id+'
"+e.template_title+'
';
"undefined"!==typeof d&&!0===d&&(k="","undefined"!==typeof f&&""!==f&&(k='data-global-action="'+f+'"'),h+='
Global
');
h+='
'+(""===e.mobile_template_title?"-":'Yes ')+' ';l+=h+"
"}),"undefined"!==typeof d&&!0===d&&(p+=''),e.append(p+k+l)):(e.append(k),e.append('No cloud templates. Please import one or more templates from Cloud Library .
'));e.data("tdb-templates",!0);"undefined"!==typeof h&&h.call()},error:function(a,b,c){}}))}function n(a,b,c){var d=jQuery(window);d.resize(function(){var f=d.width();a.offset().left+b.width()>f?b.hasClass(c)||b.addClass(c):
b.hasClass(c)&&b.removeClass(c)});d.resize()}jQuery(document).ready(function(){jQuery("#wp-admin-bar-tdb_template_builder_disabled a").click(function(a){a.preventDefault();alert("Please select tagDiv Builder Template from the theme panel or set a default template. The current page/post uses a template that is not editable.")});jQuery("#wp-admin-bar-new-tdb_templates").hide()});jQuery("body").on("click","#wp-admin-bar-tdb_template_load, .tdb-load-mobile-template",function(a){a.preventDefault();var b=
jQuery(this),c=b.attr("class");a="";var d=!1;b.hasClass("tdb-load-mobile-template")&&(d=!0);"undefined"!==typeof c&&(0===c.indexOf("singleid-")?(a={wp_type:"single",templateType:"Single"},b=c.split(" ")[0].replace("singleid-",""),d?a.assign_mobile_to_template=b:a.assign_to_post=b):0===c.indexOf("categoryid-")?(a={wp_type:"category",templateType:"Category"},b=c.split(" ")[0].replace("categoryid-",""),d?a.assign_mobile_to_template=b:a.assign_to_category=b):0===c.indexOf("404")?(a={wp_type:"404",templateType:"404"},
b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_404=b):0===c.indexOf("date")?(a={wp_type:"date",templateType:"Date"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_archive=b):0===c.indexOf("search")?(a={wp_type:"search",templateType:"Search"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_search=b,-1!==c.indexOf("cpt-")&&(c=c.split(" ")[1].replace("cpt-",""),a.assign_to_search_cpt=c)):0===c.indexOf("attachment")?(a={wp_type:"attachment",
templateType:"Attachment"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_attachment=b):0===c.indexOf("authorid")?(a={wp_type:"author",templateType:"Author"},b=c.split(" ")[0].replace("authorid-",""),d?a.assign_mobile_to_template=b:a.assign_to_author=b):0===c.indexOf("tagid")?(a={wp_type:"tag",templateType:"Tag"},b=c.split(" ")[0].replace("tagid-",""),d?a.assign_mobile_to_template=b:a.assign_to_tag=b):0===c.indexOf("pageid")?(a={wp_type:"page",templateType:"Pages"},b=c.split(" ")[0].replace("pageid-",
""),d&&(a.assign_mobile_to_template=b)):0===c.indexOf("woo_productid-")?(a={wp_type:"woo_product",templateType:"Woo Product"},b=c.split(" ")[0].replace("woo_productid-",""),d?a.assign_mobile_to_template=b:a.assign_to_woo_product=b):0===c.indexOf("woo_archiveid-")?(a={wp_type:"woo_archive",templateType:"Woo Archive"},b=c.split(" ")[0].replace("woo_archiveid-",""),d?a.assign_mobile_to_template=b:a.assign_to_woo_archive=b):0===c.indexOf("woo_search_archive")?(a={wp_type:"woo_search_archive",templateType:"Woo Search"},
b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_woo_search_archive=b):0===c.indexOf("woo_shop_base")?(a={wp_type:"woo_shop_base",templateType:"Woo Shop Base"},b=btoa(window.location.href),d?a.assign_mobile_to_template=b:a.assign_to_woo_shop_base=b):0===c.indexOf("cpt_tax")?(a={wp_type:"cpt_tax",templateType:"Custom Taxonomy"},b=c.split(" ")[0].replace("cpt_taxid-",""),d?a.assign_mobile_to_template=b:a.assign_to_cpt_tax=b):0===c.indexOf("cpt")&&(a={wp_type:"cpt",templateType:"Custom Post Type"},
b=c.split(" ")[0].replace("cptid-",""),d?a.assign_mobile_to_template=b:a.assign_to_cpt=b),""!==a&&(a.hide_mobile_selector="hide",window.tdbVue.router.push({name:"loadRoute",params:a})))}).on("click",".tdb-create-mobile-template",function(a){var b=jQuery(this),c=b.data("template-id"),d=b.data("type");tdConfirm.modal({caption:"Create Mobile "+("page"===d?"Page":"Template"),objectContext:window,callbackYes:function(){var a=jQuery("#tdb-new-template-name"),g=jQuery("#tdb-copy-content");jQuery.ajax({type:"POST",
url:td_ajax_url,data:{action:"tdb_create_mobile_template",template_id:c,template_title:a.val(),template_type:d,copyContent:g.is(":checked")?"1":"0",_nonce:window.tdb_globals.wpRestNonce},success:function(a,e,f){a=jQuery.parseJSON(a);"undefined"!==typeof a.mobile_template_id&&(tdConfirm.close(),e=b.closest(".tdb-template-el"),e.length&&(f=e.find(".tdb-template-el-mobile:first"),e.find(".tdb-template-el-mobile-btns:first").data("mobile-template-id",a.mobile_template_id),f.html('Yes ')),
tdbGetMobileTemplates(d,c))},error:function(a,b,c){}})},htmlInfoContent:"Enter the mobile "+("page"===d?"page":"template")+' name: Copy content
',
textYes:"Create",textNo:"Cancel"})}).on("click","#wp-admin-bar-tdb_template_single > a, #wp-admin-bar-tdb_template_category > a, #wp-admin-bar-tdb_template_404 > a, #wp-admin-bar-tdb_template_date > a, #wp-admin-bar-tdb_template_search > a, #wp-admin-bar-tdb_template_attachment > a, #wp-admin-bar-tdb_template_author > a, #wp-admin-bar-tdb_template_tag > a, #wp-admin-bar-tdb_template_woo_product > a, #wp-admin-bar-tdb_template_woo_archive > a, #wp-admin-bar-tdb_template_woo_shop_base > a, #wp-admin-bar-tdb_template_woo_search_archive > a, #wp-admin-bar-tdb_template_cpt > a, #wp-admin-bar-tdb_template_cpt_tax > a",
function(a){a.preventDefault();var b=jQuery(this),c=b.parent(),d=c.attr("class"),f="",g="",h="",e="";switch(c.attr("id")){case "wp-admin-bar-tdb_template_single":f="single";g="tdb_assign_single_template_to_post";h="tdb_assign_single_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_category":f="category";g="tdb_assign_cat_template_to_cat";h="tdb_assign_cat_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_404":f="404";g="tdb_assign_404_template_global";
h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_date":f="date";g="tdb_assign_date_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_search":f="search";g="tdb_assign_search_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_attachment":f="attachment";g="tdb_assign_attachment_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_author":f="author";g="tdb_assign_author_template_to_author";
h="tdb_assign_author_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_tag":f="tag";g="tdb_assign_tag_template_to_tag";h="tdb_assign_tag_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_woo_product":f="woo_product";g="tdb_assign_woo_product_template_to_product";h="tdb_assign_woo_product_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_woo_archive":f="woo_archive";g="tdb_assign_woo_archive_template_to_tax";h="tdb_assign_woo_archive_template_global";
e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_woo_search_archive":f="woo_search_archive";g="tdb_assign_woo_search_archive_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_woo_shop_base":f="woo_shop_base";g="tdb_assign_woo_shop_base_template_global";h="";e=d.replace("templateid-","");break;case "wp-admin-bar-tdb_template_cpt":f="cpt";g="tdb_assign_cpt_template_to_cpt";h="tdb_assign_cpt_template_global";e=d.replace(f+"id-","");break;case "wp-admin-bar-tdb_template_cpt_tax":f=
"cpt_tax",g="tdb_assign_cpt_tax_template_to_tax",h="tdb_assign_cpt_tax_template_global",e=d.replace("templateid-","")}var l=jQuery(".tdb-"+f+"-templates");l.length?a.currentTarget===this&&jQuery(a.target).parent().attr("id")==="wp-admin-bar-tdb_template_"+f&&(l.toggle(),b.toggleClass("tdb-templates-open"),b.toggleClass("tdb-templates-close")):(b.addClass("tdb-templates-loading"),l=jQuery('
'),l.insertAfter(b),l.show());m(f,e,g,
""===h?!1:!0,h,void 0,function(){b.removeClass("tdb-templates-loading");b.addClass("tdb-templates-open");n(b,l,"tdb-templates-align-right")})}).on("click","#wp-admin-bar-tdc_page_mobile_template > a",function(a){a.preventDefault();var b=jQuery(this);a=b.parent().attr("class").replace("pageid-","");var c=jQuery("#tdb-mobile-templates");c.length?(c.toggle(),b.toggleClass("tdb-templates-open"),b.toggleClass("tdb-templates-close")):(b.addClass("tdb-templates-loading"),b.addClass("tdb-templates-open"),
tdbGetMobileTemplates("page",a,b,void 0,function(){b.removeClass("tdb-templates-loading");jQuery("#tdb-mobile-templates").show();n(b,jQuery("#tdb-mobile-templates"),"tdb-mobile-templates-align-right")}))}).on("click","#wp-admin-bar-tdc_create_mobile_page",function(a){var b=jQuery(this).attr("class").split(" ")[0].replace("pageid-","");tdConfirm.modal({caption:"Create Mobile Page",objectContext:window,callbackYes:function(){var a=jQuery("#tdb-new-template-name"),d=jQuery("#tdb-copy-content");jQuery.ajax({type:"POST",
url:td_ajax_url,data:{action:"tdb_create_mobile_template",template_id:b,template_title:a.val(),template_type:"page",copyContent:d.is(":checked")?"1":"0",_nonce:window.tdb_globals.wpRestNonce},success:function(c,d,h){"undefined"!==typeof jQuery.parseJSON(c).mobile_template_id&&(tdConfirm.close(),c=jQuery("#wp-admin-bar-tdc_page_mobile_template"),c.length&&c.find("a:first").html('Mobile page '+a.val()),tdbGetMobileTemplates("page",b))},error:function(a,b,c){}})},
htmlInfoContent:'Enter the mobile page name: Copy content
',textYes:"Create",textNo:"Cancel"})}).on("click",
".tdb-single-template-global label, .tdb-category-template-global label, .tdb-author-template-global label, .tdb-tag-template-global label, .tdb-woo_product-template-global label, .tdb-woo_archive-template-global label, .tdb-cpt-template-global label, .tdb-cpt_tax-template-global label ",function(a){a.preventDefault();var b=jQuery(this);a=b.closest(".tdb-template-el-global");var c=a.data("type"),d=a.data("global-action"),f=b.parent().data(c+"-id"),g=b.parent().data("template-id"),h=jQuery(".tdb-templates");
b={action:d,template_id:g,_nonce:window.tdb_globals.wpRestNonce};switch(c){case "single":b.single_id=f;break;case "category":b.category_id=f;break;case "tag":b.tag_id=f;break;case "author":b.author_id=f;break;case "woo_product":b.woo_product_id=f;break;case "woo_archive":b.woo_term_id=f;break;case "cpt":b.cpt_id=f;b.option="single_tpl";break;case "cpt_tax":void 0!==a.data("cpt")?(b.action="tdb_assign_cpt_template_global",b.cpt=f,b.option="archive_tpl"):b.cpt_tax_id=f}jQuery.ajax({type:"POST",url:td_ajax_url,
data:b,success:function(a,b,d){a=jQuery.parseJSON(a);"undefined"!==typeof a.reload&&window.location.reload();"undefined"!==typeof a.global_template_id&&(h.find(".tdb-"+c+'-template-global > input[type="checkbox"]').removeAttr("checked"),h.find(".tdb-"+c+'-template-global[data-template-id="'+g+'"] > input[type="checkbox"]').attr("checked",!0))},error:function(a,b,c){}});return!1}).on("click",".tdb-template-el-title",function(a){a.preventDefault();if(a.target===a.currentTarget){a=jQuery(this);var b=
a.data("action"),c=a.data("type"),d=a.data(c+"-id"),f=a.data("template-id");b={action:b,template_id:f,_nonce:window.tdb_globals.wpRestNonce};"cpt"===c?b.cpt=a.data("cpt-id"):"cpt_tax"===c&&(b.cpt_tax=a.data("cpt_tax-id"));switch(c){case "single":b.single_id=d;break;case "category":b.category_id=d;break;case "author":b.author_id=d;break;case "tag":b.tag_id=d;break;case "woo_product":b.woo_product_id=d;break;case "woo_archive":b.woo_term_id=d;break;case "cpt":b.cpt_id=d;break;case "cpt_tax":void 0!==a.data("cpt")?(b.action="tdb_assign_cpt_template_global",b.cpt=d,b.option="archive_tpl"):b.cpt_tax_id=d;break;case "search":void 0!==a.data("cpt")&&(b.action="tdb_assign_cpt_template_global",b.cpt=d,b.option="search_tpl")}jQuery.ajax({type:"POST",url:td_ajax_url,data:b,success:function(a,b,d){"undefined"===typeof jQuery.parseJSON(a).reload&&"cpt"!==c&&"cpt_tax"!==c&&"search"!==c||window.location.reload()},error:function(a,b,c){}});return!1}}).on("change",".tdb-template-el-title-input",function(a){a.preventDefault();
a=jQuery(this);var b=a.closest(".tdb-templates"),c=a.closest(".tdb-template-el"),d=c.find(".tdb-template-el-title:first");b.data("type");b=c.data("template-id");d.html();jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_change_template_name",template_id:b,template_title:a.val(),_nonce:window.tdb_globals.wpRestNonce},success:function(a,b,c){a=jQuery.parseJSON(a);"undefined"!==typeof a.template_id&&(d.html(a.template_title),d.removeData("title"))},error:function(a,b,c){}})}).on("click",".tdb-template-el-edit",
function(a){a.preventDefault();var b=jQuery(this);a=b.closest(".tdb-templates");var c=b.closest(".tdb-template-el");b=c.find(".tdb-template-el-title:first");a.data("type");c.data("template-id");c=b.html();"undefined"===typeof b.data("title")&&(a.find(".tdb-template-el-title").each(function(a,b){a=jQuery(b);b=a.data("title");"undefined"!==typeof b&&(a.html(b),a.removeData("title"))}),b.data("title",b.html()),b.html(' '),b.find("input").focus().select())}).on("click",
".tdb-template-el-duplicate",function(a){a.preventDefault();a=jQuery(this);var b=a.closest(".tdb-templates"),c=a.closest(".tdb-template-el"),d=c.find(".tdb-template-el-title:first"),f=b.data("type");a=c.data("template-id");var g=d.html(),h=d.data(f+"-id"),e=d.data("action"),l="";0<="single category tag author woo_product woo_archive".split(" ").indexOf(f)&&(c=c.find(".tdb-template-el-global:first"),c.length&&(l=c.data("global-action")));tdbApi.run({wpNonce:window.tdb_globals.wpRestNonce,cloudEndPoint:"td-cloud-library/new_template",
post:{postId:a,templateType:f,templateName:g,duplicateTemplate:!0},done:function(a){b.removeData("tdb-templates");m(f,0<="single category tag author woo_product woo_archive cpt".split(" ").indexOf(f)?h:"",e,""===l?!1:!0,l)},error:function(a){console.log("td-cloud-library/new_template(duplicate template) - ERROR",a)}});jQuery(".tdb-template-el-title-input").trigger("change")}).on("keyup",".tdb-template-el-title-input",function(a){27===a.keyCode&&jQuery(this).trigger("change")}).on("click",".tdb-template-el-delete",
function(a){a=jQuery(this);a.closest(".tdb-templates");var b=a.closest(".tdb-template-el");a=b.data("template-id");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_delete_template",template_id:a,_nonce:window.tdb_globals.wpRestNonce},success:function(a,d,f){a=jQuery.parseJSON(a);"undefined"!==typeof a.reload&&window.location.reload();"undefined"!==typeof a.template_id&&b.remove()},error:function(a,b,f){}});jQuery(".tdb-template-el-title-input").trigger("change")}).on("click",function(a){a=
jQuery(a.target);a.closest("#wp-admin-bar-tdb_template_single").length||a.closest("#wp-admin-bar-tdb_template_category").length||a.closest("#wp-admin-bar-tdb_template_404").length||a.closest("#wp-admin-bar-tdb_template_date").length||a.closest("#wp-admin-bar-tdb_template_search").length||a.closest("#wp-admin-bar-tdb_template_attachment").length||a.closest("#wp-admin-bar-tdb_template_author").length||a.closest("#wp-admin-bar-tdb_template_tag").length||a.closest("#wp-admin-bar-tdb_template_woo_product").length||
a.closest("#wp-admin-bar-tdb_template_woo_archive").length||a.closest("#wp-admin-bar-tdb_template_woo_search_archive").length||a.closest("#wp-admin-bar-tdb_template_woo_shop_base").length||a.closest("#wp-admin-bar-tdb_template_cpt").length||a.closest("#wp-admin-bar-tdb_template_cpt_tax").length||a.closest("#wp-admin-bar-tdc_page_mobile_template").length||(a=jQuery(".tdb-templates"),a.length&&(a.hide(),a.prev("a").removeClass("tdb-templates-open").addClass("tdb-templates-close"),jQuery(".tdb-template-el-title-input").trigger("change")),
a=jQuery("#tdb-mobile-templates"),a.length&&(a.hide(),a.prev("a").removeClass("tdb-templates-open").addClass("tdb-templates-close")))}).on("click","#tdb-mobile-templates .tdb-template-el-mobile-list-el",function(a){var b=jQuery(this),c=jQuery("#tdb-mobile-templates");a=b.data("template-id");var d=b.data("mobile-template-id"),f=c.closest(".tdb-template-el-mobile-btns"),g=b.closest(".tdb-template-el-mobile-wrap"),h=b.closest("#wp-admin-bar-tdc_page_mobile_template");jQuery.ajax({type:"POST",url:td_ajax_url,
data:{action:"tdb_set_mobile_template",template_id:a,mobile_template_id:d,_nonce:window.tdb_globals.wpRestNonce},success:function(a,l,k){a=jQuery.parseJSON(a);_.isObject(a)&&!_.isUndefined(a.result)&&1===a.result&&(f.data("mobile-template-id",d),c.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),c.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+d+'"]').addClass("tdb-current"),g.length&&(a=g.find(".tdb-template-el-mobile:first"),""===d?a.html("-"):a.html('Yes ')),
h.length&&(h.find("a:first").html('Mobile page '+b.find(".tdb-template-el-mobile-list-title:first").html()),"No mobile page"===b.find(".tdb-template-el-mobile-list-title:first").html()&&h.find("a:first").html('Mobile page ')))}})}).on("click","#tdb-mobile-templates .tdb-template-el-mobile-list-edit",function(a){a.stopPropagation()}).on("click","#tdb-mobile-templates .tdb-template-el-mobile-list-delete",
function(a){a.stopPropagation();a=jQuery(this);var b=a.data("type"),c=a.closest(".tdb-template-el-mobile-list-el"),d=c.data("template-id");a=c.data("mobile-template-id");var f=c.hasClass("tdb-current"),g=jQuery("#tdb-mobile-templates").closest(".tdb-template-el");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_delete_template",template_id:a,_nonce:window.tdb_globals.wpRestNonce},success:function(a,e,l){"undefined"!==typeof jQuery.parseJSON(a).template_id&&tdbGetMobileTemplates(b,d,void 0,
function(){jQuery("#tdb-mobile-templates").addClass("loading")},function(){jQuery("#tdb-mobile-templates").removeClass("loading");if(f)if("page"===b){var a=jQuery("#wp-admin-bar-tdc_page_mobile_template");a.length&&a.find("a:first").html('Mobile page No mobile page')}else c.remove(),g.length&&g.find(".tdb-template-el-mobile:first").html("-")})},error:function(a,b,c){}})}).on("mouseenter",".tdb-template-el-mobile-btns",function(a){a=jQuery(this);var b=a.data("mobile-template-id"),
c=a.data("template-id"),d=jQuery("#tdb-mobile-templates");d.find(".tdb-template-el-mobile-list-inner").is(":empty")||(d.appendTo(a).show(),d.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),d.find(".tdb-template-el-mobile-list-el").data("template-id",c),d.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+b+'"]').addClass("tdb-current"))}).on("mouseleave",".tdb-template-el-mobile-btns",function(a){a=jQuery(".tdb-templates");var b=jQuery("#tdb-mobile-templates");b.hide();
b.insertBefore(a);b.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current")});jQuery(".tdb-templates");window.tdbGetMobileTemplates=function(a,b,c,d,f,g,h){var e=jQuery("#tdb-mobile-templates",g);e.length||(e=jQuery(''),
e.hide());"undefined"!==typeof c&&e.insertAfter(c);c={action:"tdb_get_"+a+"_mobile_templates",_nonce:window.tdb_globals.wpRestNonce};c[a+"_id"]=b;"undefined"!==typeof window.tdbLoadDataFromId&&(c.tdbLoadDataFromId=window.tdbLoadDataFromId);"undefined"!==typeof d&&d.call();jQuery.ajax({type:"POST",url:td_ajax_url,data:c,success:function(c,d,g){var k="";g=jQuery.parseJSON(c);c='
Load mobile page from Cloud Library
Create blank mobile page ';if(_.isArray(g)&&g.length){var l=!1,m="template";d="";"page"===a&&(m="page",d=c+'
');_.each(g,function(c,d,e){d="";_.isUndefined(c.is_current)||(d="tdb-current",l=!0);
k+=''});""!==k&&(g="",l||(g="tdb-current",l=
!0),k=d+'"+k);""!==k&&(e.html(''+k+'
Documentation » '),
d=e.parent(".tdb-template-el-mobile-btns"),!_.isUndefined(h)&&d.length&&(e.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),e.find(".tdb-template-el-mobile-list-el").data("template-id",b),e.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+h+'"]').addClass("tdb-current")),e.is(":visible")&&d.length?e.show():e.hide())}""===k&&("page"===a?e.html(c+'
'):
e.html(""));"undefined"!==typeof f&&f.call()}})}})();
jQuery(window).on("load",function(){if("undefined"!==typeof window.tdReadingProgressBar){var m=!1;window.parent===window.top&&"undefined"!==typeof window.name&&"tdc-live-iframe"===window.name&&"undefined"!==typeof window.parent.tdcSidebar&&(m=!0);if(window.self===window.top||m)jQuery(".tdb_single_reading_progress").each(function(){var n=jQuery(this),a=n.data("td-block-uid");n=n.data("bar-position");var b=new tdReadingProgressBar.item;b.blockUid=a;b.barPosition=n;tdReadingProgressBar.addItem(b);m&&
tdReadingProgressBar.createFixedBar(b,0,30)}),m||tdReadingProgressBar.calculateBarsFill()}});
var sbi_js_exists=void 0!==sbi_js_exists;sbi_js_exists||(!function($){function a(){this.feeds={},this.options=sb_instagram_js_options}function b(a,b,c){this.el=a,this.index=b,this.settings=c,this.minImageWidth=0,this.imageResolution=150,this.resizedImages={},this.needsResizing=[],this.outOfPages=!1,this.page=1,this.isInitialized=!1}function c(a,b){$.ajax({url:sbiajaxurl,type:"post",data:a,success:b})}a.prototype={createPage:function(a,b){void 0!==sb_instagram_js_options.ajax_url&&void 0===window.sbiajaxurl&&(window.sbiajaxurl=sb_instagram_js_options.ajax_url),(void 0===window.sbiajaxurl||-1===window.sbiajaxurl.indexOf(window.location.hostname))&&(window.sbiajaxurl=location.protocol+"//"+window.location.hostname+"/wp-admin/admin-ajax.php"),$("#sbi-builder-app").length&&void 0===window.sbiresizedImages&&$(".sbi_resized_image_data").length&&void 0!==$(".sbi_resized_image_data").attr("data-resized")&&0===$(".sbi_resized_image_data").attr("data-resized").indexOf('{"')&&(window.sbiresizedImages=JSON.parse($(".sbi_resized_image_data").attr("data-resized")),$(".sbi_resized_image_data").remove()),$(".sbi_no_js_error_message").remove(),$(".sbi_no_js").removeClass("sbi_no_js"),a(b)},createFeeds:function(a){a.whenFeedsCreated($(".sbi").each(function(e){$(this).attr("data-sbi-index",e+1);var a=$(this),d=void 0!==a.attr("data-sbi-flags")?a.attr("data-sbi-flags").split(","):[],j=void 0!==a.attr("data-options")?JSON.parse(a.attr("data-options")):{};d.indexOf("testAjax")> -1&&(window.sbi.triggeredTest=!0,c({action:"sbi_on_ajax_test_trigger"},function(a){console.log("did test")}));var f,g,h,k={cols:a.attr("data-cols"),colsmobile:void 0!==a.attr("data-colsmobile")&&"same"!==a.attr("data-colsmobile")?a.attr("data-colsmobile"):a.attr("data-cols"),colstablet:void 0!==a.attr("data-colstablet")&&"same"!==a.attr("data-colstablet")?a.attr("data-colstablet"):a.attr("data-cols"),num:a.attr("data-num"),imgRes:a.attr("data-res"),feedID:a.attr("data-feedid"),postID:"undefind"!=typeof a.attr("data-postid")?a.attr("data-postid"):"unknown",shortCodeAtts:a.attr("data-shortcode-atts"),resizingEnabled:-1===d.indexOf("resizeDisable"),imageLoadEnabled:-1===d.indexOf("imageLoadDisable"),debugEnabled:d.indexOf("debug")> -1,favorLocal:d.indexOf("favorLocal")> -1,ajaxPostLoad:d.indexOf("ajaxPostLoad")> -1,gdpr:d.indexOf("gdpr")> -1,overrideBlockCDN:d.indexOf("overrideBlockCDN")> -1,consentGiven:!1,locator:d.indexOf("locator")> -1,autoMinRes:1,general:j};window.sbi.feeds[e]=(f=this,g=e,h=k,new b(f,g,h)),window.sbi.feeds[e].setResizedImages(),window.sbi.feeds[e].init();var i=jQuery.Event("sbiafterfeedcreate");i.feed=window.sbi.feeds[e],jQuery(window).trigger(i)}))},afterFeedsCreated:function(){$(".sb_instagram_header").each(function(){var a=$(this);a.find(".sbi_header_link").on("mouseenter mouseleave",function(b){switch(b.type){case"mouseenter":a.find(".sbi_header_img_hover").addClass("sbi_fade_in");break;case"mouseleave":a.find(".sbi_header_img_hover").removeClass("sbi_fade_in")}})})},encodeHTML:function(b){if(void 0===b)return"";var a=b.replace(/(>)/g,">"),a=a.replace(/(<)/g,"<");return(a=a.replace(/(<br\/>)/g," ")).replace(/(<br>)/g," ")},urlDetect:function(a){return a.match(/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)}},b.prototype={init:function(){var b,a=this;a.settings.consentGiven=a.checkConsent(),$(this.el).find(".sbi_photo").parent("p").length&&$(this.el).addClass("sbi_no_autop"),$(this.el).find("#sbi_mod_error").length&&$(this.el).prepend($(this.el).find("#sbi_mod_error")),this.settings.ajaxPostLoad?this.getNewPostSet():this.afterInitialImagesLoaded();var c=(b=0,function(a,c){clearTimeout(b),b=setTimeout(a,c)});jQuery(window).on("resize",function(){c(function(){a.afterResize()},500)}),$(this.el).find(".sbi_item").each(function(){a.lazyLoadCheck($(this))})},initLayout:function(){},afterInitialImagesLoaded:function(){this.initLayout(),this.loadMoreButtonInit(),this.hideExtraImagesForWidth(),this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed()},afterResize:function(){this.setImageHeight(),this.setImageResolution(),this.maybeRaiseImageResolution(),this.setImageSizeClass()},afterLoadMoreClicked:function(a){a.find(".sbi_loader").removeClass("sbi_hidden"),a.find(".sbi_btn_text").addClass("sbi_hidden"),a.closest(".sbi").find(".sbi_num_diff_hide").addClass("sbi_transition").removeClass("sbi_num_diff_hide")},afterNewImagesLoaded:function(){var a=$(this.el),b=this;this.beforeNewImagesRevealed(),this.revealNewImages(),this.afterNewImagesRevealed(),setTimeout(function(){a.find(".sbi_loader").addClass("sbi_hidden"),a.find(".sbi_btn_text").removeClass("sbi_hidden"),b.maybeRaiseImageResolution()},500)},beforeNewImagesRevealed:function(){this.setImageHeight(),this.maybeRaiseImageResolution(!0),this.setImageSizeClass()},revealNewImages:function(){var a=$(this.el);a.find(".sbi-screenreader").each(function(){$(this).find("img").remove()}),"function"==typeof sbi_custom_js&&setTimeout(function(){sbi_custom_js()},100),this.applyImageLiquid(),a.find(".sbi_item").each(function(a){jQuery(this).find(".sbi_photo").on("mouseenter mouseleave",function(a){switch(a.type){case"mouseenter":jQuery(this).fadeTo(200,.85);break;case"mouseleave":jQuery(this).stop().fadeTo(500,1)}})}),setTimeout(function(){jQuery("#sbi_images .sbi_item.sbi_new").removeClass("sbi_new");var b=10;a.find(".sbi_transition").each(function(){var a=jQuery(this);setTimeout(function(){a.removeClass("sbi_transition")},b),b+=10})},500)},lazyLoadCheck:function(a){if(a.find(".sbi_photo").length&&!a.closest(".sbi").hasClass("sbi-no-ll-check")){var b=this.getImageUrls(a),c=void 0!==b[640]?b[640]:a.find(".sbi_photo").attr("data-full-res");!(!this.settings.consentGiven&&c.indexOf("scontent")> -1)&&a.find(".sbi_photo img").each(function(){c&&void 0!==$(this).attr("data-src")&&$(this).attr("data-src",c),c&&void 0!==$(this).attr("data-orig-src")&&$(this).attr("data-orig-src",c),$(this).on("load",function(){!$(this).hasClass("sbi-replaced")&&$(this).attr("src").indexOf("placeholder")> -1&&($(this).addClass("sbi-replaced"),c&&($(this).attr("src",c),$(this).closest(".sbi_imgLiquid_bgSize").length&&$(this).closest(".sbi_imgLiquid_bgSize").css("background-image","url("+c+")")))})})}},afterNewImagesRevealed:function(){this.listenForVisibilityChange(),this.sendNeedsResizingToServer(),this.settings.imageLoadEnabled||$(".sbi_no_resraise").removeClass("sbi_no_resraise");var a=$.Event("sbiafterimagesloaded");a.el=$(this.el),$(window).trigger(a)},setResizedImages:function(){$(this.el).find(".sbi_resized_image_data").length&&void 0!==$(this.el).find(".sbi_resized_image_data").attr("data-resized")&&0===$(this.el).find(".sbi_resized_image_data").attr("data-resized").indexOf('{"')?(this.resizedImages=JSON.parse($(this.el).find(".sbi_resized_image_data").attr("data-resized")),$(this.el).find(".sbi_resized_image_data").remove()):void 0!==window.sbiresizedImages&&(this.resizedImages=window.sbiresizedImages)},sendNeedsResizingToServer:function(){var a=this,d=$(this.el);if(a.needsResizing.length>0&&a.settings.resizingEnabled){var g=$(this.el).find(".sbi_item").length,h=void 0!==a.settings.general.cache_all&&a.settings.general.cache_all,b="";if(void 0!==d.attr("data-locatornonce")&&(b=d.attr("data-locatornonce")),$("#sbi-builder-app").length){if(void 0!==window.sbiresizeTriggered&&window.sbiresizeTriggered)return;window.sbiresizeTriggered=!0}var e={action:"sbi_resized_images_submit",needs_resizing:a.needsResizing,offset:g,feed_id:a.settings.feedID,atts:a.settings.shortCodeAtts,location:a.locationGuess(),post_id:a.settings.postID,cache_all:h,locator_nonce:b},f=function(c){var b=c;for(var d in"object"!=typeof c&&0===c.trim().indexOf("{")&&(b=JSON.parse(c.trim())),a.settings.debugEnabled&&console.log(b),b)b.hasOwnProperty(d)&&(a.resizedImages[d]=b[d]);a.maybeRaiseImageResolution(),setTimeout(function(){a.afterResize()},500),$("#sbi-builder-app").length&&(window.sbiresizeTriggered=!1)};c(e,f)}else if(a.settings.locator){var b="";void 0!==d.attr("data-locatornonce")&&(b=d.attr("data-locatornonce"));var e={action:"sbi_do_locator",feed_id:a.settings.feedID,atts:a.settings.shortCodeAtts,location:a.locationGuess(),post_id:a.settings.postID,locator_nonce:b},f=function(a){};c(e,f)}},loadMoreButtonInit:function(){var a=$(this.el),b=this;a.find("#sbi_load .sbi_load_btn").off().on("click",function(){b.afterLoadMoreClicked(jQuery(this)),b.getNewPostSet()})},getNewPostSet:function(){var b=$(this.el),a=this;a.page++;var d="";void 0!==b.attr("data-locatornonce")&&(d=b.attr("data-locatornonce"));var e={action:"sbi_load_more_clicked",offset:b.find(".sbi_item").length,page:a.page,feed_id:a.settings.feedID,atts:a.settings.shortCodeAtts,location:a.locationGuess(),post_id:a.settings.postID,current_resolution:a.imageResolution,locator_nonce:d};c(e,function(d){var c=d;"object"!=typeof d&&0===d.trim().indexOf("{")&&(c=JSON.parse(d.trim())),a.settings.debugEnabled&&console.log(c),a.appendNewPosts(c.html),a.addResizedImages(c.resizedImages),a.settings.ajaxPostLoad?(a.settings.ajaxPostLoad=!1,a.afterInitialImagesLoaded()):a.afterNewImagesLoaded(),c.feedStatus.shouldPaginate?a.outOfPages=!1:(a.outOfPages=!0,b.find(".sbi_load_btn").hide()),$(".sbi_no_js").removeClass("sbi_no_js")})},appendNewPosts:function(b){var a=$(this.el);a.find("#sbi_images .sbi_item").length?a.find("#sbi_images .sbi_item").last().after(b):a.find("#sbi_images").append(b)},addResizedImages:function(a){for(var b in a)this.resizedImages[b]=a[b]},setImageHeight:function(){var a=$(this.el),c=a.find(".sbi_photo").eq(0).innerWidth(),d=this.getColumnCount(),b=a.find("#sbi_images").innerWidth()-a.find("#sbi_images").width(),e=b/2;sbi_photo_width_manual=a.find("#sbi_images").width()/d-b,a.find(".sbi_photo").css("height",c),a.find(".sbi-owl-nav").length&&setTimeout(function(){var b=2;a.find(".sbi_owl2row-item").length&&(b=1);var c=a.find(".sbi_photo").eq(0).innerWidth()/b;c+=parseInt(e)*(2+(2-b)),a.find(".sbi-owl-nav div").css("top",c)},100)},maybeRaiseSingleImageResolution:function(a,n,f){var c=this,d=c.getImageUrls(a),e=a.find(".sbi_photo img").attr("src"),h=150,i=a.find("img").get(0),j=e===window.sbi.options.placeholder?1:i.naturalWidth/i.naturalHeight,f=void 0!==f&&f;if(!(a.hasClass("sbi_no_resraise")||a.hasClass("sbi_had_error")||a.find(".sbi_link_area").length&&a.find(".sbi_link_area").hasClass("sbi_had_error"))){if(d.length<1){a.find(".sbi_link_area").length&&a.find(".sbi_link_area").attr("href",window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png"));return}(a.find(".sbi_link_area").length&&a.find(".sbi_link_area").attr("href")===window.sbi.options.placeholder.replace("placeholder.png","thumb-placeholder.png")||!c.settings.consentGiven)&&a.find(".sbi_link_area").attr("href",d[d.length-1]),void 0!==d[640]&&a.find(".sbi_photo").attr("data-full-res",d[640]),$.each(d,function(a,b){b===e&&(h=parseInt(a),f=!1)});var b=640;switch(c.settings.imgRes){case"thumb":b=150;break;case"medium":b=320;break;case"full":b=640;break;default:var k=Math.max(c.settings.autoMinRes,a.find(".sbi_photo").innerWidth()),l=c.getBestResolutionForAuto(k,j,a);switch(l){case 320:b=320;break;case 150:b=150}}if(b>h||e===window.sbi.options.placeholder||f){if(c.settings.debugEnabled){var m=e===window.sbi.options.placeholder?"was placeholder":"too small";console.log("rais res for "+e,m)}var g=d[b].split("?ig_cache_key")[0];if(e!==g&&(a.find(".sbi_photo img").attr("src",g),a.find(".sbi_photo").css("background-image",'url("'+g+'")')),h=b,"auto"===c.settings.imgRes){var o=!1;a.find(".sbi_photo img").on("load",function(){var f=$(this),i=f.get(0).naturalWidth/f.get(0).naturalHeight;if(1e3!==f.get(0).naturalWidth&&i>j&&!o){switch(c.settings.debugEnabled&&console.log("rais res again for aspect ratio change "+e),o=!0,k=a.find(".sbi_photo").innerWidth(),l=c.getBestResolutionForAuto(k,i,a),b=640,l){case 320:b=320;break;case 150:b=150}b>h&&(g=d[b].split("?ig_cache_key")[0],f.attr("src",g),f.closest(".sbi_photo").css("background-image",'url("'+g+'")')),("masonry"===c.layout||"highlight"===c.layout)&&($(c.el).find("#sbi_images").smashotope(c.isotopeArgs),setTimeout(function(){$(c.el).find("#sbi_images").smashotope(c.isotopeArgs)},500))}else if(c.settings.debugEnabled){var m=o?"already checked":"no aspect ratio change";console.log("not raising res for replacement "+e,m)}})}}a.find("img").on("error",function(){if($(this).hasClass("sbi_img_error"))console.log("unfixed error "+$(this).attr("src"));else{if($(this).addClass("sbi_img_error"),!($(this).attr("src").indexOf("media/?size=")> -1||$(this).attr("src").indexOf("cdninstagram")> -1||$(this).attr("src").indexOf("fbcdn")> -1)&&c.settings.consentGiven){if("undefined"!==$(this).closest(".sbi_photo").attr("data-img-src-set")){var a=JSON.parse($(this).closest(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/"));void 0!==a.d&&($(this).attr("src",a.d),$(this).closest(".sbi_photo").css("background-image","url("+a.d+")"),$(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",a[640]).addClass("sbi_had_error"))}}else{c.settings.favorLocal=!0;var a=c.getImageUrls($(this).closest(".sbi_item"));void 0!==a[640]&&($(this).attr("src",a[640]),$(this).closest(".sbi_photo").css("background-image","url("+a[640]+")"),$(this).closest(".sbi_item").addClass("sbi_had_error").find(".sbi_link_area").attr("href",a[640]).addClass("sbi_had_error"))}setTimeout(function(){c.afterResize()},1500)}})}},maybeRaiseImageResolution:function(b){var a=this,c=!a.isInitialized;$(a.el).find(void 0!==b&&!0===b?".sbi_item.sbi_new":".sbi_item").each(function(b){!$(this).hasClass("sbi_num_diff_hide")&&$(this).find(".sbi_photo").length&&void 0!==$(this).find(".sbi_photo").attr("data-img-src-set")&&a.maybeRaiseSingleImageResolution($(this),b,c)}),a.isInitialized=!0},getBestResolutionForAuto:function(d,a,e){(isNaN(a)||a<1)&&(a=1);var b=10*Math.ceil(d*a/10),c=[150,320,640];if(e.hasClass("sbi_highlighted")&&(b*=2),-1===c.indexOf(parseInt(b))){var f=!1;$.each(c,function(c,a){a>parseInt(b)&&!f&&(b=a,f=!0)})}return b},hideExtraImagesForWidth:function(){if("carousel"!==this.layout){var a=$(this.el),b=void 0!==a.attr("data-num")&&""!==a.attr("data-num")?parseInt(a.attr("data-num")):1,c=void 0!==a.attr("data-nummobile")&&""!==a.attr("data-nummobile")?parseInt(a.attr("data-nummobile")):b;480>$(window).width()||"mobile"===window.sbi_preview_device?c120&&b<240?a.addClass("sbi_medium"):b<=120&&a.addClass("sbi_small")},setMinImageWidth:function(){$(this.el).find(".sbi_item .sbi_photo").first().length?this.minImageWidth=$(this.el).find(".sbi_item .sbi_photo").first().innerWidth():this.minImageWidth=150},setImageResolution:function(){if("auto"===this.settings.imgRes)this.imageResolution="auto";else switch(this.settings.imgRes){case"thumb":this.imageResolution=150;break;case"medium":this.imageResolution=320;break;default:this.imageResolution=640}},getImageUrls:function(d){var c=JSON.parse(d.find(".sbi_photo").attr("data-img-src-set").replace(/\\\//g,"/")),a=d.attr("id").replace("sbi_","");if(this.settings.consentGiven||this.settings.overrideBlockCDN||(c=[]),void 0!==this.resizedImages[a]&&"video"!==this.resizedImages[a]&&"pending"!==this.resizedImages[a]&&"error"!==this.resizedImages[a].id&&"video"!==this.resizedImages[a].id&&"pending"!==this.resizedImages[a].id){if(void 0!==this.resizedImages[a].sizes){var b=[];void 0!==this.resizedImages[a].sizes.full&&(c[640]=sb_instagram_js_options.resized_url+this.resizedImages[a].id+"full.jpg",b.push(640)),void 0!==this.resizedImages[a].sizes.low&&(c[320]=sb_instagram_js_options.resized_url+this.resizedImages[a].id+"low.jpg",b.push(320)),void 0!==this.resizedImages[a].sizes.thumb&&(b.push(150),c[150]=sb_instagram_js_options.resized_url+this.resizedImages[a].id+"thumb.jpg"),this.settings.favorLocal&&(-1===b.indexOf(640)&&b.indexOf(320)> -1&&(c[640]=sb_instagram_js_options.resized_url+this.resizedImages[a].id+"low.jpg"),-1===b.indexOf(320)&&(b.indexOf(640)> -1?c[320]=sb_instagram_js_options.resized_url+this.resizedImages[a].id+"full.jpg":b.indexOf(150)> -1&&(c[320]=sb_instagram_js_options.resized_url+this.resizedImages[a].id+"thumb.jpg")),-1===b.indexOf(150)&&(b.indexOf(320)> -1?c[150]=sb_instagram_js_options.resized_url+this.resizedImages[a].id+"low.jpg":b.indexOf(640)> -1&&(c[150]=sb_instagram_js_options.resized_url+this.resizedImages[a].id+"full.jpg")))}}else(void 0===this.resizedImages[a]||void 0!==this.resizedImages[a].id&&"pending"!==this.resizedImages[a].id&&"error"!==this.resizedImages[a].id)&&this.addToNeedsResizing(a);return c},getAvatarUrl:function(a,c){if(""===a)return"";var b=this.settings.general.avatars,c=void 0!==c?c:"local";return"local"===c?void 0!==b["LCL"+a]&&1===parseInt(b["LCL"+a])?sb_instagram_js_options.resized_url+a+".jpg":void 0!==b[a]?b[a]:"":void 0!==b[a]?b[a]:void 0!==b["LCL"+a]&&1===parseInt(b["LCL"+a])?sb_instagram_js_options.resized_url+a+".jpg":""},addToNeedsResizing:function(a){-1===this.needsResizing.indexOf(a)&&this.needsResizing.push(a)},applyImageLiquid:function(){var b,c,d,a,e=$(this.el);(b=b||{VER:"0.9.944"}).bgs_Available=!1,b.bgs_CheckRunned=!1,function(a){a.fn.extend({sbi_imgLiquid:function(c){this.defaults={fill:!0,verticalAlign:"center",horizontalAlign:"center",useBackgroundSize:!0,useDataHtmlAttr:!0,responsive:!0,delay:0,fadeInTime:0,removeBoxBackground:!0,hardPixels:!0,responsiveCheckTime:500,timecheckvisibility:500,onStart:null,onFinish:null,onItemStart:null,onItemFinish:null,onItemError:null},function(){if(!b.bgs_CheckRunned){b.bgs_CheckRunned=!0;var c=a(' ');a("body").append(c),function(){var d=c[0];if(d&&window.getComputedStyle){var a=window.getComputedStyle(d,null);a&&a.backgroundSize&&(b.bgs_Available="cover"===a.backgroundSize)}}(),c.remove()}}();var d=this;return this.options=c,this.settings=a.extend({},this.defaults,this.options),this.settings.onStart&&this.settings.onStart(),this.each(function(g){function h(){function d(){f.data("sbi_imgLiquid_error")||f.data("sbi_imgLiquid_loaded")||f.data("sbi_imgLiquid_oldProcessed")||(e.is(":visible")&&f[0].complete&&f[0].width>0&&f[0].height>0?(f.data("sbi_imgLiquid_loaded",!0),setTimeout(l,g*c.delay)):setTimeout(d,c.timecheckvisibility))}if(f.data("oldSrc")&&f.data("oldSrc")!==f.attr("src")){var b=f.clone().removeAttr("style");return b.data("sbi_imgLiquid_settings",f.data("sbi_imgLiquid_settings")),f.parent().prepend(b),f.remove(),(f=b)[0].width=0,void setTimeout(h,10)}return f.data("sbi_imgLiquid_oldProcessed")?void l():(f.data("sbi_imgLiquid_oldProcessed",!1),f.data("oldSrc",f.attr("src")),a("img:not(:first)",e).css("display","none"),e.css({overflow:"hidden"}),f.fadeTo(0,0).removeAttr("width").removeAttr("height").css({visibility:"visible","max-width":"none","max-height":"none",width:"auto",height:"auto",display:"block"}),f.on("error",i),f[0].onerror=i,d(),void k())}function k(){(c.responsive||f.data("sbi_imgLiquid_oldProcessed"))&&f.data("sbi_imgLiquid_settings")&&(c=f.data("sbi_imgLiquid_settings"),e.actualSize=e.get(0).offsetWidth+e.get(0).offsetHeight/1e4,e.sizeOld&&e.actualSize!==e.sizeOld&&l(),e.sizeOld=e.actualSize,setTimeout(k,c.responsiveCheckTime))}function i(){f.data("sbi_imgLiquid_error",!0),e.addClass("sbi_imgLiquid_error"),c.onItemError&&c.onItemError(g,e,f),j()}function l(){var i,k,l,m,a,b,n,o,d=0,h=0,p=e.width(),q=e.height();void 0===f.data("owidth")&&f.data("owidth",f[0].width),void 0===f.data("oheight")&&f.data("oheight",f[0].height),c.fill===p/q>=f.data("owidth")/f.data("oheight")?(i="100%",k="auto",l=Math.floor(p),m=Math.floor(p*(f.data("oheight")/f.data("owidth")))):(i="auto",k="100%",l=Math.floor(q*(f.data("owidth")/f.data("oheight"))),m=Math.floor(q)),a=c.horizontalAlign.toLowerCase(),n=p-l,"left"===a&&(h=0),"center"===a&&(h=.5*n),"right"===a&&(h=n),-1!==a.indexOf("%")&&(a=parseInt(a.replace("%",""),10))>0&&(h=n*a*.01),b=c.verticalAlign.toLowerCase(),o=q-m,"left"===b&&(d=0),"center"===b&&(d=.5*o),"bottom"===b&&(d=o),-1!==b.indexOf("%")&&(b=parseInt(b.replace("%",""),10))>0&&(d=o*b*.01),c.hardPixels&&(i=l,k=m),f.css({width:i,height:k,"margin-left":Math.floor(h),"margin-top":Math.floor(d)}),f.data("sbi_imgLiquid_oldProcessed")||(f.fadeTo(c.fadeInTime,1),f.data("sbi_imgLiquid_oldProcessed",!0),c.removeBoxBackground&&e.css("background-image","none"),e.addClass("sbi_imgLiquid_nobgSize"),e.addClass("sbi_imgLiquid_ready")),c.onItemFinish&&c.onItemFinish(g,e,f),j()}function j(){g===d.length-1&&d.settings.onFinish&&d.settings.onFinish()}var c=d.settings,e=a(this),f=a("img:first",e);return f.length?(f.data("sbi_imgLiquid_settings")?(e.removeClass("sbi_imgLiquid_error").removeClass("sbi_imgLiquid_ready"),c=a.extend({},f.data("sbi_imgLiquid_settings"),d.options)):c=a.extend({},d.settings,function(){var f={};if(d.settings.useDataHtmlAttr){var g=e.attr("data-sbi_imgLiquid-fill"),a=e.attr("data-sbi_imgLiquid-horizontalAlign"),c=e.attr("data-sbi_imgLiquid-verticalAlign");("true"===g||"false"===g)&&(f.fill=Boolean("true"===g)),void 0===a||"left"!==a&&"center"!==a&&"right"!==a&&-1===a.indexOf("%")||(f.horizontalAlign=a),void 0===c||"top"!==c&&"bottom"!==c&&"center"!==c&&-1===c.indexOf("%")||(f.verticalAlign=c)}return b.isIE&&d.settings.ieFadeInDisabled&&(f.fadeInTime=0),f}()),f.data("sbi_imgLiquid_settings",c),c.onItemStart&&c.onItemStart(g,e,f),void(b.bgs_Available&&c.useBackgroundSize?(-1===e.css("background-image").indexOf(encodeURI(f.attr("src")))&&e.css({"background-image":'url("'+encodeURI(f.attr("src"))+'")'}),e.css({"background-size":c.fill?"cover":"contain","background-position":(c.horizontalAlign+" "+c.verticalAlign).toLowerCase(),"background-repeat":"no-repeat"}),a("a:first",e).css({display:"block",width:"100%",height:"100%"}),a("img",e).css({display:"none"}),c.onItemFinish&&c.onItemFinish(g,e,f),e.addClass("sbi_imgLiquid_bgSize"),e.addClass("sbi_imgLiquid_ready"),j()):h())):void i()})}})}(jQuery),c=b.injectCss,d=document.getElementsByTagName("head")[0],a=document.createElement("style"),a.type="text/css",a.styleSheet?a.styleSheet.cssText=c:a.appendChild(document.createTextNode(c)),d.appendChild(a),"function"==typeof e.find(".sbi_photo").sbi_imgLiquid&&e.find(".sbi_photo").sbi_imgLiquid({fill:!0})},listenForVisibilityChange:function(){var a,b,c,d=this;a=jQuery,b={callback:function(){},runOnLoad:!0,frequency:100,sbiPreviousVisibility:null},(c={}).sbiCheckVisibility=function(b,a){if(jQuery.contains(document,b[0])){var e=a.sbiPreviousVisibility,d=b.is(":visible");a.sbiPreviousVisibility=d,null==e?a.runOnLoad&&a.callback(b,d):e!==d&&a.callback(b,d),setTimeout(function(){c.sbiCheckVisibility(b,a)},a.frequency)}},a.fn.sbiVisibilityChanged=function(d){var e=a.extend({},b,d);return this.each(function(){c.sbiCheckVisibility(a(this),e)})},"function"==typeof $(this.el).filter(":hidden").sbiVisibilityChanged&&$(this.el).filter(":hidden").sbiVisibilityChanged({callback:function(a,b){d.afterResize()},runOnLoad:!1})},getColumnCount:function(){var c=$(this.el),a=this.settings.cols,d=this.settings.colsmobile,e=this.settings.colstablet,b=a;return sbiWindowWidth=window.innerWidth,c.hasClass("sbi_mob_col_auto")?(sbiWindowWidth<640&&parseInt(a)>2&&7>parseInt(a)&&(b=2),sbiWindowWidth<640&&parseInt(a)>6&&11>parseInt(a)&&(b=4),sbiWindowWidth<=480&&parseInt(a)>2&&(b=1)):sbiWindowWidth>480&&sbiWindowWidth<=800?b=e:sbiWindowWidth<=480&&(b=d),parseInt(b)},checkConsent:function(){if(this.settings.consentGiven||!this.settings.gdpr)return!0;if("undefined"!=typeof CLI_Cookie)null!==CLI_Cookie.read(CLI_ACCEPT_COOKIE_NAME)&&(null!==CLI_Cookie.read("cookielawinfo-checkbox-non-necessary")&&(this.settings.consentGiven="yes"===CLI_Cookie.read("cookielawinfo-checkbox-non-necessary")),null!==CLI_Cookie.read("cookielawinfo-checkbox-necessary")&&(this.settings.consentGiven="yes"===CLI_Cookie.read("cookielawinfo-checkbox-necessary")));else if(void 0!==window.cnArgs){var a=("; "+document.cookie).split("; cookie_notice_accepted=");if(2===a.length){var c=a.pop().split(";").shift();this.settings.consentGiven="true"===c}}else void 0!==window.cookieconsent?this.settings.consentGiven="allow"===function(e){for(var c=e+"=",d=window.document.cookie.split(";"),a=0;a