var TB_Export;((e,t,i)=>{"use strict";TB_Export={async init(){let l,r=e.Builder.get().toJSON(!0),o={},a=["background_slider","shortcode_gallery"],_=(e,i)=>{const l=e.styling||e.mod_settings;if(l)for(let e=1;e>-1;--e)if(l[a[e]]&&!l[a[e]].includes("path=")){let r=""+t.hash(l[a[e]]);if(i){if(void 0===i[r])return;let t=i[r].split(" ids");for(let e=t.length-1;e>-1;--e)t[e]=t[e].trim(),"="===t[e][0]&&t.splice(e,1);t=t.join(" "),"]"!==t.slice(-1)&&(t+="]"),l[a[e]]=i[r]=t}else o[r]=l[a[e]]}},d=(e,t)=>{if(e)for(let i=e.length-1;i>-1;--i)if(_(e[i],t),e[i].cols)for(let l=e[i].cols.length-1;l>-1;--l)_(e[i].cols[l],t),d(e[i].cols[l].modules,t)};window.navigator.onLine&&(d(r),Object.keys(o).length>0&&(l=await e.LocalFetch({data:o,action:"builder_prepare_export"})));const n=await l;let p=e.Builder.get().customCss,f=themifyBuilder.post_title,b=new Date,c=b.getFullYear()+"_"+b.getMonth()+"_"+b.getDate(),s=new JSZip,u=e.GS.findUsedItems(r),x=null,w=(e,t)=>{let l=i("a",{download:t,rel:"noopener",href:URL.createObjectURL(e)});setTimeout((()=>{URL.revokeObjectURL(l.href),l=null}),7e3),l.click()};if(n&&d(r,n),r={builder_data:r},p&&(r.custom_css=p.trim()),u){x={};for(let t=u.length-1;t>-1;--t){let i=e.Helper.cloneObject(e.GS.styles[u[t]]);delete i.id,delete i.url,x[u[t]]=i}s.file("builder_gs_data_export.txt",JSON.stringify(x))}s.file("builder_data_export.txt",JSON.stringify(r));try{const e=await s.generateAsync({type:"blob"});w(e,f+"_themify_builder_export_"+c+".zip")}catch(e){x&&(r.used_gs=x),r=JSON.stringify(r),w(new Blob([r],{type:"application/json"}),f+"_themify_builder_export_"+c+".txt")}e.Spinner.showLoader("done")}}})(tb_app,Themify,tb_createElement);