: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
v=v.replaceAll(k,img.src);
let domMedia=doc.querySelectorAll('[src="'+k+'"]');
for(let i=domMedia.length-1;i>-1;--i){
let tagName=domMedia[i].tagName;
if(tagName==='IMG' || tagName==='VIDEO' || tagName==='AUDIO'){
domMedia[i].classList.add('wp-image-'+v.id);
else if(tagName==='VIDEO' ){
domMedia=doc.querySelectorAll('img[data-orig="'+k+'"]');
for(let i=domMedia.length-1;i>-1;--i){
domMedia[i].dataset.orig=v.src;
domMedia[i].classList.add('wp-image-'+v.id);
for(let i=breakpoints.length-1;i>-1;--i){
rules=ThemifyStyles.getSheet(bp).cssRules,
gsRules=ThemifyStyles.getSheet(bp,true).cssRules;
for(let j=rules.length-1;j>-1;--j){
rules[j].style.cssText=rules[j].style.cssText.replaceAll(k,v.src);
for(let j=gsRules.length-1;j>-1;--j){
rules[j].style.cssText=rules[j].style.cssText.replaceAll(k,v.src);
for(let cid of Registry.items.keys()){
setImages(v.get('styling'));
TF_Notification.showHide('done','',100);
oldGrids=api.getColClass()[slug.toString()];
let len=oldGrids?.length || ~~slug;
for (let i = 0; i < len; ++i) {
let _c = oldGrids===undefined ? {} : {
const parentNode=col[0].parentNode,
cl = parentNode.classList;
for (let i = cl.length - 1; i > -1; --i) {
if (cl[i].indexOf('tb_col_count_') === 0) {
cl.add('tb_col_count_' +this.getColumns(parentNode).length);
for(let ch=row.children,i=0;i<ch.length;++i){
if(ch[i].classList.contains('module_column')){
async saveCss(data, customCss, bid,images) {
cssRes=data?await api.GS.createCss(data, data[0]?.mod_name || null,bid, true):'',
cssData=cssRes?JSON.stringify(cssRes):'',
custom_css:customCss?customCss:'',
ajaxData.css=await api.Helper.gzip(cssData);
css=await api.LocalFetch(ajaxData);
css=await api.LocalFetch(ajaxData);
/* new attemp: compile CSS code into binary data and send that to server */
ajaxData.css=new Blob( [ ajaxData.css ], { type: 'application/json' });
css=await api.LocalFetch(ajaxData);
async runJs(el, type, isAjax) {
if (api.activeModel !== null) {
type = api.activeModel.type;
type= Registry.get(el.dataset.cid)?.type;
if (type === 'module' && api.is_builder_ready === true) {
const images = (el || doc).querySelectorAll('img[data-w]:not(.tf_large_img)'),
waitMls=Themify.isTouch?20:5;
for (let i = len - 1; i > -1; --i) {
naturalWidth=img.naturalWidth,
naturalHeight=img.naturalHeight;
if (naturalWidth > 2560 || naturalHeight > 2560) {
img.className += ' tf_large_img';
Themify.largeImages(img);
let w = img.getAttribute('width'),
h = img.getAttribute('height');
if ((w || h) && (Math.abs(naturalWidth-w)>4 || Math.abs(naturalHeight-h)>4)) {
promises.push(new Promise((resolve,reject)=>{
ThemifyImageResize.toBlob(img, w, h).then(resolve).catch(reject);
promises.push(ThemifyImageResize.toBlob(img, w, h));
await Promise.all(promises);
if (el && window.Isotope) {
for (let masonry = Themify.selectWithParent('masonry-done', el),i = masonry.length - 1; i > -1; --i) {
Isotope.data(masonry[i])?.destroy();
masonry[i].classList.remove('masonry-done');
return Themify.reRun(el); // load module js ajax
const bps=themify_vars.breakpoints,
breakpoints = Array.isArray(bps[device]) ? bps[device] : bps[device].toString().split('-');
return breakpoints[breakpoints.length - 1];
scrollTo(el,offset,opt={}) {
opt.top=el.getBoundingClientRect().top-topBody.getBoundingClientRect().top-offset;
el.style.transition = 'none';
this.removeViewPortClass(el);
for (let cl = this._isInViewport(el), i = cl.length - 1; i > -1; --i) {
el.style.transition = '';
removeViewPortClass(el) {
for (let removeCl = ['top', 'left', 'bottom', 'right'],i = 4; i > -1; --i) {
let cl='tb_touch_' + removeCl[i];
const offset = el.getBoundingClientRect(),
docEl=doc.documentElement;
cl.push('tb_touch_left');
} else if (offset.right - 1 >= docEl.clientWidth) {
cl.push('tb_touch_right');
else if(((offset.bottom+ 1) >= docEl.clientHeight) || ((window.innerHeight + window.scrollY) >= body.offsetHeight && (offset.bottom + 20) >= docEl.clientHeight)) {
cl.push('tb_touch_bottom');
})(body,topBody,bodyCl,topWindow);