(($,t,e,i,o,l,s,n,a,r,_,c,d,p,b,u,h,f,m,g,y)=>{"use strict";e.tb_createElement=(e="",i,o)=>{""===e&&(e="div");const l=t.createElement(e,i);return o!==y&&(l.innerHTML=o),l},e.tb_createDocumentFragment=()=>i.createDocumentFragment(),e.tb_createElementNS=(t="",e="")=>{""===t&&(t="svg");const o=i.createElementNS("http://www.w3.org/2000/svg",t);if(""!==e){"string"==typeof e&&(e={class:e});for(let t in e)o.setAttribute(t,e[t])}return o};const w=i.body,k=w.classList,x=k.contains("wp-admin")?e:e.top,{Themify:C,document:S}=x,T=S.body,z=T.classList,I=t.click,E=tb_createDocumentFragment,A=tb_createElement,j=tb_createElementNS;((p,w,v,k)=>{let x=null,C=null;if(!t.builder_url){const e=new URL(i.currentScript.src);e.search="",e.pathname=e.pathname.replace("components.min.js",""),t.builder_url=(""+e).replace("js/editor/build/","")}e.tb_app={breakpointsReverse:o.keys(themify_vars.breakpoints).reverse(),isGSPage:v.contains("gs_post"),isVisual:k!==e,isFrontend:!1,activeBreakPoint:"desktop",activeModel:null,isDocked:!1,zoomMeta:!1,isPreview:!1,scrollTo:!1,is_builder_ready:null,isSafari:/^((?!chrome|android).)*safari/i.test(navigator.userAgent),styleData:{},jsModuleLoaded(){if(null===x){this.inlineEditor=this.isFrontend=this.isVisual;const i=t.builder_url+"js/editor/",o=[t.loadJs(t.url+"js/admin/notification",!!e.TF_Notification)],l=m.addons,s=i+"lazy-components/";if(this.componentsURL=s,l)for(let e in l)o.push(t.loadJs(e,null,l[e]));this.isFrontend&&o.push(t.loadJs(i+"frontend/themify-builder-inline-editing"),t.loadJs("image-resize",!!e.ThemifyImageResize),t.loadJs(s+"correct-col-paddings")),t.isTouch||n((()=>{t.loadJs(s+"right-click")}),1e3),o[0].then((()=>{TF_Notification.init().then((t=>{this.isFrontend&&w.appendChild(t)}))})),x=r.all(o).then((()=>{ThemifyConstructor.init(),n((()=>{t.loadJs(s+"offline"),b.removeItem("tb_visual_templates"),b.removeItem("tb_form_templates_"),setInterval((()=>{z.observer()}),15e3)}),1e4)}))}return x},loadJson(){if(null===C){const i={method:"GET"},l=[];for(let s=m.style_json,n=s.length-1;n>-1;--n)l.push(new r((async(l,a)=>{try{const a=new URL(s[n]),r=e.location.origin;a.origin!==r&&(a.origin=r);const _=await t.fetch("",null,i,""+a);o.assign(this.styleData,_),l()}catch(t){a(t)}})));C=r.all(l)}return C},LocalFetch(e,i,o){if(e.nonce=m.nonce,!e.bid){let t=this.Builder?.get(),i=t?.post_id||t?.id||m.post_ID||"";(""===i||isNaN(i))&&(t=this.Builder?.get(0),i=t?.post_id||t?.id||""),e.bid=i}return this.isFrontend||(e.admin=1),t.trigger("tb_filter_fetch",e),t.fetch(e,i,o)},getColClass:()=>({1:["col-full"],2:["col4-2","col4-2"],3:["col3-1","col3-1","col3-1"],4:["col4-1","col4-1","col4-1","col4-1"],5:["col5-1","col5-1","col5-1","col5-1","col5-1"],6:["col6-1","col6-1","col6-1","col6-1","col6-1","col6-1"],12:["col3-1","col3-2"],21:["col3-2","col3-1"],13:["col4-1","col4-3"],31:["col4-3","col4-1"],112:["col4-1","col4-1","col4-2"],121:["col4-1","col4-2","col4-1"],211:["col4-2","col4-1","col4-1"]}),getColClassValues(){return Array.from(new u([].concat.apply([],o.values(this.getColClass()))))}};const S=tb_app;S.breakpointsReverse.push("desktop"),t.upload_url=m.upload_url,S.jsModuleLoaded(),S.loadJson(),S.Helper={correctBuilderData(t){t&&Array.isArray(t)||(t=t?o.values(t):[]);for(let e=t.length-1;e>-1;--e){let i=t[e];if(i){let{styling:t,cols:e}=i;if(t===y||t&&!Array.isArray(t)||(i.styling={}),e){Array.isArray(e)||(e=i.cols=o.values(e));for(let t=e.length-1;t>-1;--t){let i=e[t];if(i){let{styling:t,modules:e}=i;t===y||t&&!Array.isArray(t)||(i.styling={}),e&&(e=this.correctBuilderData(e))}else e.splice(t,1)}}}else t.splice(e,1)}return t},cloneDom(e,i){if(null===e)return e;if(e[0]!==y&&(e=e[0]),e.nodeType===Node.TEXT_NODE)return e.cloneNode(!0);const o=!0===i?e:e.cloneNode(!0);if(S.isVisual){const e=o.tfTag("video");if(e.length>0)for(let t=e.length-1;t>-1;--t)e[t].pause();for(let t=o.tfClass("tb_dragger"),e=t.length-1;e>-1;--e)t[e].remove();for(let e=t.selectWithParent("[contenteditable]",o),i=e.length-1;i>-1;--i)e[i].contentEditable=!1,e[i].closest(".tb_editor_on")?.classList.remove("tb_editor_on","tb_editor_clicked");for(let e=t.selectWithParent("[draggable]",o),i=e.length-1;i>-1;--i)e[i].setAttribute("draggable","true")}for(let t=o.tfClass("tb_action_wrap"),e=t.length-1;e>-1;--e){let i=t[e];i.replaceChildren(),i.removeAttribute("id"),i.removeAttribute("style")}for(let t=o.querySelectorAll(".tb_del_btn,.tb_add_btn"),e=t.length-1;e>-1;--e)t[e].replaceChildren();const l=o.querySelectorAll(".tb_editor_on,.tb_element_clicked,.tb_selected_img,.tb_editor_clicked,.tb_hide_drag_col_right,.tb_hide_drag_left,.tb_hide_drag_right,.tb_drag_one_column,.tb_drag_side_column,.tb_draggable_item,.tb_column_drag_inner,.tb_active_action_bar,.compact-mode,.tf_dragger_negative");for(let t=l.length-1;t>-1;--t)l[t].classList.remove("tb_element_clicked","tb_editor_on","tb_selected_img","tb_editor_clicked","tb_hide_drag_col_right","tb_hide_drag_left","tb_hide_drag_right","tb_drag_one_column","tb_drag_side_column","tb_draggable_item","tb_column_drag_inner","tb_active_action_bar","compact-mode","tf_dragger_negative");for(let t=o.querySelectorAll("[data-drag-w],[data-pos]"),e=t.length-1;e>-1;--e)t[e].removeAttribute("data-drag-w"),t[e].removeAttribute("data-pos");return o.classList.remove("tb_selected_img","tb_element_clicked","tb_editor_on","tb_editor_clicked","tb_hide_drag_col_right","tb_hide_drag_left","tb_hide_drag_right","tb_drag_one_column","tb_drag_side_column","tb_draggable_item","tb_column_drag_inner","tb_active_action_bar","compact-mode","tf_dragger_negative"),o.removeAttribute("data-drag-w"),o.removeAttribute("data-pos"),o},cloneObject:t=>t?d.parse(d.stringify(t)):{},compareObject(t,e){if(!t||!e)return!0;{const i=t.hasOwnProperty("length")?t.length:o.keys(t).length;if(i!==(e.hasOwnProperty("length")?e.length:o.keys(e).length))return!0;if(i>0)for(let i in t){if(e[i]===y)return!0;if(null!==t[i]&&"object"==typeof t[i]){if("object"!=typeof e[i]||this.compareObject(t[i],e[i]))return!0}else if(e[i]!=t[i]||"object"==typeof e[i]&&"object"!=typeof t[i])return!0}}return!1},isImageUrl(t){if(!t)return!1;const e=t.split("?")[0].split(".");return["jpg","jpeg","tiff","png","gif","bmp","svg","svgz","webp","apng"].includes(e[e.length-1])},limitString(t,e=120){let i="";if(""!==t&&t!==y){const o=A();o.innerHTML=t,i=(t=o.textContent).length>e?t.substr(0,e)+"...":t}return i},loadJsZip:()=>t.loadJs("https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js",!!e.JSZip,!1),toRGBA:t=>ThemifyStyles.toRGBA(t),getIcon(t,e){const i=m.fontello_prefix;if(y!==i){if(RegExp(m.fontello_use_suffix?i+"$":"^"+i).test(t))return A("i",t)}let o="tf_fa "+(t="tf-"+t.trim().replace(" ","-"));e&&(o+=" "+e);const l=j("",o);return l.appendChild(j("use",{href:"#"+t})),l},getLottie(t,e){if(t.path&&t.seg){let i={path:t.path,seg:t.seg},o=A("tf-lottie"),l=A("template");return t.st&&(i.st=t.st),t.sp&&1!=t.sp&&(i.sp=t.sp),t.dir&&(i.dir=t.dir),t.fid&&(i.fid=t.fid),t.r&&"svg"!==t.r&&(i.r=t.r),t.count>1&&(i.count=t.count),e&&(i.sel=e),t.lp||(i={actions:i,loop:1}),l.innerHTML=d.stringify(i),o.appendChild(l),o}return tb_createDocumentFragment()},getColor(t){let e=t.value;if(""!==e)if(null!==t.getAttribute("data-tfminicolors-initialized"))e=jQuery(t).tfminicolors("rgbaString");else{const i=t.dataset.opacity;""!==i&&null!==i&&(e=ThemifyStyles.toRGBA(e+"_"+i))}return e},getBreakpointName:t=>S.ToolBar.el.querySelector(".breakpoint-"+t+" span").textContent,generateUniqueID(){const t=(f.random().toString(36).substr(2,4)+""+(new Date).getUTCMilliseconds()).substr(0,7);return z.get(t)?this.generateUniqueID():t},clearElementId(t,e){for(let o=t.length-1;o>-1;--o){let l=t[o],s=l.styling||l.mod_settings;if(!0===e?l.element_id=this.generateUniqueID():delete l.element_id,s!==y){const t=s.custom_css_id;if(t!==y&&""!==t){let e=1;while(1){let o=1!==e?t+"-"+e:t;if(!i.tfId(o)?.closest(".module_row")){s.custom_css_id=o;break}++e}}let e=s.content_accordion||s.tab_content_tab,o=s.builder_content;if(o!==y&&("string"==typeof o&&(o=d.parse(o)),this.clearElementId(o,!0),s.builder_content=o),e)for(let t=e.length-1;t>-1;--t){let i=e[t].builder_content;i&&("string"==typeof i&&(i=d.parse(i)),this.clearElementId(i,!0),e[t].builder_content=i)}}l.cols!==y?this.clearElementId(l.cols,e):l.modules!==y&&this.clearElementId(l.modules,e)}},async codeMirror(e,i,o={}){try{o.isDarkMode=S.isDarked,await k.Themify.loadJs(t.url+"js/admin/modules/codemirror/codemirror",!!k.ThemifyCodeMiror);const l=new k.ThemifyCodeMiror(e,i,o);return await l.run(),l}catch(t){return null}},async gzip(t){if(!e.CompressionStream||m.gzip_disabled)throw"err";const i=(new TextEncoder).encode(t),o=new CompressionStream("gzip"),l=o.writable.getWriter();l.write(i),l.close();const s=await new Response(o.readable).arrayBuffer();return btoa(String.fromCharCode(...new Uint8Array(s)))}},S.Registry={items:new h,i:new h,observer(){for(let[t,e]of this.items)e.el.isConnected||this.remove(t)},add(t){return this.items.set(t.id,t),this},get(t){return this.items.get(t)||null},remove(t,e=!0){const i=this.get(t);return i&&(i.el.remove(),!0===e&&(this.items.delete(t),this.i.delete(t))),this},destroy(){for(let t of this.items)this.get(t[0])?.el.remove();return this.items.clear(),this.i.clear(),this},on(t,e,i){if(i!==y){const o=this.i.get(t)||{};o[e]??=[],o[e].push(i),this.i.set(t,o)}return this},off(t,e,i){const o=this.i.get(t);if(o!==y)if(e){if(o[e]!==y){if(i){for(let t=o[e].length-1;t>-1;--t)o[e][t]===i&&o[e].splice(t,1);0===o[e].length&&delete o[e]}else delete o[e];this.i.set(t,o)}}else this.i.delete(t);return this},trigger(t,e,...i){const o=this.i.get(t),l=[];if(o?.[e]!==y){let s="string"==typeof t?this.get(t):t;s||(s=t);for(let t=o[e].length-1;t>-1;--t){let n=o[e][t].apply(s,i);n instanceof r&&l.push(n)}}return r.all(l).catch((()=>{}))}};const T=S.isFrontend,z=S.Registry;S.Utils={o:new u,async onResize(i){if(S.isFrontend){const o=$._data(e,"events")?.resize;if(o)for(let t=0;t<o.length;++t)o[t].handler!==y&&this.o.add(o[t].handler);if($(e).off("resize"),i){const i=$.Event("resize",{type:"resize",isTrigger:!1});for(let t of this.o)try{t.call(e,i,$)}catch(t){}t.triggerEvent(e,"resize").trigger("tfsmartresize",{w:t.w,h:t.h})}}},updateDocumentSize(){if(S.isVisual){let e,i;new ResizeObserver((o=>{t.trigger("documentsize"),"desktop"!==S.activeBreakPoint&&(a(i),i=n((()=>{const t=o[0].target;s(e),e=l((()=>{w.style.height=t.scrollHeight+"px",n((()=>{this.onResize(!0),w.style.height=t.scrollHeight+"px",i=e=null}),220)}))}),60))})).observe(p)}},findCssRule(t,e){const i="@"===(e=e.replace(/\s*>\s*/g,">").replace(/\,\s/g,",").trim())[0];for(let o=t.length-1;o>-1;--o)if(!0===i&&t[o].conditionText&&t[o].cssText.replace(/\s*>\s*/g,">").replace(/\,\s/g,",").trim().includes(e)||!1===i&&!t[o].conditionText&&e===t[o].selectorText.replace(/\s*>\s*/g,">").replace(/\,\s/g,",").trim())return o;return!1},l(t){const e=S.getColClassValues();for(let i=t.length-1;i>-1;--i)if(e.includes(t[i]))return t[i];return""},getRowSettings(e,i,l){i=i||"row",l=!!l;let s,n={},a=z.get(e.dataset.cid);if(a){const r=e.tfClass("subrow"===i?"module_subrow":i+"_inner")[0],d=S.Utils.getColumns(r),p=d.length,b=S.breakpointsReverse,u=b.length,h=[],f=["padding_top","padding_bottom","padding_left","padding_right","margin-bottom","margin-top"],m=f.length;for(let e=0;e<p;++e){let i=z.get(d[e].dataset.cid);if(i){let n=d[e].tfClass("tb_holder")[0],a=this.l(d[e].classList),r=h.push({element_id:i.id});if(--r,""!==a&&(h[r].grid_class=a),s=S.Helper.cloneObject(i.get("styling")),s&&o.keys(s).length>0){if(!0===l){if(T)for(let t=m-1;t>-1;--t){let e=f[t];"%"!==s[e+"_unit"]||""===s[e]||s[e]===y||(""+s[e]).includes(",")||(s[e]=","+s[e]);for(let t=u-2;t>-1;--t)if(s["breakpoint_"+b[t]]!==y){let i=s["breakpoint_"+b[t]][e];""===i||i===y||(""+i).includes(",")||"%"!==ThemifyStyles.getStyleVal(e+"_unit",s,b[t])||(s["breakpoint_"+b[t]][e]=","+i)}}i.constructor.builderSave(s)}s&&o.keys(s).length>0&&(h[r].styling=s)}if(n!==y){n=n.children;let e=[];for(let i=0;i<n.length;++i){let a=z.get(n[i].dataset.cid),r=a?.get("mod_name");if(r){s=S.Helper.cloneObject(a.get("mod_settings")),s&&("module"===a.type&&a.parseHtml(s,l),!0===l&&(a.constructor.builderSave(s),t.trigger("tb_save_component",{data:s,slug:r})));let _=e.push({mod_name:r,element_id:a.id});--_,s&&o.keys(s).length>0&&(delete s.cid,e[_].mod_settings=s),"subrow"===a.type&&(e[_]=this.getRowSettings(n[i],"subrow",l))}}e.length>0&&(h[r].modules=e)}}}n={element_id:a.id,cols:h};let g={...a.get("sizes")};if(p>1){for(let t=u-1;t>-1;--t){let e=b[t],i=g[e+"_size"],o=g[e+"_area"],s=g[e+"_auto_h"];if(i){if(i=ThemifyStyles.getColSize(i,!1),i.includes(" ")){i=i.replace(/\s\s+/g," ").split(" ");for(let t=i.length-1;t>-1;--t){let e=c(i[t].trim());1!==e&&(i[t]=i[t].replace(""+e,""+c(e.toFixed(5))))}i=i.join(" ").replaceAll("0.",".").trim()}g[e+"_size"]=i}if(o)if("desktop"===e)delete g[e+"_area"];else if(o.includes(" ")){if(o=o.replaceAll("col","").replace(/\s\s+/g," ").trim(),g[e+"_area"]=o,i&&!i.includes(" ")){let t=a.getGridCss({size:i},e);t["--area"]&&t["--area"].replaceAll("col","").replace(/\s\s+/g," ").trim()===o&&delete g[e+"_area"]}}else ThemifyStyles.getAreaValue(o)||delete g[e+"_area"];s&&(g[e+"_auto_h"]=_(s)),!0===l&&g[e+"_dir"]!==y&&delete g[e+"_dir"]}for(let t=0;t<u-1;++t){let e=b[t],i=g[e+"_gutter"],o=g[e+"_auto_h"],s=g[e+"_size"],n=g[e+"_align"];if(i||n||o||s)for(let a=t+1;a<u;++a){let t=b[a];if(i&&g[t+"_gutter"]&&(g[t+"_gutter"]===i&&delete g[e+"_gutter"],i=null),n&&g[t+"_align"]&&(g[t+"_align"]===n&&delete g[e+"_align"],n=null),o&&g[t+"_auto_h"]&&(g[t+"_auto_h"]===o&&delete g[e+"_auto_h"],o=null),s&&g[t+"_size"]&&(!0===l&&g[t+"_size"]===s&&delete g[e+"_size"],s=null),!(i||n||o||s))break}}if(g.desktop_area){const t=[];for(let e=0;e<p;++e)t.push(e+1);t.join(" ")===g.desktop_area&&delete g.desktop_area}g.mobile_dir===y||g.desktop_dir&&g.desktop_dir!==g.tablet_landscape_dir||g.tablet_dir!==g.mobile_dir||g.tablet_landscape_dir!==g.mobile_dir?"ltr"===g.desktop_dir&&delete g.desktop_dir:(delete g.desktop_dir,delete g.tablet_landscape_dir,delete g.tablet_dir,delete g.mobile_dir),-1===g.desktop_auto_h&&delete g.desktop_auto_h,"start"===g.desktop_align&&!1===S.isFullSection&&delete g.desktop_align,"gutter"===g.desktop_gutter&&delete g.desktop_gutter;for(let t in g)g[t]!==y&&""!==g[t]||delete g[t]}else g={};n.sizes=g,s=S.Helper.cloneObject(a.get("styling")),s&&(delete s.cid,o.keys(s).length>0&&(!0===l&&a.constructor.builderSave(s),n.styling=s))}return n},getAllImages(e){const i=new h,o=new u,l=new u,s=new u,n=e=>{(S.Helper.isImageUrl(e)||e.includes(".mp4")||e.includes(".mpeg")||e.includes(".mp3"))&&(e.includes("themify.me")||e.includes("themify.org")?e.includes(m.site_url)||s.add(e):e.includes(t.urlHost)?o.add(e):l.add(e))},a=t=>{for(let e in t)if(t[e])if(Array.isArray(t[e])||"object"==typeof t[e])a(t[e]);else{let i=(""+t[e]).trim();if(i)if(i.includes("<img ")||i.includes("<video ")||i.includes("<audio ")){let t=A("template");t.innerHTML=i;for(let e=t.content.querySelectorAll("img,video,audio"),i=e.length-1;i>-1;--i){let{src:t,srcset:o}=e[i];o=o?.split(" ")||[],t&&o.push(t);for(let t=o.length-1;t>-1;--t)o[t]&&n(o[t].trim())}}else if("["===i[0]&&i.includes("path=")){let t=i.match(/path.*?=.*?['"](.+?)['"]/gim);if(t?.[0]){t=t[0].split("path=")[1].replaceAll('"',"").replace("'","").split(",");for(let e=t.length-1;e>-1;--e)t[e]&&n(t[e].trim())}}else n(i)}};for(let t of z.items.keys()){let e=z.get(t);e?.el.isConnected&&a(e.get("styling"))}const r=S.Builder.get().el.tfTag("img");for(let t=r.length-1;t>-1;--t){let e=r[t].src,i=r[t].srcset;i=i?.split(" ")||[],e&&i.push(e);for(let t=i.length-1;t>-1;--t)i[t]&&n(i[t].trim())}return i.set("themify",s),i.set("local",o),i.set("external",l),e?i.get(e):i},async importThemifyImages(o){if(!t.urlHost.includes("themify.me"))return o??=this.getAllImages("themify"),o.size>0?new r((async(l,s)=>{try{await t.loadJs(t.url+"js/admin/import/import-images",!!e.TF_ImportImages);const s=~~m.memory||64,n=s>=255?4:s>=120?3:s>60?2:1,a=await TF_ImportImages.init(o,m.nonce,g.uploading,n),r=S.breakpointsReverse,_=t=>{for(let e in t)if(t[e]===y)delete t[e];else if(t[e])if(Array.isArray(t[e])||"object"==typeof t[e])_(t[e]);else{let i=(""+t[e]).trim();if(i&&isNaN(i))if(i.includes("<img ")||i.includes("<video ")||i.includes("<audio ")){let o=A("template");o.innerHTML="<div>"+i+"</div>";let l=o.content.firstChild,s=l.tfTag("img,video,audio");for(let t=s.length-1;t>-1;--t){let e=s[t].src;if(e)for(let[i,o]of a)!1!==o&&e.includes(i)&&(s[t].outerHTML=o.html)}t[e]=l.innerHTML}else if("["===i[0]||!i.includes(" ")){if("["===i[0]&&i.includes("path=")){i=i.replace("path=","ids=");for(let[t,e]of a)!1!==e&&(i=i.replaceAll(t,e.id))}else for(let[t,e]of a)!1!==e&&(i=i.replaceAll(t,e.src));t[e]=i}}};for(let[t,e]of a)if(!1!==e){let o=i.querySelectorAll('[src="'+t+'"]');for(let t=o.length-1;t>-1;--t){let i=o[t].tagName;"IMG"!==i&&"VIDEO"!==i&&"AUDIO"!==i||(o[t].src=e.src,"IMG"===i?o[t].classList.add("wp-image-"+e.id):"VIDEO"===i&&o[t].load())}o=i.querySelectorAll('img[data-orig="'+t+'"]');for(let t=o.length-1;t>-1;--t)o[t].dataset.orig=e.src,o[t].classList.add("wp-image-"+e.id);if(T)for(let i=r.length-1;i>-1;--i){let o=r[i],l=ThemifyStyles.getSheet(o).cssRules,s=ThemifyStyles.getSheet(o,!0).cssRules;for(let i=l.length-1;i>-1;--i)l[i].style.cssText=l[i].style.cssText.replaceAll(t,e.src);for(let i=s.length-1;i>-1;--i)l[i].style.cssText=l[i].style.cssText.replaceAll(t,e.src)}}for(let t of z.items.keys()){let e=z.get(t);e&&_(e.get("styling"))}TF_Notification.showHide("done","",100),l(a)}catch(t){s(t)}})):y},grid(t){const e=[],i=S.getColClass()[""+t];let o=i?.length||~~t;for(let t=0;t<o;++t){e.push(i===y?{}:{grid_class:i[t]})}return[{cols:e}]},setColumnsCount(t){if(t.length>0){const e=t[0].parentNode,i=e.classList;for(let t=i.length-1;t>-1;--t)if(0===i[t].indexOf("tb_col_count_")){i.remove(i[t]);break}i.add("tb_col_count_"+this.getColumns(e).length)}},getColumns(t){const e=[];for(let i=t.children,o=0;o<i.length;++o)i[o].classList.contains("module_column")&&e.push(i[o]);return e},async saveCss(t,e,i,o){let l,s=t?await S.GS.createCss(t,t[0]?.mod_name||null,i,!0):"",n=s?d.stringify(s):"",a={action:"tb_save_css",custom_css:e||"",bid:i,images:o||"",mode:"gzip"};try{if(!n)throw"";if(a.css=await S.Helper.gzip(n),l=await S.LocalFetch(a),!l.write)throw""}catch(t){try{if(a.css=n,delete a.mode,n=null,l=await S.LocalFetch(a),!l.write)throw""}catch(t){try{a.css=new Blob([a.css],{type:"application/json"}),l=await S.LocalFetch(a)}catch(t){throw t}}}return l},async runJs(o,l,s){const a=[];if(S.isVisual&&(l||(null!==S.activeModel?l=S.activeModel.type:o&&(l=z.get(o.dataset.cid)?.type)),"module"===l&&!0===S.is_builder_ready&&t.fonts(o),!0!==s)){const e=(o||i).querySelectorAll("img[data-w]:not(.tf_large_img)"),l=e.length,s=t.isTouch?4:8,_=t.isTouch?20:5;for(let i=l-1;i>-1;--i){let o=e[i],c=o.naturalWidth,d=o.naturalHeight;if(c>2560||d>2560)o.className+=" tf_large_img",t.largeImages(o);else{let t=o.getAttribute("width"),e=o.getAttribute("height");(t||e)&&(f.abs(c-t)>4||f.abs(d-e)>4)&&a.push(l>s?new r(((l,s)=>{n((()=>{ThemifyImageResize.toBlob(o,t,e).then(l).catch(s)}),i*_)})):ThemifyImageResize.toBlob(o,t,e))}}}try{await r.all(a)}catch(t){}if(o&&e.Isotope)for(let e=t.selectWithParent("masonry-done",o),i=e.length-1;i>-1;--i)Isotope.data(e[i])?.destroy(),e[i].classList.remove("masonry-done");return t.reRun(o)},getBPWidth(t){const e=themify_vars.breakpoints,i=Array.isArray(e[t])?e[t]:(""+e[t]).split("-");return i[i.length-1]},scrollTo(t,i,o={}){t&&(i?(o.top=t.getBoundingClientRect().top-w.getBoundingClientRect().top-i,e.scrollTo(o)):t.scrollIntoView(o))},addViewPortClass(t){t.style.transition="none",this.removeViewPortClass(t);for(let e=this.k(t),i=e.length-1;i>-1;--i)t.classList.add(e[i]),t.part.add(e[i]);t.style.transition=""},removeViewPortClass(t){for(let e=["top","left","bottom","right"],i=4;i>-1;--i){let o="tb_touch_"+e[i];t.classList.remove(o),t.part.remove(o)}},k(t){const o=t.getBoundingClientRect(),l=[],s=i.documentElement;return o.left<0?l.push("tb_touch_left"):o.right-1>=s.clientWidth&&l.push("tb_touch_right"),o.top<0?l.push("tb_touch_top"):(o.bottom+1>=s.clientHeight||e.innerHeight+e.scrollY>=p.offsetHeight&&o.bottom+20>=s.clientHeight)&&l.push("tb_touch_bottom"),l}}})(w,T,k,x),((r,b,w,k,C,S,T)=>{const z=t=>i.createTextNode(t);e.ThemifyConstructor={clicked:null,styles:{},settings:{},C:[],afterRun:[],S:[],T:[],I:{},init(){const t=this,e=t.font_select;t.breakpointsReverse=o.keys(themify_vars.breakpoints).reverse(),t.breakpointsReverse.push("desktop"),t.static=m.i18n.options;let i=m.safe;for(let t=0;t<i.length;++t)""!==i[t].value&&"default"!==i[t].value&&(e.safe[i[t].value]=i[t].name);if(i=m.google,Array.isArray(i)){for(let t=0;t<i.length;++t)if(""!==i[t].value&&"default"!==i[t].value){let o=[...i[t].variant];for(let t=o.length-1;t>-1;--t)o[t]="string"==typeof o[t]?o[t].replace("i","italic").replace("r","regular"):""+o[t];e.google[i[t].value]={n:i[t].name,v:o}}}else for(let t in i){e.google[t]={n:i[t].n,v:[...i[t].v]};for(let i=e.google[t].v,o=i.length-1;o>-1;--o)i[o]="string"==typeof i[o]?i[o].replace("i","italic").replace("r","regular"):""+i[o]}if(i=m.cf,Array.isArray(i)){for(let t=0;t<i.length;++t)if(""!==i[t].value&&"default"!==i[t].value){let o=[...i[t].variant];for(let t=o.length-1;t>-1;--t)o[t]="string"==typeof o[t]?o[t].replace("i","italic").replace("r","regular"):""+o[t];e.cf[i[t].value]={n:i[t].name,v:o}}}else for(let t in i){e.cf[t]={n:i[t].n,v:[...i[t].v]};for(let i=e.cf[t].v,o=i.length-1;o>-1;--o)i[o]="string"==typeof i[o]?i[o].replace("i","italic").replace("r","regular"):""+i[o]}m.i18n.options=null},getEl:t=>r.LightBox.el.querySelector("#"+t),getOptions(e){const i="string"!=typeof e,o={};if(i&&e.options!==y)return e.options;for(let t=1;t<21;++t)o[t]=t;const l={on:{name:"",value:"s"},off:{name:"hide",value:"hi"}},s={appearance:[{name:"rounded",value:"rounded"},{name:"gradient",value:"gradient"},{name:"glossy",value:"glossy"},{name:"embossed",value:"embos"},{name:"shadow",value:"sh"}],blend:{"":"",normal:"n",multiply:"multi",screen:"screen",overlay:"overlay",darken:"darken",lighten:"light","color-dodge":"colord","color-burn":"colorb",difference:"diff",exclusion:"excl",hue:"hue",saturation:"sat",color:"c",luminosity:"lum"},text_decoration:[{value:"underline",name:"undl",label_class:"tb_text_underline",icon:"U"},{value:"overline",name:"ovl",label_class:"tb_text_overline",icon:"O"},{value:"line-through",name:"thl",label_class:"tb_text_through",icon:"S"},{value:"none",name:"none",label_class:"tb_text_none",icon:"-"}],text_transform:[{value:"uppercase",name:"ucase",icon:"AB"},{value:"lowercase",name:"lcase",icon:"ab"},{value:"capitalize",name:"cpt",icon:"Ab"},{value:"none",name:"none",icon:"–"}],font_style:[{value:"italic",name:"it",icon:'<span class="tb_font_italic">I</span>'},{value:"normal",name:"n",icon:"N"}],font_weight:[{value:"bold",name:"bold",icon:'<span class="tb_font_bold">B</span>'}],repeat:{repeat:"r_all","repeat-x":"r_h","repeat-y":"r_v","no-repeat":"r_no",fullcover:"fcover"},border:{solid:"solid",dashed:"dashed",dotted:"dotted",double:"double",none:"none"},border_radius:[{id:"top",label:g.top+" "+g.left},{id:"right",label:g.top+" "+g.right},{id:"left",label:g.bottom+" "+g.left},{id:"bottom",label:g.bottom+" "+g.right}],orderBy:{date:"date",ID:"id",author:"author",title:"title",name:"name",modified:"md",rand:"rand",menu_order:"menuord",comment_count:"com_count",meta_value:"cfield"},meta_order:{CHAR:"charact",NUMERIC:"num",DATETIME:"dtime",DATE:"date",TIME:"time"},order:{desc:"descend",asc:"asc"},dateFormat:{"F j, Y":"F_j_Y","Y-m-d":"Y_m_d","m/d/Y":"m_d_Y","d/m/Y":"d_m_Y",def:"def",custom:"cus"},choose:{yes:"y",no:"no"},rchoose:{no:"no",yes:"y"},echoose:{"":"",yes:"y",no:"no"},link_type:[{value:"regular",name:"swin"},{value:"lightbox",name:"lg"},{value:"newtab",name:"ntab"}],link_to:[{value:"permalink",name:"perml"},{value:"media",name:"medf"},{value:"custom",name:"cus"},{value:"none",name:"none"}],display:{"":"",block:"block","inline-block":"inbl",none:"none"},va_display:{"":"",top:"top",middle:"mid",bottom:"bottom"},img_appearance:[{name:"rounded",value:"rounded"},{name:"drop-shadow",value:"dshadow"},{name:"bordered",value:"bordered"},{name:"circle",value:"circle",help:"cimg_app"}],color:[{img:"default",value:"default",label:"def"},{img:"black",value:"black",label:"black"},{img:"grey",value:"gray",label:"gray"},{img:"blue",value:"blue",label:"blue"},{img:"light-blue",value:"light-blue",label:"lblue"},{img:"green",value:"green",label:"green"},{img:"light-green",value:"light-green",label:"lgreen"},{img:"purple",value:"purple",label:"purple"},{img:"light-purple",value:"light-purple",label:"lpurple"},{img:"brown",value:"brown",label:"brown"},{img:"orange",value:"orange",label:"orange"},{img:"yellow",value:"yellow",label:"yellow"},{img:"red",value:"red",label:"red"},{img:"pink",value:"pink",label:"pink"}],visibility:[{type:"separator",label:"visibility"},{id:"visibility_desktop",label:"de",type:"toggle_switch",default:"on",options:l,wrap_class:"tb_module_visibility_control"},{id:"visibility_tablet_landscape",label:"table_landscape",type:"toggle_switch",default:"on",options:l,wrap_class:"tb_module_visibility_control"},{id:"visibility_tablet",label:"tap",type:"toggle_switch",default:"on",options:l,wrap_class:"tb_module_visibility_control"},{id:"visibility_mobile",label:"mo",type:"toggle_switch",default:"on",options:l,wrap_class:"tb_module_visibility_control"},{id:"sticky_visibility",label:"s_v",type:"toggle_switch",options:{on:{name:"hide"}},wrap_class:"tb_module_visibility_control",help:"s_vh"},{id:"visibility_all",label:"h_a",type:"toggle_switch",options:{on:{name:"hide_all"}},binding:{not_checked:{show:"tb_module_visibility_control"},checked:{hide:"tb_module_visibility_control"}},help:"h_ah"}],htags:{h1:"H1",h2:"H2",h3:"H3",h4:"H4",h5:"H5",h6:"H6",div:"divt",p:"pa"},post_grid:[{img:"list_post",value:"list-post",label:"lpost"},{img:"grid2",value:"grid2",label:"grid2"},{img:"grid3",value:"grid3",label:"grid3"},{img:"grid4",value:"grid4",label:"grid4"},{img:"grid5",value:"grid5",label:"grid5"},{img:"grid6",value:"grid6",label:"grid6"}],slider_options:[{id:"effect_slider",type:"select",label:"effect",options:{scroll:"slide",fade:"fade",cube:"cube",flip:"flip",coverflow:"coverflow",continuously:"continuously"},binding:{flip:{hide:["visible_opt_slider","tab_visible_opt_slider","mob_visible_opt_slider","scroll_opt_slider"],show:"auto_scroll_opt_slider"},fade:{hide:["visible_opt_slider","tab_visible_opt_slider","mob_visible_opt_slider","scroll_opt_slider"],show:"auto_scroll_opt_slider"},cube:{hide:["visible_opt_slider","tab_visible_opt_slider","mob_visible_opt_slider","scroll_opt_slider"],show:"auto_scroll_opt_slider"},coverflow:{show:["visible_opt_slider","tab_visible_opt_slider","mob_visible_opt_slider","auto_scroll_opt_slider","scroll_opt_slider"]},scroll:{show:["visible_opt_slider","tab_visible_opt_slider","mob_visible_opt_slider","auto_scroll_opt_slider","scroll_opt_slider"]},continuously:{show:["visible_opt_slider","tab_visible_opt_slider","mob_visible_opt_slider","scroll_opt_slider"],hide:"auto_scroll_opt_slider"}}},{id:"items_per_slide",type:"number",label:"itemxslide",default:1},{id:"visible_opt_slider",type:"select",options:o,label:"visibsl"},{id:"tab_visible_opt_slider",type:"select",options:o,label:"tvisibsl"},{id:"mob_visible_opt_slider",type:"select",options:o,label:"mvisibsl"},{id:"auto_scroll_opt_slider",type:"select",label:"ascroll",default:"off",options:{1:"1s",2:"2s",3:"3s",4:"4s",5:"5s",6:"6s",7:"7s",8:"8s",9:"9s",10:"10s",15:"15s",20:"20s",off:"off"},binding:{off:{hide:["pause_on_hover_slider","play_pause_control"]},select:{show:["pause_on_hover_slider","play_pause_control"]}}},{id:"scroll_opt_slider",type:"select",options:{1:1,2:2,3:3,4:4,5:5,6:6,7:7},label:"scroll"},{id:"speed_opt_slider",type:"range",increment:.1,min:.1,max:99.9,label:"speed",help:"speedh"},{id:"pause_on_hover_slider",type:"toggle_switch",options:{on:{name:"resume",value:"y"},off:{name:"0",value:"no"}},label:"pauseonh",default:"on"},{id:"play_pause_control",type:"toggle_switch",options:"simple",label:"plpausebtn",default:"off"},{id:"wrap_slider",type:"toggle_switch",options:"simple",label:"wrap",default:"on"},{id:"show_nav_slider",type:"toggle_switch",options:"simple",label:"pagin",default:"on"},{id:"show_arrow_slider",type:"toggle_switch",label:"slarrs",options:"simple",binding:{no:{hide:"show_arrow_buttons_vertical"},select:{value:"no",show:"show_arrow_buttons_vertical"}},default:"on"},{id:"touch_swipe",type:"select",label:"touchsw",options:{"":"alldevice",touch:"tdevice",no:"dis"}},{id:"show_arrow_buttons_vertical",type:"toggle_switch",label:"disarrmid",options:{on:{name:"vertical",value:"y"},off:{name:"",value:"no"}}},{id:"left_margin_slider",type:"number",label:"lmarg",after:"px"},{id:"right_margin_slider",type:"number",label:"rmarg",after:"px"},{id:"height_slider",type:"select",options:{variable:"var",auto:"auto"},label:"ht",help:"slhthelp"}],ac:[{value:"inherit",name:"n"},{value:"start",name:"start"},{value:"center",name:"center"},{value:"end",name:"end"},{value:"space-between",name:"spcbtw"},{value:"space-around",name:"spcarn"},{value:"space-evenly",name:"spcevn"},{value:"stretch",name:"sttch"}],ji:[{value:"inherit",name:"n"},{value:"baseline",name:"bslne"},{value:"start",name:"start"},{value:"center",name:"center"},{value:"end",name:"end"},{value:"stretch",name:"sttch"}]};s.jc=[...s.ac],s.ai=[...s.ji],s.as=[...s.ji],s.js=[...s.jc],s.js.length=4,s.js.push(s.jc.at(-1)),s.jc.pop(),s.ji.pop();for(let e=["ji","jc","as","ai","ac","js"],i=e.length-1;i>-1;--i){let o=e[i],l=s[o];for(let e=l.length-1;e>-1;--e){let i=l[e].value;"baseline"!==i&&("as"===o?o="ai":"js"===o&&(o="jc"),i="inherit"===i?"normal":o+"-"+i),l[e]={icon:'<svg class="tb_align"><use href="'+t.builder_url+"css/editor/img/alignment.svg#"+i+'"/></svg>',...l[e]}}}const n={...s.as[0]};if(n.name=n.value="auto",s.as[0]=s.js[0]=n,!this.static.aligment2){this.static.aligment=[{value:"left",name:"left",icon:r.Helper.getIcon("ti-align-left").outerHTML},{value:"center",name:"center",icon:r.Helper.getIcon("ti-align-center").outerHTML},{value:"right",name:"right",icon:r.Helper.getIcon("ti-align-right").outerHTML},{value:"justify",name:"just",icon:r.Helper.getIcon("ti-align-justify").outerHTML}],this.static.aligment2=this.static.aligment.slice(0,3),this.static.h_tags={};for(let t=6;t>0;--t)this.static.h_tags["h"+t]="H"+t;const t={};for(let e=this.breakpointsReverse,i=e.length-1;i>-1;--i){let o,l=e[i],s="";"desktop"===l?o={id:"stick_at_check",type:"checkbox",options:[{name:"stick_at_check",value:"stickat"}],binding:{not_checked:{hide:["unstick_wr","stick_wr"]},checked:{show:["unstick_wr","stick_wr"]}}}:(s="tablet_landscape"===l?"_tl":"_"+l[0],o={id:"stick_at_check"+s,type:"radio",option_js:!0,options:[{value:"",name:"inher"},{value:"1",name:"en"},{value:"0",name:"dis"}]}),t[l]={icon:"ti-"+("tablet_landscape"===l?"tablet":l),title:r.Helper.getBreakpointName(l),class:"tablet_landscape"===l?"tab_tablet_landscape":"",label:"",options:[{type:"group",wrap_class:"stick_middle_wrapper",options:[o,{type:"group",wrap_class:"stick_wr tb_group_element_1",options:[{id:"stick_at_position"+s,type:"select",options:{top:"toppos",bottom:"botpos"}},{id:"stick_at_pos_val"+s,type:"range",units:{px:{max:1e6},"%":""},after:"ofs"}]}]},{type:"group",wrap_class:"stick_middle_wrapper unstick_wr tb_group_element_1",options:[{id:"unstick_when_check"+s,type:"checkbox",options:[{name:"unstick_when_check",value:"unstwhn"}],binding:{not_checked:{hide:"unstick_when_wr"},checked:{show:"unstick_when_wr"}}},{type:"group",wrap_class:"unstick_when_wr",options:[{id:"unstick_when_element"+s,type:"select",options:{builder_end:"bcontend",row:"row",module:"module"},binding:{builder_end:{hide:"unstick_opt_wr"},row:{show:["unstick_opt_wr","unstick_row"],hide:"unstick_module"},module:{show:["unstick_opt_wr","unstick_module"],hide:"unstick_row"}}},{type:"group",wrap_class:"unstick_opt_wr tf_inline_b",options:[{id:"unstick_when_el_row_id"+s,type:"sticky",wrap_class:"unstick_row",key:"row"},{id:"unstick_when_el_mod_id"+s,type:"sticky",wrap_class:"unstick_module",key:"module"},{id:"unstick_when_condition"+s,type:"select",options:{hits:"hits",passes:"passes"}},{id:"unstick_when_pos"+s,type:"select",options:{this:"thisel",top:"viewpt",bottom:"viewpb"},binding:{this:{hide:"unstick_when_pos_val"+s},top:{show:"unstick_when_pos_val"+s},bottom:{show:"unstick_when_pos_val"+s}}},{id:"unstick_when_pos_val"+s,type:"range",units:{px:{max:1e5},"%":""}}]}]}]}]}}this.static.animation=[{type:"separator",label:"animation"},{type:"multi",label:"entran",options:[{id:"animation_effect",type:"animation_select"},{id:"animation_effect_delay",type:"number",after:"delay",step:.1},{id:"animation_effect_repeat",type:"number",after:"r"}]},{type:"animation_select",label:"hanim",id:"hover_animation_effect"},{type:"separator",label:"s_e_f"},{type:"tabs",isRadio:!0,id:"animation_effect_tab",options:{s_e_m:[{id:"motion_effects",type:"accordion",options:{v:{label:"vscrl",options:[{id:"v_dir",type:"select",label:"dir",options:{"":"",up:"_up",down:"dwn"},binding:{empty:{hide:["v_speed","v_vp"]},not_empty:{show:["v_speed","v_vp"]}}},{id:"v_speed",type:"slider_range",label:"speed",options:{min:1,max:10,unit:"",range:!1,default:1}},{id:"v_vp",type:"slider_range",label:"viewp"}]},h:{label:"hrztalscl",options:[{id:"h_dir",type:"select",label:"dir",options:{"":"",toleft:"tolft",toright:"torgt"},binding:{empty:{hide:["h_speed","h_vp"]},not_empty:{show:["h_speed","h_vp"]}}},{id:"h_speed",type:"slider_range",label:"speed",options:{min:1,max:10,unit:"",range:!1,default:1}},{id:"h_vp",type:"slider_range",label:"viewp"}]},t:{label:"trnspncy",options:[{id:"t_dir",type:"select",label:"dir",options:{"":"",fadein:"fadein",fadeout:"fadout",fadeoutin:"fadoutin",fadeinout:"fadinout"},binding:{empty:{hide:"t_vp"},not_empty:{show:"t_vp"}}},{id:"t_vp",type:"slider_range",label:"viewp"}]},b:{label:"bl",options:[{id:"b_dir",type:"select",label:"dir",options:{"":"",fadein:"fadein",fadeout:"fadout"},binding:{empty:{hide:["b_level","b_vp"]},not_empty:{show:["b_level","b_vp"]}}},{id:"b_level",type:"slider_range",label:"lvl",options:{min:1,max:10,unit:"",range:!1,default:1}},{id:"b_vp",type:"slider_range",label:"viewp"}]},r:{label:"ro",options:[{id:"r_dir",type:"select",label:"dir",options:{"":"",toleft:"tolft",toright:"torgt"},binding:{empty:{hide:["r_num","r_origin","r_vp"]},not_empty:{show:["r_num","r_origin","r_vp"]}}},{id:"r_num",type:"range",label:"nspins",units:{"":{min:.05,increment:.1}}},{id:"r_origin",type:"position_box",label:"trorig"},{id:"r_vp",type:"slider_range",label:"viewp"}]},s:{label:"sc",options:[{id:"s_dir",type:"select",label:"dir",options:{"":"",up:"scup",down:"scdwn"},binding:{empty:{hide:["s_ratio","s_origin","s_vp"]},not_empty:{show:["s_ratio","s_origin","s_vp"]}}},{id:"s_ratio",type:"range",label:"scrat",units:{"":{min:1,max:30,increment:.1}}},{id:"s_origin",type:"position_box",label:"trorig"},{id:"s_vp",type:"slider_range",label:"viewp"}]}}}],s_e_s:[{type:"tabs",options:t}]}}]}if(i){for(let t in s)if(!0===e[t])return s[t];for(let t in this.static)if(!0===e[t])return this.static[t]}else{if(s[e]!==y)return s[e];if(this.static[e]!==y)return this.static[e]}return!1},A:t=>"custom_css"===t.type?g.custom_css:"title"===t.type?g.m_t:t.label!==y&&(g[t.label]!==y?g[t.label]:t.label),L(){const t=A("","tb_lightbox_switcher"),e=this.breakpointsReverse;for(let i=e.length-1;i>-1;--i){let o=e[i],l=A("button",{class:"tab_"+o,"data-href":"#"+o,title:"tablet_landscape"===o?g.table_landscape:o.charAt(0).toUpperCase()+o.substr(1)});l.appendChild(r.Helper.getIcon("ti-"+("tablet_landscape"===o?"tablet":o))),t.appendChild(l)}return t.tfOn(b,(function(t){if(t.stopImmediatePropagation(),t.target!==this){const e=t.target.closest("button")?.dataset.href.replace("#","");e&&e!==r.activeBreakPoint&&r.ToolBar.breakpointSwitcher(e)}}),{passive:!0})},M(e,i,o,l){let s=!1;const{binding:n,type:a}=i;if("select"===a&&0==o&&(o=""),"video"===a)if(""===o)s=n.empty;else{const e=t.parseVideo(o);if("youtube"===e.type||"vimeo"===e.type)s=n.external;else{let t;try{t=new URL(o)}catch(e){t=!1}s=!1!==t&&x.location.hostname===t.hostname?n.local:n.empty}}else o||n.empty===y?n[o]===y||!o&&"select"!==a?o&&n.not_empty!==y?s=n.not_empty:n.select!==y&&o!==n.select.value?s=n.select:n.checked!==y&&!0===e.checked?s=n.checked:n.not_checked!==y&&!1===e.checked&&(s=n.not_checked):s="radio"===a||"icon_radio"===a?!0===e.checked&&n[o]:n[o]:s=n.empty;if(s){l!==y&&null!==l&&0!==l.length||(l=e.closest(".tb_tab,.tb_expanded_opttions")||this.getEl("tb_lightbox_container"));const t=s.hide!==y,i=s.show!==y,o=[],n=this.R[this.clicked].options,a=(t,e)=>{let i;if(y!==e&&t!==y)for(let o=t.length-1;o>-1;--o){if(t[o].id===e){i=t[o];break}if(t[o].options!==y&&Array.isArray(t[o].options)&&(i=a(t[o].options,e),i!==y))break}return i},_=(t,e,i)=>{const o=t.dataset.type;let l;"radio"===o?l=t.querySelector("input:checked")||t.tfTag("input")[0]:"checkbox"===o||"toggle_switch"===o?l=t.tfTag("input")[0]:"select"===o&&(l=t.tfTag("select")[0]),l&&this.M(l,e,l.value,i)};!0!==i||Array.isArray(s.show)||(s.show=[s.show]),!0!==t||Array.isArray(s.hide)||(s.hide=[s.hide]);let c=!0===i?s.show:[];!0===t&&(c=c.concat(s.hide));for(let e=0,r=c.length;e<r;++e){if(!0===t&&s.hide[e]!==y){let t=0===s.hide[e].indexOf("#")?s.hide[e]:"."+s.hide[e],i=l.querySelectorAll(t);for(let t=i.length-1;t>-1;--t)if(i[t].classList.add("_tb_hide_binding"),null!==this.component){let l=a(n,s.hide[e]);l?.binding&&o.push({N:i[t],D:l})}}if(!0===i&&s.show[e]!==y){let t=0===s.show[e].indexOf("#")?s.show[e]:"."+s.show[e],i=l.querySelectorAll(t);for(let t=i.length-1;t>-1;--t)if(i[t].classList.remove("_tb_hide_binding"),null!==this.component){let l=a(n,s.show[e]);l?.binding&&o.push({N:i[t],D:l})}}}for(let t=o.length-1;t>-1;--t)_(o[t].N,o[t].D,l);if(s.responsive?.disabled!==y){Array.isArray(s.responsive.disabled)||(s.responsive.disabled=[s.responsive.disabled]);const t="desktop"!==r.activeBreakPoint;for(let e=s.responsive.disabled.length-1;e>-1;--e)if(s.responsive.disabled[e]!==y){let i=0===s.responsive.disabled[e].indexOf("#")?s.responsive.disabled[e]:"."+s.responsive.disabled[e],o=l.querySelectorAll(i);for(let i=o.length-1;i>-1;--i)o[e].classList.toggle("tb_responsive_disable",t)}}}},control:{init(t,e,i){i.name=e,this[e].call(this,t,i)},preview(t,e,i){if(!t?.isConnected)return;const o=ThemifyConstructor,l=t.closest(".tb_toggleable_fields")||t.closest(".tb_sort_fields_parent")||t.closest(".tb_row_js_wrapper"),s=r.activeModel;if(null!==l){const t=r.Forms.parseSettings(l);o.settings[t.id]=t.v}else o.settings[i.id]=e;if(r.isVisual){let n=null;if(i.selector!==y&&e)if(n=s.el.querySelectorAll(i.selector),0===n.length)n=null;else if(null!==l){const e=t.closest(".tb_repeatable_field");let o=l.children,a=null;for(let t=o.length-1;t>-1;--t)if(o[t]===e){a=t;break}if(i.rep!==y?(n=s.el.querySelectorAll(i.rep),n[a]!==y&&(o=n[a].querySelectorAll(i.selector),0===o.length&&(o=null))):o=null!==a&&n[a]!==y?[n[a]]:null,null!==o&&o!==y){n=[];for(let t=o.length-1;t>-1;--t){let e=o[t].closest(".tf_swiper-slide");if(null!==e){let l=e.closest(".tf_swiper-wrapper");if(null!==l){let e=l.querySelectorAll('.tf_swiper-slide[data-swiper-slide-index="'+a+'"]'),s=e.length;if(0!==s)for(let t=s-1;t>-1;--t)for(let o=e[t].querySelectorAll(i.selector),l=o.length-1;l>-1;--l)n.push(o[l]);else n.push(o[t])}}else n.push(o[t])}}else n=null}"refresh"===i.type||!0===o.P?s.previewReload(o.settings,n,e):s.previewLive(o.settings,"wp_editor"===i.name||"TEXTAREA"===t.tagName,n,e)}else"setting"===o.clicked&&s.backendLivePreview(o.settings)},change(t,e){let i;t.tfOn(e.event||"change",(t=>{let o=50,l=t.target;"change"===t.type?o=1:"refresh"===e.type&&e.selector===y&&(o=1e3),a(i),i=n((()=>{if(l.isConnected){let i=l.value;if("keyup"===t.type){if(i===l.dataset.oldValue)return;l.dataset.oldValue=i}if("SELECT"===l.nodeName&&l.multiple){i=[];for(let t=l.selectedOptions,e=0;e<t.length;++e)i.push(t[e].value)}this.preview(l,i,e)}i=null}),o)}),{passive:!0})},wp_editor(e,i){let o,l=this,s=e.id,n=!1,_=!1,c=function(){const e="function"==typeof this.getContent?this.getContent():this.value;if(a(o),null!==r.activeModel&&n!==e){if(n=e,!1!==_){if(!i.id){const t=this.id.split("_");t[1]&&r.LightBox.el.querySelector('textarea.sync-input[name="'+t[1]+'"]')&&(i.id=t[1])}if(i.id){const o=r.LightBox.el.querySelector('textarea.sync-input[name="'+i.id+'"]');if(o&&o!==this)return o.value=e,void t.triggerEvent(o,"change")}}this.targetElm?l.preview(this.targetElm,e,i):("undefined"!=typeof tinyMCE&&tinymce.get(this.id)?.setContent(e),l.preview(this,e,i)),o=null}},d=r.LightBox.el.querySelectorAll(".wrap > #message");for(let t=d.length-1;t>-1;--t)d[t].id="wp-message";if("function"==typeof x.QTags&&(x.quicktags({id:s}),x.QTags._buttonsInit()),"undefined"!=typeof tinyMCE){tinymce.editors[s]!==y&&tinyMCE.execCommand("mceRemoveEditor",!0,s);const t=tinyMCEPreInit.mceInit.tb_lb_hidden_editor;t.target=ThemifyConstructor.getEl(s.replace("#",""));const i=new tinyMCE.Editor(s,t,tinyMCE.EditorManager);_=!!e.classList.contains("wp-editor-area")&&null!==e.closest("#instance_widget"),i.render(),i.on("change",c),_||i.on("keyup",c)}e.tfOn("change keyup",c,{passive:!0})},layout(t,e){r.isVisual&&t.tfOn("change",(t=>{let i=t.currentTarget,o=""+t.detail.val;if(0===o.indexOf("grid-")?o=o.replace("grid-","grid"):isNaN(o)||(o="grid"+o),e.classSelector!==y&&"auto_tiles"!==o){let t=e.id,l=r.liveStylingInstance.el,s=""!==e.classSelector?l.querySelector(e.classSelector):l.tfClass("module")[0],n=ThemifyConstructor.settings[t];ThemifyConstructor.settings[t]=o,s?(s=s.classList,n&&(n=""+n,e.prefix&&(n=e.prefix+n),0===n.indexOf("grid-")?n=n.replace("grid-","grid"):isNaN(n)||(n="grid"+n),"grid1"===n?n="list-post":"default"===n&&(n="tb_default_color"),s.remove(n)),o&&(e.prefix&&(o=e.prefix+o),"grid1"===o?o="list-post":"default"===o&&(o="tb_default_color"),s.add(o)),r.Utils.runJs(l,"module")):this.preview(i,o,e)}else this.preview(i,o,e)}),{passive:!0})},icon(t,e){t.tfOn("change",(t=>{const i=t.target,o=i.value,l=i.closest(".tb_field").tfClass("themify_fa_toggle")[0];l!==y&&(l.firstChild?.remove(),o&&l.appendChild(r.Helper.getIcon(o))),this.preview(i,o,e)}),{passive:!0})},checkbox(t,e){r.isVisual&&t.tfOn("change",(t=>{const i=t.currentTarget,o=[],l=i.closest(".tb_checkbox_wrap").tfClass("tb_checkbox");for(let t=0;t<l.length;++t)l[t].checked&&o.push(l[t].value);this.preview(i,o.join("|"),e)}),{passive:!0})},color(t,e){r.isVisual&&t.tfOn("themify_builder_color_picker_change",(t=>{this.preview(t.currentTarget,t.detail.val,e)}),{passive:!0})},widget_select(t,e){this.preview(t,r.Forms.serializeObject(t),e)},queryPosts(t,e){r.isVisual&&t.tfOn("queryPosts",(t=>{const i=t.currentTarget;e.id=i.id,ThemifyConstructor.settings=r.Forms.serialize("tb_options_setting"),this.preview(i,ThemifyConstructor.settings[e.id],e)}),{passive:!0})},builderEdit(t,e){t.tfOn(b,(t=>{t.stopPropagation(),r.activeModel?.builderContentEdit(t.currentTarget)}),{passive:!0})}},O(t,e){if(null!==r.activeModel){if("setting"===this.clicked&&"custom_css"!==e.type){if(!1!==e.control&&"module"===this.component){const i=e.control||{};let o=e.type;!0===i.repeat?i.id=t.dataset.inputId:!0===this.is_repeat?(i.repeat=!0,i.id=t.dataset.inputId):i.id=e.id,i.control_type===y?o!==y&&"text"!==o&&"number"!==o&&"taxonomy"!==o&&"url"!==o&&"autocomplete"!==o&&"range"!==o&&"radio"!==o&&"icon_radio"!==o&&"select"!==o&&"gallery"!==o&&"textarea"!==o&&"address"!==o&&"image"!==o&&"file"!==o&&"lottie"!==o&&"date"!==o&&"audio"!==o&&"video"!==o&&"widgetized_select"!==o&&"layoutPart"!==o&&"selectSearch"!==o&&"hidden"!==o&&"toggle_switch"!==o&&"slider_range"!==o&&"orderby_post"!==o||(i.event!==y||"text"!==o&&"textarea"!==o||(i.event="keyup"),o="change"):o=i.control_type,this.control.init(t,o,i)}}else r.isVisual&&"styling"===this.clicked&&r.liveStylingInstance.bindEvents(t,e);if(e.binding!==y){const i=!0===this.is_repeat,o=(o,l)=>{const s=i?t.closest(".tb_sort_field_dropdown,.tb_toggleable_fields_options,.tb_repeatable_field_content"):y;this.M(o,e,l,s)};"layout"===e.type||"frame"===e.type?t.tfOn(b,(function(t){const e=t.target.closest(".tfl-icon");null!==e&&o(this,e.id)}),{passive:!0}):t.tfOn("change",(function(){o(this,this.value)}),{passive:!0}),this.T.push({el:t,data:e,repeat:i})}}return t},callbacks(){const t=this,{T:e,S:i,afterRun:o}=t;if(null!==o){for(let t=0;t<o.length;++t)o[t].call();t.afterRun=[]}if(null!==i){for(let t=0;t<i.length;++t)i[t].call();t.S=[]}if(null!==e){for(let i=e.length-1;i>-1;--i)if(e[i].data!==y){let o=e[i].el,l=!0===e[i].repeat?o.closest(".tb_sort_field_dropdown,.tb_toggleable_fields_options,.tb_repeatable_field_content"):y,s="layout"===e[i].data.type||"frame"===e[i].data.type?o.tfClass("selected")[0].id:o.value;t.M(o,e[i].data,s,l)}t.T=[]}},B(){if("setting"===this.clicked){const t=this.C;for(let e=t.length-1;e>-1;--e)this.O(t[e].el,t[e].data);this.C=[]}},switchTabs(){const e="#"+this.dataset.id,i=this.parentNode,o=i.parentNode,l=o.parentNode,s=e.replace("#tb_options_","");let n=l.querySelector(e);if(n&&n.parentNode===l||(n=this.getRootNode().querySelector(e)),!n||i.classList.contains("current"))return;const a=o.children,r=n.parentNode.children;for(let t=a.length-1;t>-1;--t)a[t].classList.remove("current");i.classList.add("current");for(let t=r.length-1;t>-1;--t)r[t].classList.contains("tb_tab")&&(r[t].style.display="none");n.style.display="block",t.trigger("tb_builder_tabsactive",[s,n]),t.triggerEvent(n,"tb_builder_tabsactive",{id:s})},run(e){let i,o=r.activeModel,l=this;l.styles={},l.settings={},l.C=[],l.afterRun=[],l.S=[],l.T=[],l.I={},l.is_repeat=l.is_sort=l.component=l.is_new=l.P=l.type=null,l.R=e,null!==o?(l.type=o.get("mod_name"),l.component=o.type,"module"===l.component&&(l.P="ajax"===o.getPreviewType(),l.is_new=!!o.is_new),l.values=r.Helper.cloneObject(o.get("mod_settings")),i=o.tab||"setting",delete o.tab,l.R.visibility??=!0,l.R.animation??=!0):(l.values={},l.component=null);const s=E(),a=E(),_={styling:"ti-brush",animation:"ti-layers-alt",visibility:"ti-eye"},c=(t,e)=>{const i=E();if("visibility"===t||"animation"===t)e=l.getOptions(t);else if("styling"===t&&r.LightBox.el.tfClass("tb_styling_tab_header")[0]===y){const t=A("","tb_styling_tab_header"),e=r.GS.globalStylesHTML();t.appendChild(l.L()),e&&t.appendChild(e),i.appendChild(t)}if(i.appendChild(l.create(e)),"styling"===t){const t=A("a",{href:"#",class:"reset-styling"}),e=A("i","tf_close");t.tfOn(b,(t=>{t.stopPropagation(),t.preventDefault(),this.resetStyling(r.activeModel)})).append(e,z(g.reset_style)),i.appendChild(t),r.isVisual&&o&&n((()=>{r.liveStylingInstance.module_rules=l.styles}),600)}return e=null,i},d=function(e){const i=e.detail.id.replace("#tb_options_","");l.clicked=i,this.dataset.done===y&&(this.dataset.done=!0,this.appendChild(c(i,l.R[i].options)),l.callbacks(),l.B(),t.trigger("tb_editing_"+l.type+"_"+i,r.LightBox.el))};l.clicked=null;for(let t in l.R){let e=l.R[t];if(!1===e)continue;let o="tb_options_"+t,n=e.name!==y?g[e.name]||e.name:g[t],p=A("li"),u=A("a",{href:"javascript:;","data-id":o},n),h=A("span"),f=A("",{id:o,class:"tb_tab tb_options_tab_wrapper tf_rel tf_box tf_w tf_hide"});"setting"!==t&&(u.className="tb_tooltip",h.textContent=n,_[t]&&u.appendChild(r.Helper.getIcon(_[t])),u.appendChild(h)),i!==t&&i!==y||(p.className="current",l.clicked=t,e.html!==y?f.innerHTML=e.html:f.appendChild(c(t,e.options)),f.style.display="block",f.dataset.done=!0),f.tfOn("tb_builder_tabsactive",d,{passive:!0}),u.tfOn(b,l.switchTabs,{passive:!0}),a.appendChild(f),p.appendChild(u),s.appendChild(p)}const p=r.LightBox.el.tfClass("tb_options_tab")[0],u=(t,e)=>{l.F(t,e)};return p?.replaceChildren(s),t.on("themify_builder_lightbox_close",(()=>{if(l.S=l.afterRun=l.T=l.C=[],l.I=l.settings=l.styles={},l.P=l.is_repeat=l.is_sort=l.clicked=null,"undefined"!=typeof tinyMCE)for(let t=tinymce.editors.length-1;t>-1;--t)"content"!==tinymce.editors[t].id&&tinyMCE.execCommand("mceRemoveEditor",!0,tinymce.editors[t].id);t.off("themify_builder_change_mode",u),l.values={},l.tabs.click=0,l.tabs.styleClicked=!1,o=l.type=l.component=l.is_new=l.R=l=null}),!0).on("themify_builder_change_mode",u),n((()=>{l.B(),l.callbacks(),t.trigger("tb_editing_"+l.type+"_"+l.clicked,r.LightBox.el),t.trigger("tb_editing_"+l.component,r.LightBox.el)}),5),a},getStyleVal(t,e,i){let o=y;if(t!==y&&""!==t&&null!==r.activeModel){if(i===y&&(i=this.values),e===y&&(e=r.activeBreakPoint),"desktop"===e||"styling"!==this.clicked)null!==i&&""!==i[t]&&(o=i[t]);else if(i["breakpoint_"+e]!==y&&i["breakpoint_"+e][t]!==y&&""!==i["breakpoint_"+e][t])o=i["breakpoint_"+e][t];else{const l=this.breakpointsReverse;for(let s=l.indexOf(e)+1;s<l.length;++s){let e=l[s];if("desktop"!==l[s]){if(i["breakpoint_"+e]!==y&&i["breakpoint_"+e][t]!==y&&""!==i["breakpoint_"+e][t]){o=i["breakpoint_"+e][t];break}}else if(i[t]!==y&&""!==i[t]){let e=this.I?.[t]?.binding;o=e?.[i[t]]?.responsive?.disabled?.includes(t)?y:i[t];break}}}o!==y&&""!==o||!t.endsWith("_unit")||0===t.indexOf("lightbox_")||t.includes("frame_")?o!==y&&""!==o&&"column"===r.activeModel.type&&(""+o).includes(",")&&(0===t.indexOf("padding")||t.includes("margin"))&&(o=o.trim().split(","),o=o[1]!==y&&""!==o[1]?o[1]:o[0],o=o.trim()):o="px"}return o},F(t,e){this.setStylingValues(t);const i=this.clicked;this.clicked="styling";for(let i in this.I){let o=this.I[i],l=o.type;if(l&&"video"!==l&&"gallery"!==l&&"autocomplete"!==l&&"custom_css"!==l&&"builder"!==l&&!1!==o.is_responsive){"icon_radio"===l?l="radio":"icon_checkbox"===l?l="checkbox":"textarea"===l||"icon"===l||"hidden"===l||"number"===l?l="text":"image"===l?l="mediaFile":"padding"===l||"border_radius"===l?l="margin":"frame"===l&&(l="layout");let s=this.getStyleVal(i);if(this[l].update(i,s,this,t,e),o.binding!==y){let t=this.getEl(i),e=[];e="layout"===l?t.tfClass("tfl-icon"):"radio"===l||"checkbox"===l?t.tfTag("input"):[t];for(let t=0,i=e.length;t<i;++t)this.M(e[t],o,s)}}}const o=r.LightBox.el.querySelectorAll("#tb_options_styling option.tb_responsive_disable");for(let t=o.length-1;t>=0;t--)o[t].disabled="desktop"!==e;this.clicked=i},setStylingValues(t){const e=r.Forms.serialize("tb_options_styling",!0),i="desktop"===t;!1===i&&this.values["breakpoint_"+t]===y&&(this.values["breakpoint_"+t]={});for(let o in e)!0===i?this.values[o]=e[o]:this.values["breakpoint_"+t][o]=e[o]},async resetStyling(e){const i=e.get("mod_name");if(!1===r.isGSPage&&null===r.GS.activeGS)if(e.id===r.activeModel?.id){const t=this.getEl(r.GS.key);if(t&&t.value){const e=t.value.split(" "),i=t.parentNode.querySelector("tb-gs");for(let t=e.length-1;t>-1;--t)i.delete(e[t])}}else await r.GS.setGsStyle([],!0,e);if(r.isVisual){let t=r.liveStylingInstance;t&&t.el===e.el||(t=r.createStyleInstance(),t.init(!0,!1,e));const o=t.prefix,l=this.breakpointsReverse;for(let t=l.length-1;t>-1;--t){let e=ThemifyStyles.getSheet(l[t],null!==r.GS.activeGS),i=e.cssRules||e.rules;if(i.length>0)for(let t=i.length-1;t>-1;--t)if(i[t].selectorText.includes(o)){let e=i[t].cssText.split("{")[1].split(";");for(let o=e.length-2;o>-1;--o){let l=e[o].trim().split(": ")[0].trim();i[t].style[l]!==y&&(i[t].style[l]="")}}}"module"!==e.type&&(t.removeBgSlider(),t.removeBgVideo(),t.removeFrames(),t.bindBackgroundMode("repeat","background_repeat"),t.bindBackgroundMode("repeat","b_r_h"),t.el.removeAttribute("data-tb_slider_videos"),t.el.querySelector(":scope>.tb_slider_videos")?.remove(),t.getComponentBgOverlay(i)?.remove()),t=null}const o=ThemifyStyles.getStyleOptions(i),l=e.id===r.activeModel?.id?this.values:e.get("styling");for(let t in l){let e=t.includes("_color")?"color":!!t.includes("_style")&&"style",i=null;0===t.indexOf("breakpoint_")||t===r.GS.key||o[t]!==y||t.includes("_apply_all")?i=!0:t.includes("_unit")?(e=t.replace(/_unit$/gi,"",""),o[e]!==y&&(i=!0)):t.includes("_w")?(e=t.replace(/_w$/gi,"",""),o[e]!==y&&"font_select"===o[e].type&&(i=!0)):!1!==e&&(e=t.replace("_"+e,"_width"),o[e]!==y&&"border"===o[e].type&&(i=!0)),!0===i&&delete l[t]}if(e.id===r.activeModel?.id){const e="styling",i=this.getEl("tb_options_"+e);if(i){for(let t=i.children,e=t.length-1;e>-1;--e)t[e].classList.contains("tb_styling_tab_header")||t[e].remove();i.removeAttribute("data-done"),t.triggerEvent(i,"tb_builder_tabsactive",{id:e})}}},create(t){const e=E();if(t===y||0===t.length){const t=A(),i=A("p","",g.no_op_module);return t.appendChild(i),e.appendChild(t),e}if("tabs"===t.type)e.appendChild(this.tabs.render(t,this));else for(let i in t){let o=t[i];if(!0===o.hide||o.type===y||"visibility"===this.clicked&&"row"===this.component&&"sticky_visibility"===o.id)continue;let l=o.type,s=this[l].render(o,this);if(!1!==s&&"separator"!==l&&"expand"!==l&&"group"!==l){let t=o.id||o.topId;if("tabs"!==l&&"multi"!==l&&"margin_opposity"!==l&&t&&("styling"===this.clicked?(r.isVisual&&o.prop!==y&&(this.styles[t]=r.Helper.cloneObject(o)),this.I[t]=r.Helper.cloneObject(o)):"setting"===this.clicked&&null!==this.values&&this.values[t]!==y&&!0!==this.is_repeat&&(this.settings[t]=this.values[o.id],o.units!==y&&this.values[t+"_unit"]!==y&&(this.settings[t+"_unit"]=this.values[t+"_unit"]))),"hook_content"!==l&&"slider"!==l&&"builder"!==l&&"tooltip"!==l&&"custom_css_id"!==l){let i="tb_field",n={"data-type":l};if(o.dc===y||o.dc||(i+=" tb_disable_dc"),t!==y&&(i+=" "+t),o.wrap_class!==y&&(i+=" "+o.wrap_class),"toggle_switch"===l)i+=" switch-wrapper";else if("slider"===l)i+=" tb_slider_options";else if("message"===l&&o.hideIf!==y&&Function("return "+o.hideIf))i+=" tb_hide_option";else if(o.required!==y&&"setting"===this.clicked){n["data-validation"]=o.required.rule||"not_empty";let t=o.required.message;n["data-error-msg"]=t!==y?g[t]||t:"not_empty",i+=" tb_must_validate"}"styling"===this.clicked&&!1===o.is_responsive&&(i+=" tb_responsive_disable"),n.class=i;let a=this.A(o),r=A("",n);if(!1!==a){a=a.trim();let t=A("","tb_label",a);if(""===a&&(t.className+=" tb_empty_label"),o.help!==y&&""!==o.label&&(t.className+=" contains-help",t.appendChild(this.help(o.help))),r.appendChild(t),"multi"!==l){let t=A("","tb_input");t.appendChild(s),r.appendChild(t)}else r.appendChild(s)}else r.appendChild(s);e.appendChild(r)}else e.appendChild(s)}else!1!==s&&e.appendChild(s)}return t=null,e},tabs:{click:0,styleClicked:!1,render(t,e){const i=t.options,o=E(),l=A("ul","tb_tab_nav tf_scrollbar"),s="styling"===e.clicked,a=s&&!1===this.styleClicked&&"module"===e.component?A("","tb_styling_tab_nav"):null,_=A("","tb_tabs tf_rel tf_w"),c=t.isRadio!==y;let d=null,p=null;t.class&&(_.className+=" "+t.class),s&&(this.styleClicked=!0),++this.click,!0===c&&(d=e.getStyleVal(t.id)??t.default,d!==y&&(p=!0),l.className+=" tb_radio_wrap",!0===e.is_repeat?(l.className+=!0===e.is_sort?" tb_lb_sort_child":" tb_lb_option_child",l.dataset.inputId=t.id):(l.className+=" tb_lb_option",l.id=t.id),s&&r.isVisual&&(e.styles[t.id]={prop:t.prop,selector:t.selector}));for(let n in i){let a=i[n],_=a.href||"tb_"+this.click+"_"+n,u=A("li"),h=A(!0===c?"label":"a",{"data-id":_,class:a.class||""}),f=A("",{id:_,class:"tb_tab tf_hide"}),m=a.options||a;if(""!==a.label&&(h.textContent=g[a.label]??a.label??g[n]),a.icon!==y&&h.appendChild(r.Helper.getIcon(a.icon)),a.title!==y&&(h.title=a.title),!0===c){let i=A("input",{type:"radio",class:"tb_radio_tab_input",name:t.id,value:n});d!==n&&d!=="tb_"+n||(i.checked=!0),h.className="tb_radio_tab_label",h.tfOn("change",e.switchTabs,{passive:!0}).appendChild(i),s&&r.isVisual&&e.O(i,{...t,type:"radio"})}else h.tfOn(b,e.switchTabs,{passive:!0}).href="javascript:;";null===p||d===n||d==="tb_"+n?(p=!0,u.className="current",f.appendChild(e.create(m)),m=null,f.style.display="block"):f.tfOn("tb_builder_tabsactive",(function(){this.appendChild(e.create(m)),e.B(),e.callbacks(),m=null}),{once:!0,passive:!0}),u.appendChild(h),l.appendChild(u),o.appendChild(f)}return null!==a&&"tabs"===e.R?.styling?.options?.type?(a.appendChild(l),_.appendChild(a)):_.appendChild(l),_.appendChild(o),n(e.callbacks.bind(e),5),_}},group:{render(t,e){const i=A(),o=A(),l=E(),s=e.create(t.options);if(t.label!==y&&(o.textContent=g[t.label]||t.label),t.wrap_class!==y&&(i.className=t.wrap_class),i.classList.add("tb_field_group"),t.id&&i.classList.add(t.id),"accordion"===t.display){i.classList.add("tb_field_group_acc");const t=A("","tf_hide tb_field_group_content"),e=r.Helper.getIcon("ti-angle-up");o.className="tb_style_toggle tb_closed",o.appendChild(e),t.appendChild(s),o.tfOn(b,(()=>{$(t).slideToggle(),o.classList.toggle("tb_closed")})),i.append(o,t)}else t.label!==y&&(o.className="tb_label",t.help!==y&&""!==t.label&&(o.className+=NaN,o.appendChild(this.help(t.help))),l.appendChild(o)),i.appendChild(s);return l.appendChild(i),l}},builder:{render(e,i){const o=E(),l=A("",{class:"tb_row_js_wrapper tf_rel tb_lb_option",id:e.id}),s=A("button",{class:"add_new tf_plus_icon tf_icon_btn tf_rel",type:"button"},g[e.new_row]||g.new_row),a=this,_=!0===i.is_repeat;if(e.wrap_class!==y&&(l.className+=" "+e.wrap_class),i.is_repeat=!0,i.values[e.id]!==y){const t=i.values[e.id].slice(),o=r.Helper.cloneObject(i.values);for(let o=0;o<t.length;++o)i.values=t[o]||{},l.appendChild(this.U(e,i));i.values=o}else l.appendChild(this.U(e,i));return l.appendChild(s),o.appendChild(l),n((()=>{a.G(l,i),s.tfOn(b,(function(o){o.stopPropagation();const l=!0===i.is_repeat,s=r.Helper.cloneObject(i.values),_=this.parentNode;i.is_repeat=!0,i.values=r.activeModel.getPreviewSettings&&r.activeModel.getPreviewSettings()?.[_.id]?.[0]||{};const c=a.U(e,i);this.before(c),r.activeModel.addRow?.(c),n((()=>{i.B(),i.callbacks(),t.trigger("tb_repeatable_add_new",c),t.triggerEvent(_,"added")}),5),i.control.preview(_,null,{repeat:!0}),i.is_repeat=l,i.values=s}),{passive:!0})}),1500),i.is_repeat=_,o},U(e,i){const o=this,l=A("","tb_repeatable_field"),s=A("","tb_repeatable_field_top tf_rel tf_box tf_textl"),a=A("","row_menu"),_=A("",{class:"menu_icon",tabindex:-1}),c=A("ul","tb_down"),d=A("li","tb_duplicate_row",g.duplicate),p=A("li","tb_delete_row tf_close",g.delete),u=A("","tb_arrow tb_toggle_row"),h=A("","tb_repeatable_field_content"),f=A("",{class:"tb_arrow tb_up_row",title:g.up}),m=A("",{class:"tb_arrow tb_down_row",title:g.down});return h.appendChild(i.create(e.options)),c.append(d,p),a.append(_,c),s.append(a,f,m,u),l.append(s,h),s.tfOn(b,(function(l){const s=l.target,a=s.classList,_=this.parentNode;if(a.contains("tb_delete_row")){const t=s.closest(".tb_row_js_wrapper");o.H(s,t),i.control.preview(t,null,{repeat:!0})}else if(a.contains("tb_duplicate_row")){const l=r.Helper.cloneObject(i.values),s=!0===i.is_repeat;i.is_repeat=!0,i.values=r.Forms.serialize(_,!0,!0),r.activeModel.duplicateRow?.(i.values,l,_);const a=o.U(e,i);_.after(a),i.values=l,n((()=>{i.B(),i.callbacks(),n((()=>{t.triggerEvent(_.parentNode,"duplicate"),t.trigger("tb_repeatable_duplicate",a),i.control.preview(_,null,{repeat:!0}),i.is_repeat=s}),5)}),5)}else a.contains("tb_toggle_row")?o.X(s):a.contains("tb_arrow")&&o.V(s,i)}),{passive:!0}),l},G(e,i){e.tfOn("pointerdown",(function(e){if(0===e.button&&e.target.classList.contains("tb_repeatable_field_top")){e.stopImmediatePropagation();let o,_,c,d,p,b,u,h,f,m,g,y,w,v=0,k={},x=this.ownerDocument,S=e.target.closest(".tb_repeatable_field"),T=!1;const z=t=>{if(h)if(t>=g||t<=m){if(!1===T){T=!0;const e=~~(g/10);h.scrollTop+=t<=m?-1*e:e,a(_),_=n((()=>{l((()=>{T&&(T=!1,z(t))}))}),2*e)}}else a(_),T=!1},I=t=>{t.stopImmediatePropagation(),o=l((()=>{if(!x)return;const{clientX:e,clientY:i}=t,o="mousemove"===t.type?t.target:x.elementFromPoint(e,i),l=i-u-w.getBoundingClientRect().top;if(l>0&&l<y){if(b.style.transform="translateY("+l+"px)",z(i),i>=g||i<=m)return;if(o!==S&&o?.classList.contains("tb_repeatable_field")){const t=i>v?"bottom":"top";d===t&&c===o||("bottom"===t?o.after(S):o.before(S)),c=o,d=t}v=i}else z(i)}))},E=()=>{if(C.add("tb_start_animate","tb_move_drag"),w=S.parentNode,w.classList.add("tb_sort_start"),"undefined"!=typeof tinyMCE){const t=w.tfClass("tb_lb_wp_editor");for(let e=t.length-1;e>-1;--e){let i=t[e].id;k[i]=tinymce.get(i).getContent(),tinyMCE.execCommand("mceRemoveEditor",!1,i)}}f=t.convert(w.children).indexOf(S),S.classList.contains("collapsed")||(S.tfClass("tb_repeatable_field_content")[0].style.display="none",S.classList.add("collapsed"),p=!0),b=S.cloneNode(!0),b.tfClass("tb_repeatable_field_content")[0].remove(),h=S.closest(".tf_scrollbar"),b.className+=" tb_sort_handler",S.classList.add("tb_current_sort"),S.after(b),u=b.getBoundingClientRect().height/2,y=w.offsetHeight;const e=h.getBoundingClientRect();m=e.top,g=e.bottom-40},A=function(e){if(this.tfOff("pointermove",E,{passive:!0,once:!0}).tfOff("pointermove",I,{passive:!0}).tfOff("lostpointercapture pointerup",A,{passive:!0,once:!0}),w){if(e.stopImmediatePropagation(),s(o),a(_),b?.remove(),"undefined"!=typeof tinyMCE)for(let t in k)tinyMCE.execCommand("mceAddEditor",!1,t),tinymce.get(t).setContent(k[t]);S.classList.remove("tb_current_sort"),p&&(S.classList.remove("collapsed"),S.tfClass("tb_repeatable_field_content")[0].style.display="");const n=t.convert(w.children).indexOf(S);f!==n&&r.activeModel.sortRow?.(S,f,n),l((()=>{f!==n&&(i.control.preview(w,null,{repeat:!0}),t.triggerEvent(w,"sortable")),w.classList.remove("tb_sort_start"),w=null}))}C.remove("tb_start_animate","tb_move_drag"),c=b=p=d=f=v=k=h=x=y=u=T=m=g=S=o=_=null};this.tfOn("lostpointercapture pointerup",A,{passive:!0,once:!0}).tfOn("pointermove",E,{passive:!0,once:!0}).tfOn("pointermove",I,{passive:!0}).setPointerCapture(e.pointerId)}}),{passive:!0})},V(e,i){const o=e.closest(".tb_repeatable_field"),s=e.classList.contains("tb_up_row")?"top":"bottom",n="bottom"===s?o.nextElementSibling:o.previousElementSibling,a=o.parentNode,_=t.convert(a.children).indexOf(o);"bottom"===s?n.after(o):n.before(o),r.activeModel.sortRow?.(o,_,t.convert(a.children).indexOf(o)),l((()=>{a.closest(".tf_scrollbar").scroll({top:o.offsetTop+a.offsetTop+10}),i.control.preview(a,null,{repeat:!0}),t.triggerEvent(a,"sortable")}))},X(t){$(t).closest(".tb_repeatable_field").toggleClass("collapsed").find(".tb_repeatable_field_content").slideToggle()},H(e,i){const o=e.closest(".tb_repeatable_field");r.activeModel.deleteRow?.(o,i),t.trigger("tb_repeatable_delete",o),o.remove(),t.triggerEvent(i,"delete")}},accordion:{Y(t,e,i){t.tfOn(b,(function(t){let o=this.tfClass("tb_accordion_fields_options")[0];if(o===y){o=A("","tb_toggleable_fields_options tb_accordion_fields_options tf_w"),o.style.display="none",i.is_repeat=!0;let t=null;const l=this.parentNode.closest(".tb_accordion_fields").id,s=this.dataset.id;i.values[l]?.[s]?.val!==y&&(t=r.Helper.cloneObject(i.values),i.values=i.values[l][s].val),o.appendChild(i.create(e.options)),this.appendChild(o),i.B(),i.callbacks(),null!==t&&(i.values=t),i.is_repeat=t=null}else if(o.contains(t.target))return;t.stopPropagation(),t.preventDefault(),this.classList.contains("tb_closed")?$(o).slideDown((function(){this.parentNode.classList.remove("tb_closed")})):$(o).slideUp((function(){this.parentNode.classList.add("tb_closed")}))}))},J(e,i){if(i.values.motion_effects!==y)for(let t in i.values.motion_effects)i.values.motion_effects[t].val={[t+"_dir"]:""};const o=e.parentNode.querySelector("#motion_effects"),s=o.tfTag("select"),n=o.tfClass("tb_position_box_wrapper"),a=o.tfClass("tb_slider_wrapper"),r=o.tfClass("tb_range");for(let e=s.length-1;e>-1;--e)s[e].selectedIndex=0,t.triggerEvent(s[e],"change");for(let t=r.length-1;t>-1;--t)r[t].value=r[t].min??"";for(let t=n.length-1;t>-1;--t)n[t].tfTag("input")[0].value="50,50",n[t].tfClass("tb_position_box_handle")[0].removeAttribute("style");for(let e=a.length-1;e>-1;--e){let i=a[e].querySelector('input[type="hidden"]'),o=a[e].querySelectorAll('input[type="range"]');o[1]?(o[0].value=o[0].max,o[1].value=o[0].min,t.triggerEvent(o[1],"input")):o[0].value=o[0].min,t.triggerEvent(o[0],"input"),l((()=>{i.value=""}))}},render(t,e){const i=A("ul",{class:"tb_toggleable_fields tb_accordion_fields tb_lb_option",id:t.id}),o=E(),l=e.values;"motion_effects"===t.id&&l&&l.hasOwnProperty("custom_parallax_scroll_speed")&&(l.hasOwnProperty("motion_effects")||(l.motion_effects={v:{val:{v_speed:l.custom_parallax_scroll_speed,v_dir:""}},h:{val:{}},t:{val:{t_speed:""}},r:{val:{}},s:{val:{}}},delete l.custom_parallax_scroll_speed),l.hasOwnProperty("custom_parallax_scroll_reverse")?(l.motion_effects.v.val.v_dir="down",delete l.custom_parallax_scroll_reverse):l.motion_effects.v.val.v_dir="up",l.hasOwnProperty("custom_parallax_scroll_fade")&&(l.motion_effects.t.val.t_speed=l.custom_parallax_scroll_speed,delete l.custom_parallax_scroll_fade));const s=l[t.id],n=(o,l)=>{const s=t.options[o].label,n=A("li",{class:"tb_closed","data-id":o}),a=A("input",{type:"hidden"}),r=A("","tb_toggleable_fields_title tb_accordion_fields_title tf_plus_icon tf_rel",s?g[s]||s:g[o]);a.value=l.val!==y?d.stringify(l.val):"",n.append(a,r),this.Y(n,t.options[o],e),i.appendChild(n)};if(s!==y)for(let e in s)t.options[e]!==y&&n(e,s[e]);for(let e in t.options)s!==y&&s[e]!==y||n(e,t.options[e]);if(o.appendChild(i),"motion_effects"===t.id){const t=A("a",{class:"tb_motion_reset_link",href:"#"},g.reset_effect);t.tfOn(b,(t=>{t.preventDefault(),t.stopPropagation(),this.J(t.currentTarget,e)})),o.appendChild(t)}return o}},toggleable_fields:{K(e,i){e.childElementCount<2||e.tfOn("pointerdown",(function(e){if(0===e.button&&(e.target.parentNode===this||e.target.parentNode.parentNode===this)){e.stopImmediatePropagation();let o,s,r,_,c,d,p,b,u,h,f,m=0,g={},y=this.ownerDocument,w=e.target.closest(".tb_toggleable_item"),v=!1,k=w.parentNode;const x=t=>{if(p)if(t>=u||t<=b){if(!1===v){v=!0;const e=~~(u/10);p.scrollTop+=t<=b?-1*e:e,a(o),o=n((()=>{l((()=>{v&&(v=!1,x(t))}))}),2*e)}}else a(o),v=!1},S=t=>{if(t.stopImmediatePropagation(),!y)return;const e=t.clientY,i=y.elementFromPoint(t.clientX,e),o=e-d-k.getBoundingClientRect().top;if(o>0&&o<h){if(c.style.transform="translateY("+o+"px)",x(e),e>=u||e<=b)return;if(i!==w&&i?.classList.contains("tb_toggleable_item")){const t=e>m?"bottom":"top";r===t&&s===i||("bottom"===t?i.after(f):i.before(f)),s=i,r=t}m=e}else x(e)},T=function(){if(C.add("tb_start_animate","tb_move_drag"),k.classList.add("tb_sort_start"),"undefined"!=typeof tinyMCE){const t=k.tfClass("tb_lb_wp_editor");for(let e=t.length-1;e>-1;--e){let i=t[e].id;g[i]=tinymce.get(i).getContent(),tinyMCE.execCommand("mceRemoveEditor",!1,i)}}if(!this.classList.contains("tb_closed")){const t=this.tfClass("tb_toggleable_fields_options")[0];t&&(t.style.display="none"),this.classList.add("tb_closed"),_=!0}c=this.cloneNode(!0),c.tfClass("tb_toggleable_fields_options")[0]?.remove(),f=c.cloneNode(!0),p=this.closest(".tf_scrollbar"),c.className+=" tb_sort_handler",f.classList.add("tb_current_sort"),this.style.display="none",this.after(f,c),d=c.getBoundingClientRect().height/2,h=k.offsetHeight;const t=p.getBoundingClientRect();b=t.top,u=t.bottom-40},z=function(e){if(this.tfOff("pointermove",T,{passive:!0,once:!0}).tfOff("pointermove",S,{passive:!0}).tfOff("lostpointercapture pointerup",z,{passive:!0,once:!0}),f){if(e.stopImmediatePropagation(),a(o),c?.remove(),f.replaceWith(this),this.style.display="","undefined"!=typeof tinyMCE)for(let t in g)tinyMCE.execCommand("mceAddEditor",!1,t),tinymce.get(t).setContent(g[t]);if(this.classList.remove("tb_current_sort"),_){const t=this.tfClass("tb_toggleable_fields_options")[0];t&&(t.style.display=""),this.classList.remove("tb_closed")}i.control.preview(k,null,{repeat:!0}),t.triggerEvent(k,"sortable"),k.classList.remove("tb_sort_start"),k=null}C.remove("tb_start_animate","tb_move_drag"),s=c=_=r=m=g=p=y=h=f=v=d=b=u=w=o=null};w.tfOn("lostpointercapture pointerup",z,{passive:!0,once:!0}).tfOn("pointermove",T,{passive:!0,once:!0}).tfOn("pointermove",S,{passive:!0}).setPointerCapture(e.pointerId)}}),{passive:!0})},Y(t,e,i){t.tfOn(b,(function(t){if(this.classList.contains("tb_toggleable_field_disabled")||t.target.closest(".switch-wrapper")){if(!t.target.closest(".tb_toggleable_fields_options")){const t=this.tfClass("tb_toggleable_fields_options")[0];$(t).slideUp((function(){this.parentNode.classList.add("tb_closed")}))}}else{let o=this.tfClass("tb_toggleable_fields_options")[0];if(o){if(o.contains(t.target))return}else{o=A("","tb_toggleable_fields_options tf_box tf_w"),o.style.display="none",this.appendChild(o),i.is_repeat=!0;let t=this.closest(".tb_toggleable_fields").id,l=this.dataset.id,s=null,n=i.values?.[t];if(n)if(Array.isArray(n)){for(let t=n.length-1;t>-1;--t)if(n[t].id===l){n=n[t];break}}else n=n[l];n?.val&&(s=r.Helper.cloneObject(i.values),i.values=n.val),e.options.length>0&&(o.appendChild(i.create(e.options)),i.B(),i.callbacks()),null!==s&&(i.values=s),i.is_repeat=null}t.stopPropagation(),t.preventDefault(),this.classList.contains("tb_closed")?$(o).slideDown((function(){this.parentNode.classList.remove("tb_closed")})):$(o).slideUp((function(){this.parentNode.classList.add("tb_closed")}))}}))},W(t,e){const i=t.closest("li"),o=i.classList;t.checked?o.remove("tb_toggleable_field_disabled"):o.add("tb_toggleable_field_disabled","tb_closed"),e.control.preview(i.parentNode,null,{repeat:!0})},render(t,e){const i=this,o=A("ul","tb_toggleable_fields tf_w tf_rel"),l=e.is_repeat,s=e.values[t.id],n=new u,a=new h,r=(t,l)=>{const s=l.id,n={type:"toggle_switch",id:"",options:{on:{name:"1",value:l.toggle?.on||"s"},off:{name:"0",value:l.toggle?.off||"hi"}},default:"1"===t.on?"on":"off",control:!1},a=A("li",{class:"tb_toggleable_item tb_closed","data-id":s}),r=A("input",{type:"hidden",value:t.val!==y?"string"==typeof t.val?t.val:d.stringify(t.val):""}),_=A("","tb_toggleable_fields_title tf_plus_icon tf_rel"),c=e.create([n]);_.innerHTML=g[l.label]||l.label,"off"===n.default&&(a.className+=" tb_toggleable_field_disabled"),l.class&&(a.className+=" "+l.class),c.querySelector(".toggle_switch").tfOn("change",(function(t){t.stopPropagation(),i.W(this,e)}),{passive:!0}),a.append(r,_,c),i.Y(a,l,e),o.appendChild(a)},_=t.options;!0===e.is_repeat?(o.dataset.inputId=t.id,o.className+=" tb_lb_option_child"):(o.id=t.id,o.className+=" tb_lb_option"),e.is_repeat=!0;for(let t=_.length-1;t>-1;--t)a.set(_[t].id,_[t]);if(s!==y)for(let t=0;t<s.length;++t){let e=s[t].id,i=a.get(e);i&&(n.add(e),r(s[t],i))}for(let t=0;t<_.length;++t)n.has(_[t].id)||r({},_[t]);return!1!==t.sort&&i.K(o,e),e.is_repeat=l,o}},sortable_fields:{Z:t=>[{id:"icon",type:"icon",label:"icon"},{id:"before",type:"text",label:"b_t"},{id:"after",type:"text",label:"a_t"}],$:(t,e)=>({date:[{id:"display",type:"select",label:"disp",options:{"":"pd",m:"md"}},{id:"format",type:"select",label:"d_f",default:"def",options:e.getOptions("dateFormat"),binding:{not_empty:{hide:"custom"},custom:{show:"custom"}}},{id:"custom",type:"text",control:{event:"change"},label:"cus_f",help:"cus_fd_h"}],time:[{id:"format",type:"select",label:"t_f",default:"def",options:{"g:i a":"g_i_a","g:i A":"g_i_A","H:i":"H_i",def:"def",custom:"cus"},binding:{not_empty:{hide:"custom"},custom:{show:"custom"}}},{id:"custom",type:"text",control:{event:"change"},label:"cus_f",help:"cus_ft_h"}],author:[{id:"l",type:"toggle_switch",label:"l",options:"simple",default:"on"},{id:"a_p",type:"toggle_switch",label:"a_p",options:"simple",default:"off",binding:{checked:{show:"p_s"},not_checked:{hide:"p_s"}}},{id:"p_s",type:"range",label:"p_s",class:"xsmall",default:32,units:{px:{max:96}},control:{event:"change"}}],comments:[{id:"l",type:"toggle_switch",label:"l",options:"simple",default:"on"},{id:"no",type:"text",control:{event:"change"},label:"no_c"},{id:"one",type:"text",control:{event:"change"},label:"one_c"},{id:"comments",type:"text",control:{event:"change"},label:"comments"}],terms:[{id:"post_type",type:"query_posts",tax_id:"taxonomy"},{id:"l",type:"toggle_switch",label:"l",options:"simple",default:"on"},{id:"sep",type:"text",default:",",control:{event:"change"},label:"sep"},{id:"c",type:"toggle_switch",default:"off",label:"tbp_coverim",options:"simple",binding:{yes:{show:["w","h","d"]},no:{hide:["w","h","d"]}}},{id:"w",type:"number",label:"w",after:"px",wrap_class:"tb_disable_dc"},{id:"h",type:"number",label:"ht",after:"px",wrap_class:"tb_disable_dc"},{id:"d",type:"select",label:"disp",options:{"":"inbl",b:"block"}}],text:[{id:"t",type:"textarea",class:"fullwidth"}]}[t]),tt(t,e,i,o,l){const s=t.options[e],n=A("li",{class:"tb_sort_fields_item","data-type":e},g[s.label]||s.label),a=A("span","tb_sort_field_dropdown_pointer");if(!0===l){let l=!1;if(i)o!==y&&(l=this.et(o,i));else{o!==y&&(l=this.et(o,e,!0)),n.dataset.new=!0;const s=r.LightBox.el.tfClass(t.id)[0];let a=1;if(i=e+"_"+a,s!==y)while(1){if(null===s.querySelector('[data-id="'+i+'"]'))break;++a,i=e+"_"+a}}n.dataset.id=i;const s=A("span",{class:"tb_sort_fields_remove tf_close",title:g.delete}),_=A("input",{type:"hidden"});!1!==l&&o[l].val!==y&&(_.value=d.stringify(o[l].val)),n.append(r.Helper.getIcon("ti-pencil"),a,_,s)}return n},K(e,i){e.tfOn("pointerdown",(function(e){if(0===e.button&&e.target.parentNode===this){let o,l,s,n,a,r,_,c=0,d=0,p={},b=this.ownerDocument,u=e.target,h=u.parentNode;const f=t=>{if(t.stopImmediatePropagation(),!b)return;let{clientX:e,clientY:i}=t;e<_.left?e=_.left:e>_.right&&(e=_.right),i<_.top?i=_.top:i>_.bottom&&(i=_.bottom);const p=b.elementFromPoint(e,i);if(s.style.transform="translate("+(e-n-_.left)+"px,"+(i-a-_.top)+"px)",p&&p!==u&&p.classList.contains("tb_sort_fields_item")){const t=i>c||e>d?"bottom":"top";l===t&&o===p||("bottom"===t?p.after(r):p.before(r)),o=p,l=t}c=i,d=e},m=function(t){if(t.stopImmediatePropagation(),C.add("tb_start_animate","tb_move_drag"),h.classList.add("tb_sort_start"),"undefined"!=typeof tinyMCE){const t=h.tfClass("tb_lb_wp_editor");for(let e=t.length-1;e>-1;--e){let i=t[e].id;p[i]=tinymce.get(i).getContent(),tinyMCE.execCommand("mceRemoveEditor",!1,i)}}s=this.cloneNode(!0),s=this.cloneNode(!0),s.tfClass("tb_sort_field_dropdown")[0]?.remove(),r=s.cloneNode(!0),s.className+=" tb_sort_handler",r.classList.add("tb_current_sort"),this.style.display="none",this.after(r,s);const e=s.getBoundingClientRect();_=h.getBoundingClientRect(),a=e.height/2-h.offsetTop,n=e.width/2-h.offsetLeft,f(t)},g=function(){if(this.tfOff("pointermove",m,{passive:!0,once:!0}).tfOff("pointermove",f,{passive:!0}).tfOff("lostpointercapture pointerup",g,{passive:!0,once:!0}),r){if(s?.remove(),r.replaceWith(this),this.style.display="","undefined"!=typeof tinyMCE)for(let t in p)tinyMCE.execCommand("mceAddEditor",!1,t),tinymce.get(t).setContent(p[t]);i.control.preview(h,null,{repeat:!0}),t.triggerEvent(h,"sortable"),h.classList.remove("tb_sort_start"),h=null}C.remove("tb_start_animate","tb_move_drag"),o=s=l=c=d=p=b=a=n=_=u=r=null};u.tfOn("lostpointercapture pointerup",g,{passive:!0,once:!0}).tfOn("pointermove",m,{passive:!0,once:!0}).tfOn("pointermove",f,{passive:!0}).setPointerCapture(e.pointerId)}}),{passive:!0})},et(t,e,i){for(let o=t.length-1;o>-1;--o)if(t[o].id===e||!0===i&&e===t[o].type)return o;return!1},it(t,e,i,o){let l=o.dataset.type,s=o.tfClass("tb_sort_field_dropdown")[0];if(!s){s=A("","tb_sort_field_dropdown tb_sort_field_dropdown_"+l);let n=o.dataset.id,a=null,_=e.options[l].options||this.$(l,t);if("text"===l||e.options[l].no_global_options||(_=_.concat(this.Z(t))),t.is_repeat=t.is_sort=!0,i!==y){const e=!!o.dataset.new,s=this.et(i,!0===e?l:n,e);!1!==s&&i[s].val!==y&&(a=r.Helper.cloneObject(t.values),t.values=i[s].val)}s.appendChild(t.create(_)),o.appendChild(s),t.callbacks(),null!==a&&(t.values=a),t.is_sort=t.is_repeat=a=null}if(!o.classList.contains("current")){o.classList.add("current");const t=function(e){0===e.button&&(o.contains(e.target)||Themify_Icons.target&&o.contains(Themify_Icons.target[0])&&"block"===this.tfId("themify_lightbox_fa").style.display?o.classList.add("current"):(o.classList.remove("current"),this.tfOff(e.type,t,{passive:!0})))};T.tfOn("pointerdown",t,{passive:!0})}},ot(e,i){const o=(i=i.closest("li")).parentNode;i.parentNode.removeChild(i),e.control.preview(o,null,{repeat:!0}),t.triggerEvent(o,"delete")},render(t,e){const i=A("","tb_sort_fields_wrap tf_box tf_rel tf_w"),o=A("",{class:"tb_ui_dropdown_label tb_sort_fields_plus tf_plus_icon",tabindex:-1}),l=A("","tb_sort_fields_plus_wrap"),s=A("ul","tf_scrollbar"),a=A("ul","tb_sort_fields_parent"),r=e.values[t.id]?.slice(0)||[];!0===e.is_repeat?(a.dataset.inputId=t.id,a.className+=!0===e.is_sort?" tb_lb_sort_child":" tb_lb_option_child"):(a.id=t.id,a.className+=" tb_lb_option");for(let e in t.options)s.appendChild(this.tt(t,e));for(let i=0;i<r.length;++i)!0===e.is_new&&!0!==r[i].show||a.appendChild(this.tt(t,r[i].type,r[i].id,r,!0));return i.tfOn(b,(i=>{const o="LI"===i.target.tagName?i.target:i.target.parentNode;"LI"===o.tagName&&(i.stopPropagation(),i.target.classList.contains("tb_sort_fields_remove")?this.ot(e,i.target):o.closest(".tb_sort_fields_plus_wrap")?(a.appendChild(this.tt(t,i.target.dataset.type,null,r,!0)),e.control.preview(a,null,{repeat:!0})):this.it(e,t,r,o))}),{passive:!0}),l.append(o,s),i.append(a,l),n((()=>{this.K(a,e)}),800),!0===e.is_new&&e.afterRun.push((()=>{e.control.preview(a,null,{repeat:!0})})),i}},multi:{render(t,e){const i=A("","tb_multi_fields tb_fields_count_"+t.options.length);return i.appendChild(e.create(t.options)),i}},color:{lt:null,nt(e,o,l){const s=this,n=$(e),a=l.id;n.tfminicolors({opacity:l.opacity===y||!!l.opacity,swatches:themifyColorManager.toColorsArray(),changeDelay:10,beforeShow(){const t=r.LightBox.el.getBoundingClientRect(),e=n.closest(".tfminicolors"),i=e.find(".tfminicolors-panel");i.css("visibility","hidden").show(),e[0].classList.toggle("tfminicolors_right",t.left+t.width<=i.offset().left+i.width()),i.css("visibility","").hide()},show(){themifyColorManager.initColorPicker(this),r.isVisual&&t.triggerEvent(this,"themify_builder_color_picker_show",{id:a})},hide(){r.isVisual&&t.triggerEvent(this,"themify_builder_color_picker_hide",{id:a})},change(e,l){e?l&&("0.99"==l?l=1:0>=c(l)&&(l=0)):l=e="",s.lt||l===i.activeElement||(o.value=l),e&&0>=c($(this).tfminicolors("opacity"))&&$(this).tfminicolors("opacity",0),r.isVisual&&(e&&!e.startsWith("var")&&(e=0===e.indexOf("--")?"var("+e+")":$(this).tfminicolors("rgbaString")),t.triggerEvent(this,"themify_builder_color_picker_change",{id:a,val:e}))}}).tfminicolors("show");o.tfOn("blur keyup",(function(t){let i=c(this.value.trim().replace(",","."));(i>1||isNaN(i)||i<0)&&(i=e.value?1:""),"blur"===t.type&&(this.value=i),s.lt="keyup"===t.type,n.tfminicolors("opacity",i)}),{passive:!0}),e.setAttribute("data-tfminicolors-initialized",!0)},setColor(t,e,i,o){let l=o,s="",n=!1;"transparent"===o?(l=o="#000",s=0):""!==o&&(n=0===o.indexOf("--"),!1===n&&(o.includes("_")?(l=ThemifyStyles.toRGBA(o),s=(o=o.split("_"))[1],s?0>=c(s)&&(s=0):s=1,l=o[0]):(l=o,s=1),l.includes("#")||(l="#"+l))),t.parentNode.classList.toggle("tfminicolors-var-input",n),t.value=l,!0===n&&(l=s=""),e.style.background=l,t.dataset.opacity=e.style.opacity=i.value=s},update(t,e,i){const o=i.getEl(t);if(null!==o){const t=o.parentNode;e===y&&(e=""),this.setColor(o,t.tfClass("tfminicolors-swatch-color")[0],t.nextElementSibling,e)}},render(t,e){const i=E(),o=A("","tfminicolors_wrapper"),l=A("","tfminicolors tfminicolors-theme-default"),s=A("input",{type:"text",class:"tfminicolors-input",autocomplete:"off"}),n=A("input",{class:"color_opacity",step:.1,min:0,max:1,type:"number"}),a=A("span","tfminicolors-swatch tfminicolors-sprite tfminicolors-input-swatch"),r=A("span","tfminicolors-swatch-color tf_abs"),_=this;let c=e.getStyleVal(t.id);return t.class!==y&&(s.className+=" "+t.class),!0===e.is_repeat?(s.className+=!0===e.is_sort?" tb_lb_sort_child":" tb_lb_option_child",s.dataset.inputId=t.id):(s.id=t.id,s.className+=" tb_lb_option"),a.appendChild(r),l.append(s,a),o.append(l,n),e.O(s,t),a.tfOn(b,(()=>{o.insertAdjacentElement("afterbegin",s),l.parentNode.removeChild(l),_.nt(s,n,t)}),{once:!0,passive:!0}),s.tfOn("focusin",(()=>{a.click()}),{once:!0,passive:!0}),n.tfOn("focusin",(function(){s.dataset.tfminicolorsInitialized?$(s).tfminicolors("show"):(s.dataset.opacity=this.value,a.click())}),{passive:!0}),!c&&t.default&&(c=t.default),c!==y&&this.setColor(s,r,n,c),i.appendChild(o),t.after!==y&&i.appendChild(e.after(t)),t.description!==y&&i.appendChild(e.description(t.description)),t.tooltip!==y&&i.appendChild(e.hint(t.tooltip)),t.label===y?t.label="c":!1===t.label&&delete t.label,i}},tooltip:{render(t,e){const i=t.prefix||"_tooltip";let o=[{type:"textarea",label:"tt",id:i,class:"fullwidth",control:!1,binding:{empty:{hide:[i+"_bg",i+"_c",i+"_w"]},not_empty:{show:[i+"_bg",i+"_c",i+"_w"]}}},{type:"multi",label:"",options:[{type:"color",label:"bg_c",id:i+"_bg",control:!1},{type:"color",label:"f_c",id:i+"_c",control:!1},{type:"range",label:"ma_wd",id:i+"_w",control:!1,units:{px:{min:-2e3,max:2e3},em:{min:-20,max:20}},wrap_class:"tb_disable_dc"}]}];(t.group??!0)&&(o=[{type:"group",label:"t",display:"accordion",options:o}]);let l=e.create(o);return r.isVisual&&(l=this.rt(l,t)),l},rt(t,e){const i=this,o=e.prefix?e.prefix:"_tooltip",l=t.querySelector("#"+o),s=[t.querySelector("#"+o+"_bg"),t.querySelector("#"+o+"_c")],n=["focus","keyup","blur","change"];t.querySelector("#"+o+"_w").tfOn(n,(t=>{i._t("blur"!==t.type,e)}),{passive:!0}),n.pop(),l.tfOn(n,(t=>{i._t("blur"!==t.type,e)}),{passive:!0});for(let t=s.length-1;t>-1;--t)s[t].tfOn("themify_builder_color_picker_show",(function(){i._t(!0,e),this.tfOn("themify_builder_color_picker_hide",(()=>{i._t(!1,e)}),{once:!0,passive:!0})}),{passive:!0}).tfOn("themify_builder_color_picker_change",(()=>{i._t(!0,e)}),{passive:!0});return t},_t(e,i){let o,l=r.liveStylingInstance.el;if(i.scope&&(l=l.querySelector(i.scope)),o=l.querySelector(":scope > .tf_tooltip"),!e&&o)return void o.remove();t.loadCss("tooltip");const s=ThemifyConstructor,n=i.prefix||"_tooltip",a=s.getEl(n).value;if(""!==a){o||(o=A("","tf_tooltip"),l.appendChild(o));let t=s.getEl(n+"_w").value;o.classList.add("tf_abs_c"),o.innerHTML=a,o.style.background=r.Helper.getColor(s.getEl(n+"_bg")),o.style.color=r.Helper.getColor(s.getEl(n+"_c")),""!==t&&(t+=s.getEl(n+"_w_unit").value),o.style.width=t,o.classList.remove("tf_hide")}else o?.remove()}},text:{update(t,e,i){const o=i.getEl(t);null!==o&&(o.value=e??"")},render(t,e){const i=E(),o=A("input"),l=e.getStyleVal(t.id)??t.default;if(o.type=t.input_type||"text",!0===e.is_repeat?(o.className=!0===e.is_sort?"tb_lb_sort_child":"tb_lb_option_child",o.dataset.inputId=t.id):(o.className="tb_lb_option",o.id=t.id),t.placeholder!==y&&(o.placeholder=t.placeholder),t.custom_args!==y)for(let e in t.custom_args)o.setAttribute(e,t.custom_args[e]);return l!==y&&(o.value=l),t.class!==y&&(o.className+=" "+t.class),i.appendChild(e.O(o,t)),t.unit!==y&&i.appendChild(e.select.render(t.unit,e)),t.after!==y&&i.appendChild(e.after(t)),t.description!==y&&i.appendChild(e.description(t.description)),t.tooltip!==y&&i.appendChild(e.hint(t.tooltip)),i}},number:{render:(t,e)=>(t.input_type="number",t.custom_args===y&&(t.custom_args={min:t.min||0},t.max!==y&&(t.custom_args.max=t.max),t.step!==y&&(t.custom_args.step=t.step)),e.text.render(t,e))},angle:{update(t,e,i){i.range.update(t,e,i)},render(e,i){e.input_type="number",e.custom_args={min:0,max:360};const o=A("",{class:"tb_angle_container tf_rel",tabindex:-1}),n="tb_lb_option tb_angle_input";e.class=e.class!==y?e.class+" "+n:n,o.appendChild(i.range.render(e,i));const a=o.querySelector("#"+e.id),r=e.event||("styling"===i.clicked?"keyup":"change");return a.tfOn("pointerdown",(function(e){e.stopImmediatePropagation();let i=this.parentNode.tfClass("tb_angle_circle")[0];if(!i){let t=this.value;const e=A("","tb_angle_dot"),o=A("","tb_angle_circle_wrapper");i=A("","tb_angle_circle"),""!==t&&(e.style.transform="rotate("+t+"deg)"),i.appendChild(e),o.appendChild(i),this.parentNode.appendChild(o)}i.tfOn(e.type,(function(e){if(0===e.button){let i,o=this.getBoundingClientRect(),n=this.offsetWidth/2+o.left,_=this.offsetHeight/2+o.top,c=this.parentNode.tfClass("tb_angle_dot")[0];const d=180/f.PI,p=t=>{t.stopImmediatePropagation(),C.add("tb_start_animate")},b=e=>{e.stopImmediatePropagation(),i=l((()=>{let i=f.atan2(_-e.clientY,n-e.clientX)*d;i-=90,i<0&&(i+=360),i=f.round(i),c.style.transform="rotate("+i+"deg)",a.value=i,t.triggerEvent(a,r)}))},u=function(){s(i),this.tfOff("pointermove",p,{passive:!0,once:!0}).tfOff("pointermove",b,{passive:!0}).tfOff("lostpointercapture pointerup",u,{passive:!0,once:!0}),C.remove("tb_start_animate"),l((()=>{c=n=i=_=null}))};this.tfOn("lostpointercapture pointerup",u,{passive:!0,once:!0}).tfOn("pointermove",p,{passive:!0,once:!0}).tfOn("pointermove",b,{passive:!0}).setPointerCapture(e.pointerId),b(e)}}),{passive:!0})}),{passive:!0,once:!0}),o}},autocomplete:{ct:new h,render(e,i){const o=i.text.render(e,i);if(e.dataset===y)return o;let l=null;const s=this,n=o.querySelector("input",{autocomplete:"off"}),a=A("","tb_autocomplete_container");return o.appendChild(a),n.tfOn("input",(async function(){const t=this.nextElementSibling,i=this.value,o=e.dataset,n=o+i;if(t.replaceChildren(),""!==i){l?.abort();let e=s.ct.get(n);if(!e){const t=this.parentNode;try{l=new AbortController,t.classList.add("tb_autocomplete_loading","tf_loader"),e=await r.LocalFetch({action:"tb_get_ajax_data",mode:"autocomplete",dataset:o,value:i},!1,{signal:l.signal}),e=e.success?e.data:"",s.ct.set(n,e)}catch(t){}t.classList.remove("tb_autocomplete_loading","tf_loader")}if(e){const i=E();for(let t in e)i.appendChild(A("",{class:"tb_autocomplete_item","data-value":t},e[t]));t.classList.add("tf_scrollbar"),t.appendChild(i)}l=null}}),{passive:!0}),a.tfOn("pointerdown",(function(e){if(0===e.button&&e.target.classList.contains("tb_autocomplete_item")){e.preventDefault(),e.stopPropagation();const i=this.previousElementSibling;i.value=e.target.dataset.value,i.blur(),t.triggerEvent(i,"change")}})),o}},mediaFile:{_frames:{},browse(e,i,o,l){e.tfOn(b,(e=>{let o;e.preventDefault(),e.stopPropagation(),this._frames[l]!==y?o=this._frames[l]:(o=wp.media.frames.file_frame=wp.media({title:i.dataset.title||g["upload_"+l]||g.upload_image,library:{type:"json"===l?"text/plain,application/json":l},button:{text:g.insert_image},multiple:!1}),this._frames[l]=o),o.off("select").on("select",(()=>{r.ActionBar.disable=!0;const e=o.state().get("selection").first().toJSON();i.value=e.url,t.triggerEvent(i,"change"),$(i).trigger("change");const l=i.getRootNode().querySelector("#"+i.id+"_id");l&&(l.value=e.id)})),o.on("close",(()=>{r.ActionBar.disable=!0,n((()=>{r.ActionBar.disable=null}),5)})),o.open(),o.content.mode("browse")})),"image"===l&&i.tfOn("change",(t=>{this.setImage(e,t.currentTarget.value.trim())}),{passive:!0})},setImage(t,e){if(t.replaceChildren(),e){const i=40,o=40,l=new Image(i,o),s=new Image(i,o);s.decoding="async",s.src="https://placehold.co/"+i+"x"+o+".png",l.src=e,l.decoding="async",l.decode().catch((()=>{})).finally((()=>{s.replaceWith(l)})),t.appendChild(s)}},update(t,e="",i){const o=i.getEl(t);null!==o&&(o.value=e,this.setImage(o.parentNode.tfClass("thumb_preview")[0],e))},render(e,i,o){const l=A("","tb_uploader_wrapper tf_rel"),s=A("input",{class:"tb_uploader_input",type:"text",required:"required",pattern:/.*\S.*/.source,autocomplete:"off"}),n=A("a",{class:"tb_media_uploader tb_upload_btn thumb_preview tf_plus_icon tf_rel",href:"#",title:g.browse_image,"data-library-type":"json"===e?"text/plain,application/json":e}),a=A("span","tb_clear_input tf_close"),r=o.getStyleVal(i.id);let _;return i.title&&(s.dataset.title=i.title),!0===o.is_repeat?(s.className+=!0===o.is_sort?" tb_lb_sort_child":" tb_lb_option_child",_="tb_"+f.random().toString(36).substr(2,7),s.dataset.inputId=i.id):(s.className+=" tb_lb_option",_=i.id),s.id=_,r!==y&&(s.value=r),a.tfOn(b,(e=>{e.stopPropagation(),s.value="",t.triggerEvent(s,"change")}),{passive:!0}),l.append(o.O(s,i),a,n),"image"===e&&this.setImage(n,r),this.browse(n,s,o,e),i.after!==y&&l.appendChild(o.after(i)),i.description!==y&&l.appendChild(o.description(i.description)),i.tooltip!==y&&l.appendChild(o.hint(i.tooltip)),l}},file:{render:(t,e)=>e.mediaFile.render(t.ext,t,e)},image:{render:(t,e)=>e.mediaFile.render("image",t,e)},video:{render:(t,e)=>e.mediaFile.render("video",t,e)},audio:{render:(t,e)=>e.mediaFile.render("audio",t,e)},lottie:{dt(t,e,i,o,l){const s=g.lottie,n={"":"none"};for(let e of t.keys())n[e]=e;const a=l?{"":"onload",click:"click",hover:"h",hold:"hold",pausehold:"phold",seek:"seek",scroll:"scroll",basket:s.basket,none:s.n}:{"":"onload",click:"click",hover:"h",hold:"hold",pausehold:"phold",seek:"seek",basket:s.basket},r=[{id:"st",type:"select",label:s.pl,options:a,binding:{"":{show:["tb_loop_msg","count"],hide:["tb_click_msg","tb_hover_msg","tb_click_hover_input","tb_hold_msg","tb_scroll_wr","tb_seek_msg","tb_pausehold_msg"]},click:{show:["tb_click_msg","tb_click_hover_input","count"],hide:["tb_loop_msg","tb_hover_msg","tb_hold_msg","tb_scroll_wr","tb_seek_msg","tb_pausehold_msg"]},hover:{show:["tb_hover_msg","tb_click_hover_input","count"],hide:["tb_loop_msg","tb_click_msg","tb_hold_msg","tb_scroll_wr","tb_seek_msg","tb_pausehold_msg"]},seek:{show:["tb_seek_msg"],hide:["tb_click_msg","tb_hover_msg","tb_click_hover_input","tb_hold_msg","tb_loop_msg","tb_scroll_wr","tb_pausehold_msg","count"]},pausehold:{show:["tb_pausehold_msg"],hide:["tb_click_msg","tb_hover_msg","tb_click_hover_input","tb_hold_msg","tb_loop_msg","tb_seek_msg","tb_scroll_wr","count"]},hold:{show:["tb_hold_msg"],hide:["tb_click_msg","tb_hover_msg","tb_click_hover_input","tb_pausehold_msg","tb_loop_msg","tb_seek_msg","tb_scroll_wr","count"]},scroll:{show:["tb_scroll_wr"],hide:["tb_click_msg","tb_hover_msg","tb_click_hover_input","tb_pausehold_msg","tb_loop_msg","tb_seek_msg","tb_hold_msg","count"]},none:{hide:["tb_click_msg","tb_hover_msg","tb_click_hover_input","tb_hold_msg","count","tb_pausehold_msg","tb_scroll_wr","tb_next_msg","tb_seek_msg","speed","delay","dir"]},basket:{hide:["tb_click_msg","tb_hover_msg","tb_click_hover_input","tb_hold_msg","tb_pausehold_msg","tb_seek_msg","tb_scroll_wr","tb_next_msg"]}}},{label:"csssel",id:"sel",wrap_class:"tb_click_hover_input"+("hover"!==o&&"click"!==o?" _tb_hide_binding":""),type:"text",help:s.clsel,control:{event:"change"}},l?{}:{id:"lp",label:"loop",type:"toggle_switch",default:"on",options:{on:{name:"",value:"y"},off:{name:"1",value:"no"}},binding:{empty:{hide:"count"},not_empty:{show:"count"}}},{id:"count",label:"pbcount",type:"range",min:1,placeholder:1},{type:"message",label:"",wrap_class:"tb_click_msg"+("click"!==o?" _tb_hide_binding":""),comment:s.clm},{type:"message",label:"",wrap_class:"tb_hover_msg"+("hover"!==o?" _tb_hide_binding":""),comment:s.hm},{type:"message",label:"",wrap_class:"tb_hold_msg"+("hold"!==o?" _tb_hide_binding":""),comment:s.hlm},{type:"message",label:"",wrap_class:"tb_seek_msg"+("seek"!==o?" _tb_hide_binding":""),comment:s.sm},{type:"message",label:"",wrap_class:"tb_pausehold_msg"+("pausehold"!==o?" _tb_hide_binding":""),comment:s.phm},{type:"group",wrap_class:"tb_scroll_wr"+("scroll"!==o?" _tb_hide_binding":""),options:[{id:"vis",type:"slider_range",label:"visibility",help:s.in_r,options:{unit:"%"}},{id:"s_ev",type:"select",label:"e",options:{"":"play",seek:"seek"}}]},{id:"sp",type:"range",label:"speed",increment:.1,min:.1,placeholder:1},{id:"dir",label:"rev",type:"toggle_switch",options:{on:{name:"-1",value:"y"},off:{value:"no"}}},{id:"fid",type:"select",label:s.fid,wrap_class:"tb_lottie_frame_id",help:s.fidm,options:n,control:!1},{id:"seg",type:"slider_range",wrap_class:"tb_lottie_range_id",label:s.seg,help:s.segm,options:{min:e,max:i,unit:""}},{id:"del",type:"range",label:"delay",after:"sec",help:s.delm,increment:.1,min:0,placeholder:0},{id:"r",label:"ren",type:"select",help:s.renm,options:{"":"SVG",c:"Canvas",h:"HTML"}}];if(!l){const t=!!a.scroll;for(let e=r.length-1;e>-1;--e){let i=r[e],o=i.id;("del"===o||"sel"===o||"st"===o||i.comment===s.clsel||!1===t&&i.wrap_class?.includes("tb_scroll_wr"))&&("st"===o?!1===t&&(delete i.binding.scroll,delete i.binding.none):r.splice(e,1))}}return r},render(i,o){let l=o.values,s=i.binding,a={empty:{hide:"tb_lottie_wrap"},not_empty:{show:"tb_lottie_wrap"}},_=A("","tf_loader tf_abs_c");s?(s=r.Helper.cloneObject(s),s.empty?.hide?(Array.isArray(s.empty.hide)||(s.empty.hide=[s.empty.hide]),s.empty.hide.push(a.empty.hide)):(s.empty??={},s.empty.hide=a.empty.hide),s.not_empty?.show?(Array.isArray(s.not_empty.show)||(s.not_empty.show=[s.not_empty.show]),s.not_empty.show.push(a.not_empty.show)):(s.not_empty??={},s.not_empty.show=a.not_empty.show)):s=a,i.control=!1;const c=E(),p=A("button",{class:"builder_button tb_text_button tb_btn_arrow",type:"button"}),u=A("","tb_lottie_wrap tf_rel tf_w"),w=o.create([{type:"file",ext:"json",id:"path",label:"jsf",binding:s}]),v=w.querySelector("input"),k=!!o.is_repeat,x=!!i.multi,C=async(i,s,a)=>{let r={},c=i.closest(".tb_field").parentNode.closest(".tb_field").tfClass("tb_lottie_wrap")[0];_||(_=A("","tf_loader tf_abs_c"),c.appendChild(_)),i.value&&(await t.loadJs("lottie",!!e.TF_Lottie),r=await TF_Lottie.getJson(i.value));const p=r.markers||[],b=new h;if(p.length>1)for(let t=0;t<p.length;++t){let e=p[t],i=e.cm;if(i){try{i=d.parse(i).name}catch(t){}b.set(i,{min:e.tm,max:e.tm+e.dr})}}let u=a&&b.has(a)?b.get(a):{},m=u.min||0,g=u.max??(r.op?f.floor(r.op-r.ip):"");if(g=~~g||"",c.childElementCount<=1){const t=o.values,e=!!o.is_repeat;o.is_repeat=k,o.values=l,c.appendChild(o.create(this.dt(b,m,g,l.st,x))),o.is_repeat=e,o.values=t}const y=c.tfClass("tb_lottie_frame_id")[0],w=y.tfTag("select")[0],v=c.tfClass("tb_lottie_range_id")[0].tfClass("tb_slider_wrapper")[0];if(0===b.size&&(y.style.display="none"),s){const e=v.tfClass("tb_lb_option_child")[0]||v.tfClass("tb_lb_option")[0],i=E(),o=v.querySelectorAll('[type="range"]');if(!a)for(let t=w.children,e=t.length-1;e>0;--e)t[e].remove();if(b.size>0){if(!a)for(let t of b.keys())i.appendChild(A("option",{value:t},t));y.style.display="",w.appendChild(i)}v.tfClass("tb_slider_output_high")[0].dataset.slider_before=m,v.tfClass("tb_slider_output_low")[0].dataset.slider_after=g,v.style.setProperty("--tb_slider_min",m),v.style.setProperty("--tb_slider_before",m),v.style.setProperty("--tb_slider_after",g),v.style.setProperty("--tb_slider_max",g);for(let t=o.length-1;t>-1;--t){let e=o[t];e.max=g,e.min=m,e.value=0===t?m:g}e.value="",t.triggerEvent(o[0],"input")}else w.tfOn("change",(t=>{t.stopPropagation(),C(i,!0,t.currentTarget.value)}),{passive:!0}),n((()=>{o.callbacks()}),1e4);_?.remove(),_=null},S=()=>{let t=o.mediaFile._frames.json;t!==y&&(t=t.content.get(),t.collection.props.set({ignore:+new Date}),t.options.selection.reset())},T=async()=>{r.Spinner.showLoader();try{const i=m.i18n.lottie_lib;i.all=g.all,await t.loadJs(t.url+"js/admin/modules/lottie-library",!!e.TF_LottieLibrary),await TF_LottieLibrary.run(v,i,m.nonce),v.tfOff("change",S,{passive:!0,once:!0}).tfOn("change",S,{passive:!0,once:!0}),r.Spinner.showLoader("done")}catch(t){r.Spinner.showLoader("error")}};return p.tfOn(b,(async t=>{t.stopPropagation(),T()}),{passive:!0}).innerHTML=m.i18n.lottie_lib.browse,v.tfOn("change",(t=>{t.stopPropagation(),C(t.currentTarget,!0)}),{passive:!0}),u.appendChild(_),w.querySelector(".tb_input").appendChild(p),c.append(w,u),o.afterRun.push((()=>{if(C(v,!1,l.fid),x){o.is_new&&T();const t=v.closest(".tb_row_js_wrapper");if(t.parentNode.tfClass("tb_lottie_export")[0]===y){const e=A("button",{class:"builder_button tb_text_button tb_lottie_export",type:"button"},g.lottie.exp);e.tfOn(b,(t=>{t.stopPropagation();const e=r.Forms.serialize("tb_options_setting",!1);for(let t in e)"actions"!==t&&"loop"!==t&&delete e[t];const i='<tf-lottie data-lazy="1" class="tf_w tf_lazy"><template>'+d.stringify(e)+"</template></tf-lottie>",o=g.lottie.copy.replaceAll("%html%",'<textarea style="border:0;outline:0;resize:none;display:inline-table;font-weight:bold;margin-top:20px" readonly class="tf_w">'+i+"</textarea>");r.LiteLightBox.alert(o);const l=r.LiteLightBox.el.tfTag("textarea")[0],s=()=>{l.focus(),l.select()};l.tfOn(t.type,s,{passive:!0}),s()}),{passive:!0}),t.after(e)}}})),c}},icon_radio:{controlChange(e){e.tfOn(b,(i=>{if(i.preventDefault(),i.stopImmediatePropagation(),i.target!==e){const e=i.target.closest("label").tfTag("input")[0];!0===e.checked?(e.checked=!1,e.value=y):(e.checked=!0,e.value=e.dataset.value),t.triggerEvent(e,"change")}}))},render:(t,e)=>e.radioGenerate("icon_radio",t)},radio:{controlChange(t){const e=t.classList.contains("tb_radio_dnd")?t.closest(".tb_repeatable_field_content"):t.closest(".tb_tab,.tb_expanded_opttions")||r.LightBox.el,i=t.parentNode.parentNode.tfTag("input"),o=t.value,l=e.tfClass("tb_group_element_"+o);for(let t=i.length-1;t>-1;--t){let l=i[t].value;if(o!==l){let t=e.tfClass("tb_group_element_"+l);for(let e=t.length-1;e>-1;--e)t[e].style.display="none"}}for(let t=l.length-1;t>-1;--t)l[t].style.display=""},update(t,e,i){const o=i.getEl(t);if(null!==o){const t=o.tfTag("input"),i=o.classList.contains("tb_icon_radio");let l=null;for(let i=t.length-1;i>-1;--i)if(t[i].value===e){l=t[i];break}if(null===l){const e=o.dataset.default;e!==y&&(l=o.querySelector('[value="'+e+'"]')),!1===i&&null===l&&(l=t[0])}if(null!==l)l.checked=!0,!1===i&&o.classList.contains("tb_option_radio_enable")&&this.controlChange(l);else if(!0===i)for(let e=t.length-1;e>-1;--e)t[e].checked=!1}},render:(t,e)=>e.radioGenerate("radio",t)},icon_checkbox:{render:(t,e)=>e.checkboxGenerate("icon_checkbox",t)},checkbox:{update(t,e,i){const o=i.getEl(t);if(null!==o){const t=o.tfTag("input"),i=o.classList.contains("tb_option_checkbox_enable");e=e?.toString().split("|")||[];for(let o=t.length-1;o>-1;--o)t[o].checked=e.includes(t[o].value),!0===i&&this.controlChange(t[o])}},controlChange(t){const e=t.classList.contains("tb_radio_dnd")?t.closest(".tb_repeatable_field_content"):r.LightBox.el,i=t.parentNode.parentNode,o=i.tfTag("input"),l=i.classList.contains("tb_option_checkbox_revert");for(let t=o.length-1;t>-1;--t){let i=e.tfClass("tb_checkbox_element_"+o[t].value),s=o[t].checked;for(let t=i.length-1;t>-1;--t)i[t].classList.toggle("_tb_hide_binding",!(!0===l&&!1===s||!1===l&&!0===s))}},render:(t,e)=>e.checkboxGenerate("checkbox",t)},radioGenerate(t,e){const i=E(),o=A("",{class:"tb_radio_wrap",tabindex:-1}),l="icon_radio"===t,s=this.getOptions(e),n=this.getStyleVal(e.id),a=!0===e.option_js,r=[],_=this,c=s.length;let d,p=null,u=e.default??!1;c>1&&(e.new_line!==y&&(o.className+=" tb_new_line"),o.className+=" tb_count_"+c),!0===a&&(o.className+=" tb_option_radio_enable"),!0===l&&(o.className+=" tb_icon_radio",p=e.no_toggle===y),!0===this.is_repeat?(o.className+=!0===this.is_sort?" tb_lb_sort_child":" tb_lb_option_child",d="tb_"+f.random().toString(36).substr(2,7),o.dataset.inputId=e.id):(o.className+=" tb_lb_option",o.id=d=e.id),!1!==u?o.dataset.default=u:!1===l&&n===y&&s[0]&&(u=s[0].value),e.before!==y&&i.appendChild(z(e.before));for(let t=0;t<c;++t){let i=[],c=s[t],p=g[c.name]||c.name,b=A("label",c.class),h=A("input",{type:"radio",name:d,value:c.value});if(!0===l&&(h.dataset.value=c.value),!0===this.is_repeat&&i.push("tb_radio_dnd"),e.class!==y&&i.push(e.class),i.length>0&&(h.className=i.join(" ")),!0===c.disable&&(h.disabled=!0),(n===c.value||n===y&&u===c.value)&&(h.checked=!0,!0===a&&r.push(h)),b.appendChild(h),!0===a&&h.tfOn("change",(function(){this.parentNode.parentNode.blur(),_.radio.controlChange(this)}),{passive:!0}),!0===l){if(c.icon!==y){let t=A("span","tb_icon_wrapper");t.innerHTML=c.icon,b.appendChild(t)}c.label_class!==y&&(b.className+=c.label_class),p!==y&&b.appendChild(A("span","themify_tooltip",p))}else p!==y&&b.appendChild(A("span","",p));o.appendChild(b),this.O(h,e)}return o.tfOn(b,(function(t){"LABEL"===t.target.parentNode.tagName&&this.blur()}),{passive:!0}),i.appendChild(o),e.after!==y&&i.appendChild(_.after(e)),e.description!==y&&i.appendChild(_.description(e.description)),!0===l&&!0===p&&_.icon_radio.controlChange(o),!0===a&&this.S.push((()=>{for(let t=0,e=r.length;t<e;++t)_.radio.controlChange(r[t])})),i},checkboxGenerate(t,e){const i=E(),o=A("","tb_checkbox_wrap"),l=this.getOptions(e),s="icon_checkbox"===t,n=!0===e.option_js,a=this,_=[],c=l.length;let d=this.getStyleVal(e.id),p=null,u=null;c>1&&(!1===e.new_line&&(o.className+=" tb_one_row"),o.className+=" tb_count_"+c),!0===n&&(o.className+=" tb_option_checkbox_enable",e.reverse!==y&&(o.className+=" tb_option_checkbox_revert")),!0===this.is_repeat?(o.className+=!0===this.is_sort?" tb_lb_sort_child":" tb_lb_option_child",o.dataset.inputId=e.id):(o.className+=" tb_lb_option",o.id=e.id),e.wrap_checkbox!==y&&(o.className+=" "+e.wrap_checkbox),d===y?e.default!==y&&(p=e.default,u=Array.isArray(p)):!1!==d&&(d=(""+d).split("|")),!0===s&&(o.className+=" tb_icon_checkbox"),e.before!==y&&i.appendChild(z(e.before));for(let t=0;t<c;++t){let i=l[t],c=g[i.value]||i.value,b=A("label"),h=A("input",{type:"checkbox",class:"tb_checkbox",value:i.name});if(h.checked=!1!==d&&d?.includes(i.name)||p===i.name||!0===u&&p.includes(i.name),e.class!==y&&(h.className+=" "+e.class),!0===n&&(h.tfOn("change",(function(){a.checkbox.controlChange(this)}),{passive:!0}),_.push(h)),"hide_anchor"===e.id&&r.activeModel.options(h,"hide_anchor"),b.appendChild(h),!0===s?(b.insertAdjacentHTML("beforeend",i.icon),c!==y&&b.appendChild(A("span","themify_tooltip",c))):c!==y&&b.appendChild(z(c)),i.help!==y){let t=A("","tb_checkbox_help");t.append(b,this.help(i.help)),b=t}o.appendChild(b),this.O(h,e)}return"hide_anchor"===e.id&&o.tfOn(b,(t=>{t.stopPropagation()})),i.appendChild(o),e.after!==y&&(e.label!==y&&""!==e.label||e.help===y||""===e.help?i.appendChild(this.after(e)):(o.className+=" contains-help",o.appendChild(this.after(e)))),e.description!==y&&i.appendChild(this.description(e.description)),!0===n&&this.afterRun.push((()=>{for(let t=0,e=_.length;t<e;++t)a.checkbox.controlChange(_[t])})),i},date:{bt:null,render(e,i){const o=E(),l=A("input",{type:"text",class:"themify-datepicker fullwidth",autocomplete:"off",readonly:""}),s=A("button",{type:"button",class:"themify-datepicker-clear tf_close"}),a=()=>x.jQuery.fn.themifyDatetimepicker?x.jQuery.fn.themifyDatetimepicker:x.jQuery.fn.datetimepicker,_=()=>{a().call($(l),"hide")},c=()=>{const t=a();if(!t)return;const i=e.picker??{};s.tfOn(b,(function(t){t.preventDefault(),t.stopPropagation(),l.value="",l.dispatchEvent(new Event("change")),this.style.display="none"})),t.call($(l),{showTimepicker:!(e.timepicker!==y&&!e.timepicker),showButtonPanel:!0,changeYear:!0,dateFormat:i.dateformat||"yy-mm-dd",timeFormat:i.timeformat||"HH:mm:ss",stepMinute:i.stepMinute||5,stepSecond:i.stepSecond||5,controlType:i.timecontrol||"select",oneLine:!0,separator:i.timeseparator||" ",onSelect(t){s.style.display=""===t?"none":"block",l.dispatchEvent(new Event("change"))},beforeShow(t,e){e.dpDiv.addClass("themify-datepicket-panel");const i=t.getBoundingClientRect();n((()=>{e.dpDiv.css({top:i.top+t.offsetHeight,left:i.left})}),10),r.isVisual&&w.tfOn(b,_,{once:!0})},onClose(){r.isVisual&&w.tfOff(b,_,{once:!0})}})};if(!0===i.is_repeat?(l.className+=!0===i.is_sort?" tb_lb_sort_child":" tb_lb_option_child",l.dataset.inputId=e.id):(l.className+=" tb_lb_option",l.id=e.id),i.values[e.id]!==y&&(l.value=i.values[e.id]),e.class!==y&&(l.className+=" "+e.class),l.value||(s.style.display="none"),o.append(i.O(l,e),s),e.after!==y&&o.appendChild(i.after(e)),e.description!==y&&o.appendChild(i.description(e.description)),null===this.bt){i.afterRun.push((()=>{S.loadCss(t.url+"themify-metabox/css/jquery-ui-timepicker.min"),S.loadJs(t.includesURL+"js/jquery/ui/datepicker.min",x.jQuery.fn.datepicker!==y,themify_vars.wp).then((()=>{S.loadJs(t.url+"themify-metabox/js/jquery-ui-timepicker.min",x.jQuery.fn.themifyDatetimepicker!==y||x.jQuery.fn.datetimepicker!==y,"1.6.3").then((()=>{this.bt=!0,n(c,10)}))}))}))}else i.afterRun.push(c);return o}},gradient:{nt(e,i,o,l,s,n,a,c,d){let p=e.getStyleVal(n.id);p!==y&&""!==p||(p=180);let u=!1,h=$(i),f=e.getStyleVal(o.id),m={angle:p,onChange(e,i){u&&(e=i=""),o.value=e,r.isVisual&&t.triggerEvent(o,"themify_builder_gradient_change",{val:i})}};f&&(m.gradient=f,o.value=f),n.value=p;let g=e.getStyleVal(s.id);g!==y&&""!==g||(g="linear"),s.value=g,m.type=g,a.checked&&(m.circle=!0),d||h.ThemifyGradient(m);const w=h.data("themifyGradient"),v=t=>{let e=n.parentNode;e.classList.contains("tb_angle_container")||(e=n),c.style.display=e.style.display="radial"===t?"none":"",a.parentNode.style.display="radial"===t?"":"none"};d?(w.settings={...w.settings,...m},w.settings.type=g,w.settings.circle=a.checked,w.isInit=!1,w.update(),w.isInit=!0):(l.tfOn(b,(t=>{t.preventDefault(),t.stopImmediatePropagation(),u=!0,w.settings.gradient=$.ThemifyGradient.default,w.update(),u=!1})),s.tfOn("change",(function(){const t=this.value;w.setType(t),v(t)}),{passive:!0}),a.tfOn("change",(function(){w.setRadialCircle(this.checked)}),{passive:!0}),n.tfOn("keyup",(function(){let t=_(this.value);isNaN(t)&&(t=0),w.setAngle(t)}),{passive:!0}),i.appendChild(l)),v(e.getStyleVal(s.id))},update(t,e,i){const o=t+"-gradient",l=i.getEl(o);if(null!==l){const e=i.getEl(o+"-angle"),s=i.getEl(o+"-type"),n=i.getEl(t+"-circle-radial");this.nt(i,l.previousElementSibling,l,null,s,e,n.tfClass("tb_checkbox")[0],n.previousElementSibling,!0)}},render(t,e){const i=t.id,o=A("","themify-gradient-field tf_w tf_rel"),l=A("span","",g.rotation),s=A("","tb_gradient_container tf_w"),n=A("input",{type:"hidden",class:"themify-gradient tb_lb_option",id:i+"-gradient","data-id":i}),a=A("button",{type:"button",class:"tb_clear_gradient tf_close"}),_=e.select.render({options:{linear:"linear",radial:"radial"},class:"themify-gradient-type",id:i+"-gradient-type",control:!1},e);t.option_js!==y&&(o.className+=" tb_group_element_gradient"),a.appendChild(A("span","themify_tooltip",g.clear_gradient));const c=r.Helper.cloneObject(t);c.id=i+"-gradient-angle";const d=e.angle.render(c,e);return o.append(_,d,l,e.checkboxGenerate("checkbox",{id:i+"-circle-radial",options:[{name:"1",value:"circle_radial"}]}),s,n),e.O(n,t),e.afterRun.push((()=>{this.nt(e,s,n,a,o.querySelector(".themify-gradient-type"),d.tfClass("tb_angle_input")[0],o.tfClass("tb_checkbox")[0],l)})),o}},fontColor:{update(t,e,i){i.radio.update(t,i.getStyleVal(t),i)},render(t,e){t.isFontColor=!0;const i=e.radioGenerate("radio",{id:t.id,type:"radio",option_js:!0,isFontColor:!0,options:[{value:t.s+"_solid",name:"solid"},{value:t.g+"_gradient",name:"gradient"}]}),o=i.querySelector(".tb_lb_option"),l=r.Helper.cloneObject(t);l.label="",l.type="color",l.id=t.s,l.prop="color",l.wrap_class="tb_group_element_"+t.s+"_solid";const s=e.create([l]);l.id=t.g,l.wrap_class="tb_group_element_"+t.g+"_gradient",l.type="gradient",l.prop="background-image";const n=e.create([l]);return e.afterRun.push((()=>{const t=o.parentNode.closest(".tb_field");t.parentNode.insertBefore(s,t.nextElementSibling),t.parentNode.insertBefore(n,t.nextElementSibling)})),t.label??="f_c",i}},imageGradient:{update(t,e,i){i.radio.update(t+"-type",i.getStyleVal(t+"-type"),i),i.mediaFile.update(t,e,i),i.gradient.update(t,e,i);const o=i.getEl(t);if(null!==o){let t=o.closest(".tb_tab"),e=t.tfClass("tb_image_options"),l=t.tfClass("tb_gradient_image_color")[0].tfClass("tfminicolors-input")[0].id;i.color.update(l,i.getStyleVal(l),i);for(let t=0;t<e.length;++t)l=e[t].tfClass("tb_lb_option")[0].id,i.select.update(l,i.getStyleVal(l),i)}},render(t,e){const i=A("","tb_image_gradient_field"),o=A("","tb_group_element_image tf_w tf_rel");i.appendChild(e.radioGenerate("radio",{type:t.type,id:t.id+"-type",options:[{name:"image",value:"image"},{name:"gradient",value:"gradient"}],option_js:!0})),t.option_js===y&&(t.option_js=!0),t.binding===y&&(t.binding={empty:{hide:"tb_image_options"},not_empty:{show:"tb_image_options"}});const l=r.Helper.cloneObject(t);return l.type="image",o.appendChild(e.mediaFile.render("image",r.Helper.cloneObject(l),e)),i.appendChild(o),l.type="gradient",delete l.class,delete l.binding,i.appendChild(e.gradient.render(l,e)),e.afterRun.push((()=>{const t={wrap_class:"tb_group_element_image tf_w tf_rel",type:"group",options:[]};l.prop="background-color",l.wrap_class="tb_gradient_image_color",l.label="bg_c",l.type="color",l.id=l.colorId,t.options.push(r.Helper.cloneObject(l)),l.prop="background-mode",l.wrap_class="tb_image_options",l.label="b_r",l.repeat=!0,l.type="select",l.id=l.repeatId,t.options.push(r.Helper.cloneObject(l)),l.prop="background-position",l.wrap_class="tb_image_options",l.label="b_p",l.position=!0,l.type="position_box",l.id=l.posId,delete l.repeat,t.options.push(r.Helper.cloneObject(l)),o.parentNode.closest(".tb_field").after(e.create([t]))})),t.label??="bg",i}},layout:{nt(e){e.tfOn(b,(function(i){if(i.preventDefault(),i.stopPropagation(),i.target!==e){const e=i.target.closest("a");if(null!==e){const i=this.tfClass("tfl-icon");for(let t=i.length-1;t>-1;--t)i[t].classList.remove("selected");e.classList.add("selected"),t.triggerEvent(this,"change",{val:e.id})}}}))},update(t,e,i){const o=i.getEl(t);if(null!==o){const t=o.tfClass("tfl-icon");for(let i=t.length-1;i>-1;--i)t[i].classList.toggle("selected",e===t[i].id);if(e===y){let e=o.dataset.default;e=e===y?t[0]:e.querySelector("#"+e),e.classList.add("selected")}}},render(e,i){let o=A("","themify-layout-icon"),l=i.getOptions(e),s=i.getStyleVal(e.id);if(!0===e.color&&!0===e.transparent&&(l=[...l],l.push({img:"transparent",value:"transparent",label:g.transparent})),!0===i.is_repeat?(o.className+=!0===i.is_sort?" tb_lb_sort_child":" tb_lb_option_child",o.dataset.inputId=e.id):(o.className+=" tb_lb_option",o.id=e.id),e.class!==y&&(o.className+=" "+e.class),s===y){if(e.default!==y)s=e.default;else{const t="module"===r.activeModel.type?r.activeModel.getPreviewSettings():null;s=t?.[e.id]??(l[0].value||"")}i.settings[e.id]=s}s=""+s;for(let i=0;i<l.length;++i){let n,{value:a="",img:r,label:_}=l[i],c=A("a",{href:"#",class:"tfl-icon",id:a}),d=A("span","themify_tooltip",g[_]||_);s===""+a&&(c.className+=" selected"),"sprite"!==e.mode||r.includes(".png")?(n=new Image,n.alt=g[_]||_,n.src=r.includes("http")?r:t.builder_url+"editor/img/"+r):(n=A("span","tb_sprite"),r.includes("http")?n.style.backgroundImage="url("+r+")":n.className+=" tb_"+r),c.append(n,d),o.appendChild(c)}return this.nt(o),"row"!==i.component||"row_width"!==e.id&&"row_height"!==e.id?i.O(o,e):r.activeModel.options(o,e.type),o}},layoutPart:{data:[],async get(){if(0===this.data.length)try{r.Spinner.showLoader(),this.data=await r.LocalFetch({action:"tb_get_library_items"}),r.Spinner.showLoader("done")}catch(t){throw r.Spinner.showLoader("error"),t}},render(t,e){t.setOptions=!1;const i=e.values[t.id],o=E(),l=e.select.render(t,e),s=A("a"),n=A("a"),a=l.querySelector("select");return this.get().then((()=>{const t=r.LayoutPart?.id?""+r.LayoutPart.id:null,e=this.data;a.appendChild(A("option"));for(let o=0;o<e.length;++o)if(t!==""+e[o].id){let t=A("option",{value:e[o].post_name},e[o].post_title);i===e[o].post_name&&(t.selected=!0),a.appendChild(t)}})),o.append(l,A("br")),t.add_url&&(n.href=t.add_url,n.className="add_new tf_plus_icon tb_icon_btn tf_rel",n.textContent=g.nlayout,o.appendChild(n)),t.edit_url&&(s.target=n.target="_blank",s.className="tb_icon_btn",s.href=t.edit_url,s.append(r.Helper.getIcon("ti-folder"),z(g.mlayout)),o.appendChild(s)),o}},separator:{render(t,e){let i;const o=t.label??"f",l=g[o]??o;if(l)i=t.wrap_class!==y?A():E(),i.append(A("hr"),A("h4","",l)),t.wrap_class!==y&&(i.className=t.wrap_class);else if(t.html!==y){const e=A();e.innerHTML=t.html,i=e.firstChild,t.wrap_class!==y&&(i.className=t.wrap_class)}else i=A("hr"),t.wrap_class!==y&&(i.className=t.wrap_class);return i}},template_fields:{render(e,i){const o=A("","tb_template_fields"),l=e.target;o.appendChild(A("h4","",g[e.title]||e.title));for(let t=0;t<e.fields.length;t++)o.appendChild(A("span","",e.fields[t]));if(e.extra){const t=A();t.innerHTML=g[e.extra]||e.extra,o.appendChild(t.firstChild)}return l&&o.tfOn(b,(e=>{if("SPAN"===e.target.tagName){const o=i.getEl(l);if(o){const i=o.selectionStart;o.value=o.value.substring(0,i)+" "+e.target.textContent+o.value.substring(i,o.value.length),t.triggerEvent(o,"keyup")}}}),{passive:!0}),o}},multiColumns:{update(t,e,i){const o=i.getEl(t);null!==o&&(e!==y?o.value=e:o[0]!==y&&(o[0].selected=!0))},render(t,e){const i=[],{id:o,selector:l}=t,s=[{id:o+"_gap",label:"c_g",type:"range",prop:"column-gap",selector:l,wrap_class:"tb_multi_columns_wrap",units:{px:{max:500}}},{type:"multi",wrap_class:"tb_multi_columns_wrap",label:"c_d",options:[{type:"color",id:o+"_divider_color",prop:"column-rule-color",selector:l},{type:"range",id:o+"_divider_width",class:"tb_multi_columns_width",prop:"column-rule-width",selector:l,units:{px:{max:500}}},{type:"select",id:o+"_divider_style",options:e.getOptions("border"),prop:"column-rule-style",selector:l}]}];for(let t=0;t<7;++t)i[t]=0===t?"":t;t.options=i,t.binding={empty:{hide:"tb_multi_columns_wrap"},not_empty:{show:"tb_multi_columns_wrap"}};const n=r.Helper.cloneObject(t);n.type="select";const a=e.select.render(n,e),_=a.querySelector("select");return e.afterRun.push((()=>{const t=_.closest(".tb_field");t.parentNode.insertBefore(e.create(s),t.nextElementSibling)})),t.label??="c_c",a}},expand:{render(e,i){const o=A("fieldset","tb_expand_wrap"),l=A("","tb_expanded_opttions"),s=A("","tb_style_toggle tb_closed");return s.append(z(g[e.label]??e.label),r.Helper.getIcon("ti-angle-up")),s.tfOn(b,(function(o){o.preventDefault(),o.stopImmediatePropagation(),this.dataset.done===y&&(this.dataset.done=!0,l.appendChild(i.create(e.options)),i.B(),i.callbacks(),t.trigger("tb_options_expand",l)),this.classList.toggle("tb_closed")})),o.append(s,l),i.afterRun.push((()=>{t.trigger("tb_options_expand",l)})),o}},gallery:{file_frame:null,cache:new h,parseIds(t){const e=t.replace(/[\r\n]/gm,"").replace(/ +/g," ").match(/ids.*?=.(.+?)["']/gi);return e?.[0]?.replace("ids","").replace("=","").replaceAll(" ","").replace(/["']/g,"").trim().split(",")||null},replaceShortcode:(t,e)=>t.replace(/[\r\n]/gm,"").replace(/ +/g," ").replace(/ids.*?=.(.+?)["']/gi,'ids="'+e+'"'),getCache(t){const e=[];for(let i=0;i<t.length;++i){let o=this.cache.get(""+t[i]);if(!o)return;e.push(o)}return e},setCache(t){for(let e=t.length-1;e>-1;--e)this.cache.set(""+t[e].id,t[e])},getSelectedImages(t){const e=[];for(let i=0;i<t.length;++i){let o=t[i].attributes,l=o.sizes,s={id:o.id,link:o.link,title:o.title,caption:o.caption};if(l)for(let t in l){let e=l[t];s[t]="thumbnail"===t?e.url:[e.url,e.width,e.height]}e.push(s)}return this.setCache(e),e},async getImages(t){let e,i=this.parseIds(t);if(!i){const i=t.replace(/[\r\n]/gm,"").replace(/ +/g," ").match(/path.*?=.(.+?)["']/gi),o=i?.[0]?.replace("path","").replace("=","").replaceAll(" ","").replace(/["']/g,"").trim().split(",");if(o){e=[];for(let t=0;t<o.length;++t)e.push({thumbnail:o[t]});return e}}if(i&&(e=this.getCache(i),!e))try{let o="pr_"+i.join(","),l=this.cache.get(o);if(l||(l=r.LocalFetch({action:"tb_get_ajax_data",dataset:"gallery_shortcode",val:t}),this.cache.set(o,l)),e=await l,!e.success)throw"";e=e.data,this.setCache(e)}catch(t){throw r.Spinner.showLoader("error"),t}return e},async init(e,i){let l;const _=wp.media.gallery.shortcode,c=!r.LightBox.el.contains(e),d=e=>{e?.stopPropagation(),null===this.file_frame?(this.file_frame=wp.media.frames.file_frame=wp.media({frame:"post",state:"gallery-library",library:{type:"image"},title:wp.media.view.l10n.editGalleryTitle,editing:!0,multiple:!0,selection:!1}),this.file_frame.el.classList.add("themify_gallery_settings")):this.file_frame.options.selection.reset(),wp.media.gallery.shortcode=t=>{const e=t.props.toJSON(),i={};e.order&&(i.order=e.order),e.orderby&&(i.orderby=e.orderby),t.gallery&&o.assign(i,t.gallery.toJSON()),i.ids=t.pluck("id"),e.uploadedTo&&(i.id=e.uploadedTo),i._orderbyrandom||i._orderbyRandom?(i.orderby="rand",delete i._orderbyrandom,delete i._orderbyRandom):i.ids&&"post__in"===i.orderby&&delete i.orderby;for(let t in wp.media.gallery.defaults)wp.media.gallery.defaults[t]===i[t]&&delete i[t];delete i._orderByField,delete i._orderbyfield;const l=new x.wp.shortcode({tag:"gallery",attrs:i,type:"single"});return wp.media.gallery.shortcode=_,l};const l=i.value.trim(),s=e=>{const o=wp.media.gallery.shortcode(e).string().slice(1,-1);i.value="["+o+"]",t.triggerEvent(i,"change",{images:this.getSelectedImages(e.models),models:e.models})};l.length>0?(this.file_frame=wp.media.gallery.edit(l),this.file_frame.state("gallery-edit")):(this.file_frame.state("gallery-library"),this.file_frame.open(),this.file_frame.$el.find(".media-menu .media-menu-item").last().trigger("click")),this.file_frame.off("update",s).on("update",s)},p=i.value.trim(),u=e=>{const i=e.target?.closest(".tf_close[data-id]");if(i){e.stopPropagation();const o=e.currentTarget.parentNode.tfTag("textarea")[0],s=o.value,r=this.parseIds(s),_=r?.indexOf(i.dataset.id)??-1;-1!==_&&(r.splice(_,1),i.parentNode.remove(),o.value=r.length>0?this.replaceShortcode(s,r.join(",")):"",a(l),l=n((()=>{t.triggerEvent(o,"change",{remove:1}),l=null}),400))}},h=e=>{if(0===e.button){const i=e.target&&!e.target.classList.contains("tf_close")?e.target.closest(".tb_gal_item"):null;if(i){e.stopImmediatePropagation();let o,l,n,a,r,_,c,d,p,b=this,u=i.ownerDocument,h=t=>{t.stopImmediatePropagation(),u.body.classList.add("tb_start_animate","tb_sort_start");const e=t.currentTarget,o=e.getBoundingClientRect(),s=e.parentNode;l=i.cloneNode(!0),l.classList.add("tb_gal_clone"),e.after(l),e.classList.add("tb_sort_handler"),n=s.getBoundingClientRect(),a=o.height/2-s.offsetTop,r=o.width/2-s.offsetLeft,f(t)},f=t=>{t.stopImmediatePropagation();let e=t.clientX,i=t.clientY;e<n.left?e=n.left:e>n.right&&(e=n.right),i<n.top?i=n.top:i>n.bottom&&(i=n.bottom);const o=u.elementFromPoint(e,i);if(t.currentTarget.style.transform="translate("+(e-r-n.left)+"px,"+(i-a-n.top)+"px)",o&&o!==t.currentTarget&&o.classList.contains("tb_gal_item")){const t=i>c||e>d?"bottom":"top";_===t&&p===o||("bottom"===t?o.after(l):o.before(l)),p=o,_=t}c=i,d=e},m=function(e){if(e.stopImmediatePropagation(),s(o),this.tfOff("pointermove",h,{passive:!0,once:!0}).tfOff("pointermove",f,{passive:!0}).tfOff("lostpointercapture pointerup",m,{passive:!0,once:!0}),u.body.classList.remove("tb_start_animate","tb_sort_start"),l){const e=this.closest(".tb_shortcode_preview"),i=e.tfClass("tf_close"),o=e.parentNode.tfTag("textarea")[0],s=[];this.remove(),l.classList.remove("tb_gal_clone");for(let t=0;t<i.length;++t)s.push(i[t].dataset.id);o.value=b.replaceShortcode(o.value,s.join(",")),t.triggerEvent(o,"change",{sort:1})}o=l=c=d=_=p=r=a=b=u=n=null};i.tfOn("lostpointercapture pointerup",m,{passive:!0,once:!0}).tfOn("pointermove",h,{passive:!0,once:!0}).tfOn("pointermove",f,{passive:!0}).setPointerCapture(e.pointerId)}}},f=t=>{let e=this.parseIds(t)||[],o=t=>{if(!t)return;let e=E(),o=i.parentNode.tfClass("tb_shortcode_preview")[0];for(let i=0;i<t.length;++i){let o=t[i];if(o){let t=isNaN(o)?new Image(40,40):null,i=A("","tb_gal_item tf_loader tf_w tf_h tf_box tf_rel"),l=A("button",{type:"button",class:"tf_close","data-id":o.id||""});try{null!==t&&(t.decoding="async",t.src=o.thumbnail||o.large?.[0]||o.full?.[0],t.decode().catch((()=>{})).finally((()=>{i.append(l,t),i.classList.remove("tf_loader","tf_w","tf_h")}))),e.appendChild(i)}catch(t){}}}o===y?(o=A(),o.tfOn(b,u,{passive:!0}).tfOn("pointerdown",h,{passive:!0}).className="tb_shortcode_preview tf_scrollbar",i.after(o)):o.replaceChildren(),o.appendChild(e)};this.getImages(t).then((t=>{o(t)})),this.getCache(e)||o(e)};c?d():(p.length>0&&f(p),e.tfOn(b,d,{passive:!0}),i.tfOn("change",(t=>{t?.detail?.sort||t?.detail?.remove||f(t.currentTarget.value)}),{passive:!0}))},render(t,e){const i=E(),o=A("button",{type:"button",class:"builder_button tb_text_button tb_btn_arrow"});return o.innerHTML=g.add_gallery,t.class="tb_shortcode_input "+(t.class||""),i.append(e.textarea.render(t,e),o),e.afterRun.push((()=>{this.init(o,o.previousElementSibling)})),i}},textarea:{render(e,i){const o=E(),l=A("textarea"),s=i.getStyleVal(e.id),n=e.control&&e.control.event?e.control.event:"keyup";return!0===i.is_repeat?(l.className=!0===i.is_sort?"tb_lb_sort_child":"tb_lb_option_child",l.dataset.inputId=e.id):(l.className="tb_lb_option",l.id=e.id),e.class!==y&&(l.className+=" "+e.class),s!==y&&(l.value=s),e.rows!==y&&(l.rows=e.rows),e.readonly&&(l.readonly=1),o.appendChild(i.O(l,e)),e.codeeditor!==y&&r.Helper.codeMirror(l,e.codeeditor).then((e=>{e?.editor.on("change",(()=>{t.triggerEvent(l,n)}))})),e.after!==y&&o.appendChild(i.after(e)),e.description!==y&&o.appendChild(i.description(e.description)),o}},address:{render:(t,e)=>e.textarea.render(t,e)},wp_editor:{render(t,e){let i,o=A("textarea",{class:"tb_lb_wp_editor fullwidth",rows:12,cols:40});!0===e.is_repeat?(i="tb_"+f.random().toString(36).substr(2,7),o.className+=!0===e.is_sort?" tb_lb_sort_child":" tb_lb_option_child",o.dataset.inputId=t.id,!1!==t.control&&(t.control??={},t.control.repeat=!0)):(o.className+=" tb_lb_option",i=t.id);const l=A("",{class:"wp-core-ui wp-editor-wrap tmce-active",id:"wp-"+i+"-wrap"}),s=A("",{class:"wp-editor-tools",id:"wp-"+i+"-editor-tools"}),n=A("",{class:"wp-media-buttons",id:"wp-"+i+"-media-buttons"}),a=A("button",{type:"button",class:"button insert-media add_media"}),r=A("","wp-editor-tabs"),_=A("",{class:"wp-editor-container",id:"wp-"+i+"-editor-container"});return o.id=i,t.class!==y&&(o.className+=" "+t.class),e.values[t.id]!==y&&(o.value=e.values[t.id]),_.append(o,A("",{class:"quicktags-toolbar",id:"qt_"+i+"_toolbar"})),r.append(A("button",{type:"button",class:"wp-switch-editor switch-tmce",id:i+"-tmce","data-wp-editor-id":i},g.visual),A("button",{type:"button",class:"wp-switch-editor switch-html",id:i+"-html","data-wp-editor-id":i},g.text)),a.append(A("span","wp-media-buttons-icon"),z(g.add_media)),n.appendChild(a),s.append(n,r),l.append(s,_),e.C.push({el:o,data:t}),l}},orderby_post:{render:(t,e)=>("meta_value_num"===e.getStyleVal(t.id)&&(e.values[t.id]="meta_value",e.values.meta_key_type="NUMERIC"),t.label??="orderby",t.options=e.getOptions("orderBy"),e.select.render(t,e))},captcha:{ct:{},render(t,e){const{recaptcha:i="recaptcha",hcaptcha:o="hcaptcha"}=t,l={type:"select",label:!1!==t.label&&"cptch",help:"cptchh",id:t.id||"captcha",options:{"":"",[i]:"recptch",[o]:"hcptch"}};t.hide_empty&&delete l.options[""];const s=e.create([l]),n=s.querySelector(".tb_lb_option"),a=async t=>{const e=t.currentTarget,l=e.value,s=l===i?"recaptcha":l===o?"hcaptcha":"",n=e.nextElementSibling,a=this.ct;""===s?n.innerHTML="":(a[s]??=await r.LocalFetch({action:"tb_validate_captcha",provider:s}),n.innerHTML=a[s].success?"":a[s].data)};return n.tfOn("change",a,{passive:!0}).after(A("","tb_field_error_msg")),e.afterRun.push((()=>{a({currentTarget:n})})),s}},select:{cache:new h,update(t,e,i){const o=i.getEl(t);null!==o&&(e!==y?o.value=e:o[0]!==y&&(o[0].selected=!0))},populate(t,e,i,o){if(t.optgroup){const l=i.getOptions(t);for(let t in l){let s=l[t];if(s.label!==y){let t=A("optgroup",{label:g[s.label]||s.label});t.appendChild(this.make_options(s,o,i)),e.appendChild(t)}else e.appendChild(this.make_options(s,o,i))}}else e.appendChild(this.make_options(t,o,i))},make_options(t,e,i){const o=E(),l=i.getOptions(t)||t;for(let i in l){let s=A("option",{value:i},g[l[i]]||l[i]);t.binding?.[i]?.responsive?.disabled.includes(t.id)&&(s.className="tb_responsive_disable"),(e===i||e===y&&i===t.default||Array.isArray(e)&&e.includes(i))&&(s.selected=!0),o.appendChild(s)}return o},render(t,e){const i=A("","tf_inline_b tf_vmiddle tf_rel"),o=A("select","tf_scrollbar"),l=E(),s=e.getStyleVal(t.id),n=t.dataset;if(t.multiple&&(o.setAttribute("multiple",!0),i.className+=" multi"),!0===e.is_repeat?(o.className+=!0===e.is_sort?" tb_lb_sort_child":" tb_lb_option_child",o.dataset.inputId=t.id):(o.className+=" tb_lb_option",o.id=t.id),t.class!==y&&(o.className+=" "+t.class),!1!==t.setOptions)if(n!==y){let l=n;if(t.dataset_args&&(l+=d.stringify(t.dataset_args)),this.cache.has(l))this.populate(this.cache.get(l),o,e,s);else{const a={action:"tb_get_ajax_data",dataset:n};t.dataset_args&&(a.args=t.dataset_args),i.className+=" tf_lazy",r.LocalFetch(a).then((t=>{if(!t.success)throw"";this.cache.set(l,t.data),this.populate(t.data,o,e,s)})).catch((()=>{r.Spinner.showLoader("error")})).finally((()=>{i.classList.remove("tf_lazy")}))}}else this.populate(t,o,e,s);return i.appendChild(e.O(o,t)),l.appendChild(i),t.after!==y&&l.appendChild(e.after(t)),t.description!==y&&l.appendChild(e.description(t.description)),t.tooltip!==y&&l.appendChild(e.hint(t.tooltip)),l}},font_select:{loaded_fonts:new u,fonts:{},safe:{},google:{},cf:{},updateFontVariant(t,e,i,o){if(!e)return;o="webfont"===(o=""===o||o===y?y!==this.google[t]?"google":"cf":o)?"fonts":o;const l=this[o][t]?.v||null;if(!l||0===l.length)return void e.closest(".tb_field").classList.add("_tb_hide_binding");let s=i.getStyleVal(e.id),n=E();y===s&&(s="google"===o?"regular":"normal"),e.dataset.selected=t,e.closest(".tb_field").classList.remove("_tb_hide_binding");for(let t=0;t<l.length;++t){let e=A("option",{value:l[t]},l[t]);l[t]===s&&(e.selected=!0),n.appendChild(e)}e.replaceChildren(n)},loadGoogleFonts(i){i=[...new u(i.split("|"))];const o={google:[],cf:[]},l=this.loaded_fonts,s=r.isFrontend;for(let t=i.length-1;t>-1;--t){let e=i[t];if(e&&"default"!==e&&this.safe[e]===y){let t=e.split(":"),i=this.cf[t[0]]!==y?"cf":"google",s="regular"===t[1]||"normal"===t[1]||"italic"===t[1]||~~t[1]?t[1]:"400,700",n=t[0].split(" ").join("+")+":"+s;this.safe[t[0]]===y&&("google"===i&&(n+=":latin,latin-ext"),l.has(n)||o[i].includes(n)||(l.add(n),o[i].push(n)))}}if(o.google.length>0){const i=e.location.protocol+"//fonts.googleapis.com/css?family="+encodeURI(o.google.join("|"))+"&display=swap";t.loadCss(i,null,!1),s&&S.loadCss(i,null,!1)}if(o.cf.length>0){const e=m.cf_api_url+encodeURI(o.cf.join("|"));t.loadCss(e,null,!1),s&&S.loadCss(e,null,!1)}},nt(i,o,l,s){const a=this,r=$(i).comboSelect({comboClass:"themify-combo-select",comboArrowClass:"themify-combo-arrow",comboDropDownClass:"themify-combo-dropdown tf_scrollbar",inputClass:"themify-combo-input",disabledClass:"themify-combo-disabled",hoverClass:"themify-combo-hover",selectedClass:"themify-combo-selected",markerClass:"themify-combo-marker"}).parent("div");r[0].tfOn(b,(function(e){const o=e.target;if(o.classList.contains("themify-combo-item")){const e=o.dataset.value,l=i.closest(".tb_tab"),r=this.querySelector('option[value="'+e+'"]')?.dataset.type;"webfont"!==r&&e&&a.loadGoogleFonts(e),l&&a.updateFontVariant(e,l.tfClass("font-weight-select")[0],s,r),n((()=>{t.triggerEvent(i,"change")}),10)}}),{passive:!0}).tfOn("pointerover",(function(i){const s=i.target;if(s.classList.contains("themify-combo-item")){let i=s.dataset.value;if(i){if(!$(s).is(":visible"))return;if("default"===i&&(i="inherit"),o.style.top=s.offsetTop-s.parentNode.scrollTop+30+"px",o.style.fontFamily=i,o.style.display="block","inherit"!==i&&!s.classList.contains("tb_font_loaded")){s.classList.add("tb_font_loaded");const o=s.ownerDocument===T?"top":"bottom";if(a.fonts[o]??=[],!a.fonts[o].includes(i)){const s=t=>{a.fonts[o].push(t),l.classList.remove("themify_show_wait")},n=this.querySelector('option[value="'+i+'"]')?.dataset.type;if(n&&"webfont"!==n){let a="";if("google"===n?a=e.location.protocol+"//fonts.googleapis.com/css?family="+encodeURI(i)+"&display=swap":"cf"===n&&(a=m.cf_api_url+encodeURI(i)),""!==a){l.classList.add("themify_show_wait");("top"===o?S:t).loadCss(a,null,!1).then(s)}}else s(i)}s.style.fontFamily=i}}}}),{passive:!0}),r.trigger("comboselect:open").on("comboselect:close",(()=>{o.style.display="none"})),r[0].tfClass("themify-combo-arrow")[0].tfOn(b,(()=>{o.style.display="none"}),{passive:!0})},update(t,e="",i){const o=i.getEl(t);if(null!==o)if(o.value=e,this.updateFontVariant(e,o.closest(".tb_tab").tfClass("font-weight-select")[0],i),o.dataset.init===y){const t=o.tfTag("optgroup"),i=A("option",{value:e,selected:""});for(let e=2;e>-1;--e)t[e]?.replaceChildren();this.safe[e]!==y?(i.textContent=this.safe[e],t[0].appendChild(i)):this.google[e]!==y?(i.textContent=this.google[e].n,t[1].appendChild(i)):this.cf[e]!==y?(i.textContent=this.cf[e].n,t[2].appendChild(i)):(i.textContent=e,t[0].appendChild(i))}else o.parentNode.tfClass("themify-combo-input")[0].value=e},render(t,e){const i=A("","tb_font_preview_wrapper"),l=A("select",{class:"tb_lb_option font-family-select tf_scrollbar",id:t.id}),s=A("span","tb_font_preview"),n=A("span","",g.font_preview),a=E(),r=e.getStyleVal(t.id),_=this,c={safe:g.safe_fonts,google:g.google_fonts},d=o.keys(this.cf).length<1;!1===d&&(c.cf=g.cf_fonts),a.appendChild(A("option",{value:""},"---")),t.class!==y&&(l.className+=" "+t.class);const p=["google","safe"];!1===d&&p.push("cf");for(let t=p.length-1;t>-1;--t){let e=A("optgroup",{label:c[p[t]]});if(r!==y){let i;i="safe"===p[t]&&this.safe[r]!==y?this.safe[r]:"google"===p[t]&&this.google[r]!==y?this.google[r].n:this.cf[r]?.n??r,e.appendChild(A("option",{value:r,selected:""},i))}a.appendChild(e)}const b=function(){this.tfOff("focusin tf_init",b,{once:!0,passive:!0});const t=_.safe,i=E(),o=this.querySelector("select"),l=o.tfTag("optgroup");if(o.dataset.init=!0,r!==y)for(let t=l.length-1;t>-1;--t)l[t].replaceChildren();for(let e in t){let o=A("option",{value:e,"data-type":"webfont"},t[e]);r===e&&(o.selected=!0),i.appendChild(o)}l[d?0:1].appendChild(i);const a=["google"];!1===d&&a.unshift("cf");for(let t=a.length-1;t>-1;--t){let e=_[a[t]],i=E();for(let o in e){let l=A("option",{value:o,"data-type":a[t]},e[o].n);r===o&&(l.selected=!0),i.appendChild(l)}l["cf"===a[t]?0:d?1:2].appendChild(i)}_.nt(o,s,n,e)};return l.appendChild(a),s.appendChild(n),i.tfOn("focusin tf_init",b,{once:!0,passive:!0}).append(e.O(l,t),s),e.afterRun.push((()=>{const o=e.create([{type:"select",options:{},label:"f_w",selector:t.selector,class:"font-weight-select",id:t.id+"_w",prop:"font-weight"}]),l=o.querySelector(".tb_field");i.closest(".tb_field").after(o),_.updateFontVariant(r,l.tfClass("font-weight-select")[0],e)})),t.label??="f_f",i}},animation_select:{render(t,e){const i=A("","tf_inline_b tf_vmiddle tf_rel"),o=A("select",{class:"tb_lb_option tf_scrollbar",id:t.id}),l=e.values[t.id],s={attseek:["bounce","flash","pulse","rubberBand","shake","swing","tada","wobble","jello"],bounceentr:["bounceIn","bounceInDown","bounceInLeft","bounceInRight","bounceInUp"],bouncex:["bounceOut","bounceOutDown","bounceOutLeft","bounceOutRight","bounceOutUp"],fadeentr:["fadeIn","fadeInDown","fadeInDownBig","fadeInLeft","fadeInLeftBig","fadeInRight","fadeInRightBig","fadeInUp","fadeInUpBig"],fadeex:["fadeOut","fadeOutDown","fadeOutDownBig","fadeOutLeft","fadeOutLeftBig","fadeOutRight","fadeOutRightBig","fadeOutUp","fadeOutUpBig"],flippers:["flip","flipInX","flipInY","flipOutX","flipOutY"],lghtsp:["lightSpeedIn","lightSpeedOut"],rotentr:["rotateIn","rotateInDownLeft","rotateInDownRight","rotateInUpLeft","rotateInUpRight"],rotex:["rotateOut","rotateOutDownLeft","rotateOutDownRight","rotateOutUpLeft","rotateOutUpRight"],specials:["hinge","rollIn","rollOut"],zoomentr:["zoomIn","zoomInDown","zoomInLeft","zoomInRight","zoomInUp"],zoomex:["zoomOut","zoomOutDown","zoomOutLeft","zoomOutRight","zoomOutUp"],slideentr:["slideInDown","slideInLeft","slideInRight","slideInUp"],slideex:["slideOutDown","slideOutLeft","slideOutRight","slideOutUp"]};o.appendChild(A("option"));for(let t in s){let e=A("optgroup",{label:g[t]||t});for(let i=0,o=s[t];i<o.length;++i){let t=A("option",{value:o[i]},g[o[i]]||o[i]);l===o[i]&&(t.selected=!0),e.appendChild(t)}o.appendChild(e)}return i.appendChild(o),i}},sticky:{render(t,e){const i={},o=r.activeModel.id,l=r.Registry,s=r.Helper.cloneObject(t),n=t.key;for(let t of l.items.keys()){let e=l.get(t);if(n===e?.type&&e.id!==o){let t,o=e.get("styling");t="row"===n&&o&&(o.custom_css_id||o.row_anchor)?o.custom_css_id?"#"+o.custom_css_id:"#"+o.row_anchor:"module"===n&&o&&o.custom_css_id?"#"+o.custom_css_id:"row"===n?"Row #"+e.id:e.get("mod_name")+" #"+e.id,i[e.id]=t}}return s.options=i,e.select.render(s,e)}},selectSearch:{update(t,e,i){const o=E();let l=null;if(e.removeAttribute("data-value"),e.value="",i!==y){for(let s in i){let n=A("",{class:"tb_search_item","data-value":s},i[s]);null===l&&(l=s),t===s&&(n.className+=" selected",e.dataset.value=s,e.value=i[s]),o.appendChild(n)}""===e.value&&null!==l&&(e.value=i[l],e.dataset.value=l)}return o},i(e,i){e.tfOn("keyup",(function(){const t=i.tfClass("tb_search_item"),e=this.value.trim(),o=RegExp(e,"i");for(let i=0,l=t.length;i<l;++i)t[i].style.display=""===e||o.test(t[i].textContent)?"block":"none"}),{passive:!0}),i.tfOn("pointerdown",(function(i){if(0===i.button&&i.target.classList.contains("tb_search_item")){i.stopPropagation();const o=this.tfClass("tb_search_item"),l=i.target;for(let t=o.length-1;t>-1;--t)o[t].classList.remove("selected");l.classList.add("selected");const s=l.dataset.value;e.value=l.textContent,e.dataset.value=s,e.blur(),e.previousElementSibling.blur(),t.triggerEvent(e,"selectElement",{val:s})}}),{passive:!0})},render(t,e){const i=A("","tb_search_wrapper"),o=A("",{class:"tb_search_arrow",tabindex:-1}),l=t.placeholder??t.label,s=A("input",{type:"text",class:"tb_search_input",autocomplete:"off",placeholder:(g[l]||l)+"..."}),n=A("",{class:"tb_search_container tf_scrollbar",tabindex:-1});return!0===e.is_repeat?(s.className+=!0===e.is_sort?" tb_lb_sort_child":" tb_lb_option_child",s.dataset.inputId=t.id):(s.className+=" tb_lb_option",s.id=t.id),t.class!==y&&(s.className+=" "+t.class),n.appendChild(this.update(e.values[t.id],s,t.options,e)),o.appendChild(A("span","tf_loader")),i.append(o,e.O(s,t),n),t.after!==y&&i.appendChild(e.after(t)),t.description!==y&&i.appendChild(e.description(t.description)),t.tooltip!==y&&i.appendChild(e.hint(t.tooltip)),this.i(s,n),i}},optin_provider:{cache:null,render(t,e){const i=A(),o=()=>{const t=()=>{i.replaceWith(e.create([this.cache[0],this.cache[1]]))};i.isConnected?t():e.afterRun.push(t)};return null===this.cache?(i.className="tf_loader",r.Spinner.showLoader(),r.LocalFetch({action:"tb_optin_get_settings"}).then((t=>{r.Spinner.showLoader("spinhide"),this.cache=t,o(),e.callbacks()})).catch((()=>{r.Spinner.showLoader("error")}))):o(),i}},check_map_api:{render(t,e){if(m[t.map+"_api"])return E();return e.separator.render({label:"",html:"<span>"+m[t.map+"_api_err"]+"</span>",wrap_class:"tb_group_element_"+t.map},e)}},query_posts:{ut:null,ht:new h,render(e,i){let l,s=A("",{id:e.id||e.term_id}),_=this,c=e.description,d=e.after,p=i.values,u=t=>{const e={};for(let i in t)e[i]=t[i].name;return e},h=(t,e,o)=>{t.nextElementSibling?.replaceChildren(i.selectSearch.update(e,t,o,i))},f=(t,i,o,s)=>(l?.abort(),t.classList.add("tb_search_wait"),l=new AbortController,r.LocalFetch({action:"tb_get_post_types",type:o,v:i,s:s||"",all:e.all||""},!1,{signal:l.signal}).finally((()=>{l=null,t.classList.remove("tb_search_wait")}))),m=r.Helper.cloneObject(e),w=null;return delete m.wrap_class,i.afterRun.push((()=>{let l=["id","tax_id","term_id","tag_id"],v=E(),k=null,x=async(o,l,s,b)=>{try{const u=s?l+"_"+s:l;let m=_.ht.get(u);if(m||(m=await f(o.parentNode,l,"terms",s),_.ht.set(u,m)),e.term_id===y&&e.tag_id===y)return;if(e.all){const t=o.closest("."+e.id),i="All"===t.querySelector("#"+e.id).value,l=t.querySelectorAll("."+e.tax_id+",."+e.term_id+",."+e.tag_id);for(let t=l.length-1;t>-1;--t)l[t].classList.toggle("tf_hide",i)}const v=e.tag_id||e.term_id.replace("#tmp_id#",l),x=o.closest(".tb_input");let C;if(o.id=v,null===k&&p[v]!==y&&(C=p[v].split("|")[0]),C||(C=0),h(o,C,m),(s||""===s)&&(o.value=s),null===k){const l=A("input",{type:"text",class:"query_category_multiple"}),s=A("","tb_query_multiple_wrap");if(s.append(A("span","",g.or),l),x.insertBefore(s,x.nextSibling),d!==y&&x.appendChild(i.after(d)),c!==y&&x.appendChild(i.description(c)),e.slug_id!==y){const t=x.parentNode,o=i.create([{type:"radio",id:"term_type",label:"query_by",default:p.term_type===y&&"post_slug"===p[e.tax_id]?"post_slug":"category",option_js:!0,options:[{value:"all",name:"all_posts"},{value:"category",name:"query_term_id"},{value:"post_slug",name:"slug_label"}]}]),l=i.create([{id:e.slug_id,type:"text",class:"large",wrap_class:"tb_group_element_post_slug",help:"slug_desc",label:"slug_label"}]);t.before(o),t.parentNode.appendChild(l)}if(e.sticky_id!==y){const t=i.create([{type:"toggle_switch",label:"sticky_first",id:e.sticky_id,options:"simple",wrap_class:"tb_group_element_all"}]);x.parentNode.parentNode.appendChild(t)}l.tfOn("change",(()=>{t.triggerEvent(o,"queryPosts",{val:C})}),{passive:!0}),a(w),w=n((()=>{i.callbacks()}),2)}b||(x.tfClass("query_category_multiple")[0].value=C,!0===k||i.is_new?t.triggerEvent(o,"queryPosts",{val:C}):ThemifyConstructor.settings=r.Forms.serialize("tb_options_setting")),k=!0}catch(t){}};for(let s=0,a=4;s<a;++s){if(!m[l[s]])continue;m.id=m[l[s]],m.label="query_"+l[s],m.type="selectSearch","term_id"===l[s]?(m.wrap_class="tb_search_term_wrap tb_group_element_category",m.class="query_category_single",m.help="query_desc",m.control={control_type:"queryPosts"}):"tax_id"!==l[s]&&"tag_id"!==l[s]||m.term_id!==y||(m.control={control_type:"queryPosts"}),delete m.description,delete m.after;let a=i.create([m]);!0===e.just_current&&delete m.wrap_class;let r="id"===l[s],c="term_id"===l[s]||"tag_id"===l[s],d=c?"":p[m.id],b=a.querySelector(".tb_search_input");if(b.tfOn("selectElement",(function(i){let o=i.detail.val,l=this.closest(".tb_field");c?(l.tfClass("query_category_multiple")[0].value=o,t.triggerEvent(this,"queryPosts",{val:o})):(l=l.nextElementSibling,null!==l?(r||!0!==k||e.slug_id===y||(l=l.nextElementSibling),null!==l&&(l=l.tfClass("tb_search_input")[0],r?_.ut[o]!==y&&(!0===e.just_current&&"tag"===p[e.tax_id]&&(p[e.tax_id]="post_tag"),h(l,p[e.tax_id],u(_.ut[o].options)),t.triggerEvent(l,"selectElement",{val:l.dataset.value})):(x(l,o),l.tfOn("input",(function(){n((()=>{x(l,o,this.value.trim(),!0)}),500)}),{passive:!0})))):r||t.triggerEvent(this,"queryPosts",{val:this.dataset.value}))}),{passive:!0}),r){const i=()=>{d||(d=e.default_post_type||"post"),h(b,d,u(_.ut)),t.triggerEvent(b,"selectElement",{val:d}),b=null};null===_.ut?f(b.parentNode,null,"post_types").then((t=>{_.ut=t,!0===e.just_current&&y==d&&(d=o.keys(t)),i()})):n(i,10)}else c&&!e.id&&e.taxonomy!==y&&(x(b,e.taxonomy),b.tfOn("input",(function(){n((()=>{x(b,e.taxonomy,this.value.trim(),!0)}),500)}),{passive:!0}));v.appendChild(a)}if(m.query_filter){let t=i.values,e=i.create([{type:"multi",label:"dateq",id:"query_date",options:[{id:"query_date_from",label:"from",type:"date",timepicker:!1},{id:"query_date_to",label:"to",type:"date",timepicker:!1}],wrap_class:"tb_query_filter"+(t.query_date_from||t.query_date_to?"":" tf_hide")},{type:"autocomplete",dataset:"authors",id:"query_authors",label:"auhrq",wrap_class:"tb_query_filter"+(t.query_authors?"":" tf_hide"),help:"auhrqh"},{type:"multi",label:"custq",id:"query_cf",options:[{type:"autocomplete",dataset:"custom_fields",id:"query_cf_key",label:"key"},{id:"query_cf_value",label:"val",type:"text"},{id:"query_cf_c",label:"compre",type:"select",options:{"":"LIKE","NOT LIKE":"NOT LIKE",EXISTS:"EXISTS","NOT EXISTS":"NOT EXISTS","=":"=","!=":"!=",">":">",">=":">=","<":"<","<=":"<="}}],wrap_class:"tb_query_filter"+(t.query_cf_key?"":" tf_hide")}]);if(v.appendChild(e),!(t.query_cf_key&&t.query_authors&&(t.query_date_from||t.query_date_to))){let e=A("","tb_field"),i=A("","tb_input tf_rel"),o=A("",{class:"tb_ui_dropdown_label tb_sort_fields_plus tf_plus_icon",tabindex:-1}),l=A("ul","tf_scrollbar");t.query_date_from||t.query_date_to||l.appendChild(A("li",{"data-id":"query_date"},g.dateq)),t.query_authors||l.appendChild(A("li",{"data-id":"query_authors"},g.auhrq)),t.query_cf_key||l.appendChild(A("li",{"data-id":"query_cf"},g.custq)),o.appendChild(A("span","",g.addqf)),e.append(A("","tb_label tb_empty_label"),i),i.append(o,l),v.appendChild(e),l.tfOn(b,(function(t){if("LI"===t.target.tagName){t.preventDefault(),t.stopPropagation();let i=t.target.dataset.id;this.closest('.tb_field[data-type="query_posts"], .tb_field[data-type="advanced_posts_query"]').querySelector("."+i).classList.remove("tf_hide"),t.target.style.display="none",t.target.removeAttribute("data-id"),this.querySelector("[data-id]")||e.classList.add("tf_hide")}}))}}s.parentNode.replaceChild(v,s),m=s=null})),s}},hook_content:{render:(t,e)=>e.create([{type:"group",label:"hcont",display:"accordion",options:[{id:"hook_content",type:"builder",options:[{type:"select",id:"h",options:t.options,after:"hloc"},{type:"textarea",id:"c",wrap_class:"tb_disable_dc",class:"fullwidth"}]}]}])},position_box:{w:null,h:null,update(t,e,i){const o=i.getEl(t)||r.LightBox.el.querySelector('[data-input-id="'+t+'"]');if(null!==o){const t=o.closest(".tb_position_box_wrapper"),i=t.tfClass("tb_position_box_handle")[0],l=t.tfClass("tb_position_box_label")[0],s=this.ft();e?s[e]!==y&&(e=s[e]):e="50,50",o.value=e,l.textContent=this.gt(e),e=e.split(","),i.style.left=f.ceil(e[0]*this.w/100)+"px",i.style.top=f.ceil(e[1]*this.h/100)+"px"}},gt(t){let e,{top:i,left:o,center:l,right:s,bottom:n}=g;switch(t){case"0,0":e=i+" "+o;break;case"50,0":e=i+" "+l;break;case"100,0":e=i+" "+s;break;case"0,50":e=l+" "+o;break;case"50,50":e=l+" "+l;break;case"100,50":e=l+" "+s;break;case"0,100":e=n+" "+o;break;case"50,100":e=n+" "+l;break;case"100,100":e=n+" "+s;break;default:const a=t.split(",");e=""===a[0]?"Center Center":"X:"+a[0]+"% Y:"+a[1]+"%";break}return e},ft:()=>({"right-top":"100,0","right-center":"100,50","right-bottom":"100,100","left-top":"0,0","left-center":"0,50","left-bottom":"0,100","center-top":"50,0","center-center":"50,50","center-bottom":"50,100"}),yt(t){t.stopPropagation();let e,i,o=t.currentTarget.previousElementSibling,l=t.target.closest(".tb_position_item");if(l){const t=l.dataset.pos.split(",");e=t[0],i=t[1],"50"===e?e=this.w/2:"100"===e&&(e=this.w),"50"===i?i=this.h/2:"100"===i&&(i=this.h)}else e=t.offsetX,i=t.offsetY;o.style.left=e+"px",o.style.top=i+"px",this.wt(o,e,i)},wt(e,i,o){const l=+(i/this.w*100).toFixed(2),s=+(o/this.h*100).toFixed(2),n=e.closest(".tb_position_box_wrapper").tfClass("tb_position_box_label")[0],a=n.nextElementSibling;a.value=l+","+s,n.textContent=this.gt(l+","+s),t.triggerEvent(a,"change")},render(t,e){const i=this,o=this.ft(),a=e.getStyleVal(t.id),r=A("","tb_position_box_wrapper"),c=A("","tb_position_box_container tf_rel tf_inline_b"),d=A("","tb_position_box tf_rel"),u=A("","tb_position_box_handle"),h=e.hidden.render(t,e);for(let t in o){let e=A("",{class:"tb_position_item","data-pos":o[t]}),i=A("span","themify_tooltip"),l=o[t].split(",");e.style.left=l[0]+"%",e.style.top=l[1]+"%",i.appendChild(A("span","",this.gt(o[t]))),e.appendChild(i),d.appendChild(e)}return u.tfOn("pointerdown",(function(t){if(0===t.button){let e;t.stopImmediatePropagation();const o=this,n=this.offsetLeft-t.clientX,a=this.offsetTop-t.clientY,{w:r,h:_}=i,c=()=>{C.add("tb_start_animate")},d=t=>{t.stopImmediatePropagation(),s(e),e=l((()=>{let e=n+t.clientX,l=a+t.clientY;e>r?e=r:e<0&&(e=0),l>_?l=_:l<0&&(l=0),o.style.left=e+"px",o.style.top=l+"px",i.wt(o,e,l)}))},p=function(t){t.stopImmediatePropagation(),s(e),this.tfOff("pointermove",c,{passive:!0,once:!0}).tfOff("pointermove",d,{passive:!0}).tfOff("lostpointercapture pointerup",p,{passive:!0,once:!0}),C.remove("tb_start_animate"),e=null};this.tfOn("lostpointercapture pointerup",p,{passive:!0,once:!0}).tfOn("pointermove",c,{passive:!0,once:!0}).tfOn("pointermove",d,{passive:!0}).setPointerCapture(t.pointerId)}}),{passive:!0}),d.tfOn(b,(t=>{this.yt(t)}),{passive:!0}),c.append(u,d),r.appendChild(c),t.after!==y&&r.appendChild(e.after(t)),r.append(A("","tb_position_box_label"),h),e.afterRun.push((()=>{n((()=>{const o=p(d);i.w=_(o.getPropertyValue("width")),i.h=_(o.getPropertyValue("height")),i.update(t.id,a,e)}),700)})),t.label??="b_p","background-position"===t.prop&&(t.wrap_class??="tb_group_element_image tb_image_options"),r}},slider_range:{update(t,e,i){i.range.update(t,e,i),this.updateSlider(t,i)},updateSlider(t,e){const i=e.getEl(t),o=i.closest(".tb_slider_container"),l=o.tfClass("tb_slider_wrapper")[0],s=l.tfTag("output")[0].dataset,n=o.tfTag("select")[0],a=n[n.selectedIndex].dataset,r=l.querySelector('input[type="range"]'),_=c(a.min),d=c(a.max),p=l.style,b=i.value;s.unit=n.value,s.slider_before=b,r.min=_,r.step=a.increment,r.max=d,r.value=b,p.setProperty("--tb_slider_min",_),p.setProperty("--tb_slider_before",b),p.setProperty("--tb_slider_max",d)},render(e,i){const n=A("","tb_slider_container tf_w"),a=A("",{class:"tb_slider_wrapper tf_rel tf_w",tabindex:"-1"}),_=A("input"),d=A("input"),p=A("output","tb_slider_output tb_slider_output_high"),b=A("output","tb_slider_output"),u=E();let h,f,m,g,w=0,v=100,k="%",x=!0,C=1,S="--tb_slider_before:",T=1,z="styling"===i.clicked?"keyup":"change";if(e.options!==y&&(e.options.min!==y&&(w=e.options.min),e.options.max!==y&&(v=e.options.max),e.options.unit!==y&&(k=e.options.unit),e.options.range!==y&&(x=!1),e.options.default!==y&&(C=e.options.default),e.options.step!==y&&(T=e.options.step),g=!!e.options.inputRange),a.append(_,p),u.appendChild(a),g){x=!1;const l=r.Helper.cloneObject(e);o.assign(l,l.options),l.class=l.options="",l.increment=l.step;const s=i.range.render(l,i).querySelector(".tb_range_input"),n=s.querySelector("select");if(g=s.querySelector(".tb_range"),h=g.tfOn(z,(e=>{_.value=e.currentTarget.value,t.triggerEvent(_,"input")}),{passive:!0}).value,n){const t=l.id,e=n[n.selectedIndex].dataset;k=n.tfOn("change",(()=>{this.updateSlider(t,i)}),{passive:!0}).value,w=e.min,v=e.max,T=e.increment}u.appendChild(s)}else f=i.hidden.render(e,i),h=f.value,a.appendChild(f);if(w=c(w),v=c(v),_.type=d.type="range",_.min=d.min=w,_.step=d.step=T,_.max=d.max=v,k&&(p.dataset.unit=b.dataset.unit=k),a.tfOn("input",(e=>{const i=e.target===_?"before":"after",o=d.isConnected?c(d.value):"",n=e.currentTarget,a="before"===i?p:b,r=c(_.value),u="before"===i?r:o;s(m),m=l((()=>{let l=r;""!==o&&(l=r>o?o+","+r:r+","+o),a.dataset["slider_"+i]=u,n.style.setProperty("--tb_slider_"+i,u),g?(g.value=l,e.isTrusted&&t.triggerEvent(g,z)):f&&(f.value=l,t.triggerEvent(f,z))}))}),{passive:!0}),x){const t=h?h.split(","):[w,v];t[0]=c(t[0]),t[0]=t[0]>v?v:t[0]<w?w:t[0],t[1]===y?t[1]=t[0]:(t[1]=c(t[1]),t[1]=t[1]>v?v:t[1]<w?w:t[1]),b.dataset.slider_after=d.value=t[0],p.dataset.slider_before=_.value=t[1],b.className+=" tb_slider_output_low",S+=t[1]+";--tb_slider_after:"+t[0],a.append(d,b)}else{let t=h||C;(""+t).includes(",")&&(t=t.split(",")[0]),t=c(t),t=t>v?v:t<w?w:t,p.dataset.slider_before=_.value=t,S+=t,a.className+=" tb_slider_wrapper_single"}return e.wrap_class!==y&&(a.className+=" "+e.wrap_class),w>0&&(S+=";--tb_slider_min:"+w),100!==v&&(S+=";--tb_slider_max:"+v),a.style=S,n.appendChild(u),n}},range:{update(t,e="",i){const o=i.getEl(t);if(null!==o){o.value=e;const l=t+"_unit",s=i.getEl(l);if(null!==s&&"SELECT"===s.tagName)s.value=i.getStyleVal(l)??s[0].value,this.vt(o,-1!==s.selectedIndex?s[s.selectedIndex]:s[0]);else{const t=o.parentNode.tfClass("tb_angle_dot")[0];t&&(t.style.transform=""===e?"":"rotate("+e+"deg)")}}},kt(t,e,i,o){let l=c(t.value.trim());i=c(i),!isNaN(l)&&(l>i||l<c(e))&&(t.value=l>i?i:e)},vt(t,e){const{min:i,max:o,increment:l}=e.dataset;t.min=i,t.max=o,t.step=l,this.kt(t,i,o,l)},nt(e,i,o){const n="SELECT"===i?.tagName,a=this;e.tfOn("pointerdown",(function(e){if(0===e.button){this.classList.contains("tb_angle_input")&&!this.parentNode.tfClass("tb_angle_circle")[0]||e.stopImmediatePropagation();let i,n=e.clientY,a=null;const r=this.value,_=c(this.max),d=c(this.min),p=this.step||1,b=p%1!=0,u=b?c(p):~~p,h=t=>{let e,i=this.value||0,o=b?c(i):~~i;e="increase"===t?o>=_?_:o+u:o<=d?d:o-u,this.value=+e.toFixed(2),null===a&&(a=this.parentNode.tfClass("tb_angle_dot")[0]),a&&(a.style.transform="rotate("+e+"deg)")},f=t=>{t.stopPropagation(),C.add("tb_start_animate","tb_move_drag")},m=e=>{e.stopImmediatePropagation(),s(i);const a=e.clientY,r=this;i=l((()=>{a<n?h("increase"):a>n&&h("decrease"),n=a,t.triggerEvent(r,o)}))},g=function(e){e.stopImmediatePropagation(),this.tfOff("pointermove",m,{passive:!0}).tfOff("pointermove",f,{once:!0,passive:!0}).tfOff("lostpointercapture pointerup",g,{once:!0,passive:!0}),s(i),i=n=a=null,this.value!==r&&(t.triggerEvent(this,o),"change"!==o&&t.triggerEvent(this,"change")),C.remove("tb_start_animate","tb_move_drag")};this.tfOn("lostpointercapture pointerup",g,{once:!0,passive:!0}).tfOn("pointermove",f,{once:!0,passive:!0}).tfOn("pointermove",m,{passive:!0}).setPointerCapture(e.pointerId)}}),{passive:!0}),!0===n&&i.tfOn("change",(function(){a.vt(e,this.options[this.selectedIndex]),t.triggerEvent(e,o)}),{passive:!0}),i!==y&&this.vt(e,n?-1!==i.selectedIndex?i[i.selectedIndex]:i[0]:i),e.tfOn("change",(()=>{this.kt(e,e.min,e.max,e.step)}),{passive:!0})},render(t,e){const i=A("","tb_tooltip_container tf_rel"),l=A("","tb_range_input tf_inline_b tf_rel"),s=A("input",{type:"number",autocomplete:"off",class:"tb_range"}),n=t.units;let a,_=t.value??e.getStyleVal(t.id)??t.default??"";if(""!==_&&(_=c(_),s.value=_),t.wrap_class!==y&&(i.className=" "+t.wrap_class),t.placeholder!==y&&(s.placeholder=t.placeholder),!0===e.is_repeat?(s.className+=!0===e.is_sort?" tb_lb_sort_child":" tb_lb_option_child",s.dataset.inputId=t.id):(s.className+=" tb_lb_option",s.id=t.id),t.class!==y&&(s.className+=" "+t.class),l.appendChild(s),t.tooltip!==y&&l.appendChild(e.hint(t.tooltip)),i.appendChild(l),!0===t.deg||n===y)s.min=t.min||0,s.max=!0===t.deg?360:t.max||1500,s.step=t.increment||1;else{const i=A("","noborder"),r=o.keys(n);if(r.length>1){const i=t.id+"_unit",o=t.unit||e.getStyleVal(i)||t.default_unit;a=A("select","tb_unit"),!0===e.is_repeat?(a.className+=!0===e.is_sort?" tb_lb_sort_child":" tb_lb_option_child",a.dataset.inputId=i):(a.className+=" tb_lb_option",a.id=i),t.select_class!==y&&(a.className+=" "+t.select_class);for(let t in n){let e=A("option",{value:t},t),i=e.dataset;n[t]||(n[t]={}),n[t].min??=0,n[t].max??=100,s.min=~~n[t].min,s.max=~~n[t].max,i.min=n[t].min,i.max=n[t].max,i.increment=n[t].increment||("em"===t||"rem"===t?.1:1),o===t&&(e.selected=!0),a.appendChild(e)}e.O(a,{type:"select",id:i,control:t.control})}else{const e=r[0];n[e]||(n[e]={}),n[e].min??=0,n[e].max??=100,a=A("span",{class:"tb_unit",id:t.id+"_unit"},e);const i=c(n[e].min),o=c(n[e].max),l=a.dataset;s.min=i,s.max=o,s.step=n[e].increment!==y?c(n[e].increment):1,(_<i||_>o)&&(s.value=_>o?o:i),l.min=i,l.max=o,l.increment=n[e].increment||("em"===e||"rem"===e?.1:1)}i.appendChild(a),l.appendChild(i)}t.after!==y&&i.appendChild(e.after(t)),t.description!==y&&i.appendChild(e.description(t.description)),!0===t.opposite&&a.tfOn("change",(function(t){t.stopPropagation(),e.margin.xt(this,e)}),{passive:!0});const d=t.event||("styling"===e.clicked?"keyup":"change"),p=r.Helper.cloneObject(t);return this.nt(s,a,d),!0===t.opposite&&s.tfOn(d,(function(t){t.stopPropagation(),e.margin.Ct(this)}),{passive:!0}),p.type="range",e.O(s,p),i}},icon:{render(e,i){const o=E(),l=A("","tb_icon_wrap"),s=A("input",{class:"themify_field_icon",type:"text"}),a=A("span","tf_plus_icon themify_fa_toggle"),_=A("span","tb_clear_input tf_close"),c=i.getStyleVal(e.id)||e.default;return!0===i.is_repeat?(s.className+=!0===i.is_sort?" tb_lb_sort_child":" tb_lb_option_child",s.dataset.inputId=e.id):(s.className+=" tb_lb_option",s.id=e.id),e.class!==y&&(s.className+=" "+e.class),c!==y&&""!==c?(s.value=c,a.appendChild(r.Helper.getIcon(c)),i.afterRun.push((()=>{n((()=>{S.fonts(c)}),100)}))):a.className+=" default_icon",_.tfOn(b,(e=>{e.stopPropagation(),s.value="",t.triggerEvent(s,"change")}),{passive:!0}),l.append(i.O(s,e),a,_),o.appendChild(l),e.after!==y&&o.appendChild(i.after(e)),e.description!==y&&o.appendChild(i.description(e.description)),o}},getMarginPaddingUnits(t,e){const i={px:{min:"margin"===t?-1500:0,max:1500},em:{min:"margin"===t?-10:0,max:40},"%":{min:"margin"===t?-100:0}};return e?i[e]:i},createMarginPadding(t,e){const i=e.options||[{id:"top"},{id:"bottom"},{id:"left"},{id:"right"}],l=A("ul","tb_seperate_items tb_has_opposite"),s=this,n=e.id,a="border_radius"===t,_=r.Helper.cloneObject(e);_.units=e.units??this.getMarginPaddingUnits(t),_.prop=null,_.opposite=!0,!0===a&&(l.dataset.toptext=i[0].label);let c=i.length,d=E(),p=!1;for(let t=0;t<c;++t){let o=A("li"),l=i[t].id,r=n+"_"+l;_.id=r,_.tooltip=i[t].label||l,_.class=e.class||"",_.class+=" tb_multi_field tb_range_"+l,!0===a&&(_.class+=" tb_is_border_radius");let c,b=this.range.render(_,this);if(0!==t&&3!==t){let t="right"===l?"top":l,e=A("li","tb_seperate_opposite tb_opposite_"+("bottom"===t?"top":t));e.appendChild(this.checkboxGenerate("checkbox",{id:n+"_opp_"+t,class:"style_apply_oppositive",options:[{name:"1",value:""}]}));let i=e.querySelector(".style_apply_oppositive");i.tfOn("change",(function(t){t.stopPropagation(),s.margin.St(this,!0)}),{passive:!0}).parentNode.insertBefore(A("","tb_oppositive_state"),i.nextSibling),!0===i.checked&&s.afterRun.push((()=>{s.margin.St(i)})),d.appendChild(e)}o.appendChild(b),d.appendChild(o),!0===a?(c="border-","top"===i[t].id?c+="top-left-radius":"right"===i[t].id?c+="top-right-radius":"left"===i[t].id?c+="bottom-left-radius":"bottom"===i[t].id&&(c+="bottom-right-radius")):"transform"===e.type?c=e.prop:(c=e.prop+"-"+i[t].id,!0===this.is_new&&!p&&this.values[r]&&(p=!0)),this.styles[r]={prop:c,selector:e.selector}}if(l.appendChild(d),d=E(),d.appendChild(l),4===c){d.appendChild(s.checkboxGenerate("icon_checkbox",{id:"checkbox_"+n+"_apply_all",class:"style_apply_all",options:[{name:"1",value:"all",icon:'<span class="apply_all_checkbox_icon">'+r.Helper.getIcon("ti-link").outerHTML+"</span>"}],default:("module"===this.component&&!0===this.is_new&&!p||0===o.keys(this.values).length)&&"1"}));const t=d.querySelector(".style_apply_all");t.tfOn("change",(function(){s.margin.Tt(this,!0)}),{passive:!0}),!0===t.checked&&s.afterRun.push((()=>{s.margin.Tt(t)}))}return d},margin_opposity:{update(t,e,i){i.range.update(t,e,i),i.checkbox.update(t+"_opp_top",i.getStyleVal(t+"_opp_top"),i),i.range.update(i.I[t].bottomId,i.getStyleVal(i.I[t].bottomId),i)},render(t,e){const i=["topId","bottomId"],o=A("ul","tb_seperate_items tf_inline_b tb_has_opposite"),l=r.Helper.cloneObject(t),s={px:{min:-1e3,max:1e3},em:{min:-50,max:50},"%":{min:-100}};for(let n=0;n<2;++n){let a=A("li");if(l.id=t[i[n]],l.prop="topId"===i[n]?"margin-top":"margin-bottom",l.class="tb_multi_field tb_range_"+("topId"===i[n]?"top":"bottom"),l.opposite=!0,l.units=s,l.tooltip="topId"===i[n]?g.top:g.bottom,a.appendChild(e.range.render(l,e)),o.appendChild(a),0===n){let t=A("li","tb_seperate_opposite tb_opposite_top");t.appendChild(e.checkboxGenerate("checkbox",{id:l.id+"_opp_top",class:"style_apply_oppositive",options:[{name:"1",value:""}]}));let i=t.querySelector(".style_apply_oppositive");i.tfOn("change",(function(t){t.stopPropagation(),e.margin.St(this,!0)}),{passive:!0}).parentNode.insertBefore(A("","tb_oppositive_state"),i.nextSibling),o.appendChild(t)}e.I[t[i[n]]]=e.styles[t[i[n]]]={id:t[i[n]],type:t.type,prop:"topId"===i[n]?"margin-top":"margin-bottom",selector:t.selector}}return t.label??="m",o}},margin:{St(e,i){const o=e.closest(".tb_seperate_opposite"),l=o.parentNode,s=!0===o.classList.contains("tb_opposite_left")?o.nextElementSibling:o.previousElementSibling,n=!0===e.checked,a=this.zt(s.tfClass("tb_range")[0]),r=l.tfClass("tb_range_"+a)[0],_=r.closest("li").tfClass("tb_unit")[0];if(!0===n){if(r.dataset.v=r.value,_.dataset.u=_.value,!0===i){const t=s.tfClass("tb_range")[0],e=t.value,i=r.value;""!==e||""===i?(r.value=e,_.value=s.tfClass("tb_unit")[0].value):(t.value=i,s.tfClass("tb_unit")[0].value=_.value)}}else{r.value=r.dataset.v??"",_.value=_.dataset.u}!0===i&&t.triggerEvent(r,"keyup")},xt(t,e){const i=t.closest(".tb_has_opposite");if(!i.hasAttribute("data-checked")){const o=e.getEl(t.id.replace(/_unit$/gi,"")),l=this.zt(o),s=o.classList.contains("tb_is_border_radius");!0===i.tfClass("tb_opposite_"+("top"===l||!0===s&&"right"===l||!1===s&&"bottom"===l?"top":"left"))[0].tfClass("style_apply_oppositive")[0].checked&&(i.tfClass("tb_range_"+l)[0].closest("li").tfClass("tb_unit")[0].value=t.value)}},zt(t){const e=t.classList;let i=e.contains("tb_range_top")?"bottom":e.contains("tb_range_bottom")?"top":e.contains("tb_range_left")?"right":"left";return e.contains("tb_is_border_radius")&&(i="bottom"===i?"right":"top"===i?"left":"left"===i?"top":"bottom"),i},Ct(t){const e=t.closest("li").parentNode;if(!e.hasAttribute("data-checked")){const i=this.zt(t),o=t.classList.contains("tb_is_border_radius");!0===("top"===i||!0===o&&"right"===i||!1===o&&"bottom"===i?e.tfClass("tb_opposite_top")[0]:e.tfClass("tb_opposite_left")[0]).tfClass("style_apply_oppositive")[0].checked&&(e.tfClass("tb_range_"+i)[0].value=t.value)}},Tt(e,i){const o=e.closest(".tb_input").tfClass("tb_seperate_items")[0],l=o.tfTag("li")[0];let s;!0===(!0===e.checked)?(o.dataset.checked=1,s=g.all):(o.removeAttribute("data-checked"),s=o.dataset.toptext||g.top),!0===i&&t.triggerEvent(l.tfClass("tb_multi_field")[0],"keyup"),l.tfClass("tb_tooltip_up")[0].textContent=s},update(t,e,i){const o=["top","right","bottom","left"],l="checkbox_"+t+"_apply_all",s=i.getEl(l),n=s?s.tfClass("style_apply_all")[0]:null;for(let e=3;e>-1;--e){let l=t+"_"+o[e];if(null!==i.getEl(l)&&(i.range.update(l,i.getStyleVal(l),i),!n||!0!==n.checked)){let l=t+"_opp_"+o[e],s=i.getEl(l);null!==s&&(s.tfClass("style_apply_oppositive")[0].checked=!!i.getStyleVal(l))}}i.checkbox.update(l,i.getStyleVal(l),i),n&&this.Tt(n)},render:(t,e)=>(t.label??="m",e.createMarginPadding(t.type,t))},padding:{render:(t,e)=>(t.label??="p",e.createMarginPadding(t.type,t))},box_shadow:{update(t,e,i){const o=["hOffset","vOffset","blur","spread"],l=t+"_color",s=t+"_inset";for(let e=3;e>-1;--e){let l=t+"_"+o[e];null!==i.getEl(l)&&i.range.update(l,i.getStyleVal(l),i)}i.color.update(l,i.getStyleVal(l),i),i.checkbox.update(s,i.getStyleVal(s),i)},render(t,e){const{selector:i,prop:o,id:l}=t,s={hOffset:{label:"h_o",units:{px:{min:-200,max:200},em:{max:40}}},vOffset:{label:"v_o",units:{px:{min:-200,max:200},em:{max:40}}},blur:{label:"bl",units:{px:{max:300},em:{max:40}}},spread:{label:"spr",units:{px:{min:-200,max:200},em:{min:-10,max:40}}}},n=A("ul","tb_seperate_items tb_shadow_inputs"),a=r.Helper.cloneObject(t),_=E();a.class="tb_shadow_field",a.prop=null;for(let t in s)if(s[t]!==y){let r=s[t],_=A("li"),c=l+"_"+t;a.id=c,a.tooltip=r.label,a.units=r.units,a.selector=i,_.appendChild(e.range.render(a,e)),n.appendChild(_),e.styles[c]={prop:o,selector:i}}let c=l+"_color";const d=A("li","tb_shadow_color"),p={id:c,type:"color",class:a.class,selector:i};e.styles[c]={prop:o,selector:i,type:"color"},d.appendChild(e.color.render(p,e)),n.appendChild(d),c=l+"_inset";const b={id:c,origID:l,type:"checkbox",class:a.class,isBoxShadow:!0,prop:o,options:[{value:"in_sh",name:"inset"}]};return e.styles[c]={prop:o,selector:i},_.append(n,e.checkboxGenerate("checkbox",b)),t.label??="b_s",_}},text_shadow:{update(t,e,i){const o=["hShadow","vShadow","blur"],l=t+"_color";for(let e=2;e>-1;--e){let l=t+"_"+o[e];null!==i.getEl(l)&&i.range.update(l,i.getStyleVal(l),i)}i.color.update(l,i.getStyleVal(l),i)},render(t,e){const{selector:i,prop:o,id:l}=t,s={hShadow:{label:"h_sh",units:{px:{min:-200,max:200},em:{max:40}}},vShadow:{label:"v_sh",units:{px:{min:-200,max:200},em:{max:40}}},blur:{label:"bl",units:{px:{max:300},em:{max:40}}}},n=A("ul","tb_seperate_items tb_shadow_inputs"),a=A("li","tb_shadow_color"),_=l+"_color",c={id:_,type:"color",class:"tb_shadow_field",selector:i},d=r.Helper.cloneObject(t);d.class="tb_shadow_field",d.prop=null;for(let t in s)if(s.hasOwnProperty(t)){let a=s[t],r=A("li"),_=l+"_"+t;d.id=_,d.tooltip=a.label,d.units=a.units,r.appendChild(e.range.render(d,e)),n.appendChild(r),e.styles[_]={prop:o,selector:i}}return e.styles[_]={prop:o,selector:i,type:"color"},a.appendChild(e.color.render(c,e)),n.appendChild(a),t.label??="t_sh",n}},border_radius:{render:(t,e)=>(t.options??=e.getOptions("border_radius"),t.wrap_class??="border-radius-options",t.label??="r_c",e.createMarginPadding(t.type,t))},outline:{render:(t,e)=>(e.styles[t.id+"-c"]=e.styles[t.id+"-w"]=e.styles[t.id+"-s"]=t.selector,t.label??="o",e.create([{type:"multi",options:[{type:"color",id:t.id+"-c",class:"outline_color"},{type:"range",id:t.id+"-w",units:{px:{max:300}},class:"outline_width"},{type:"select",id:t.id+"-s",options:e.getOptions("border"),class:"outline_style"}]}]))},border:{It(t){const{parentNode:e,value:i}=t,o=e.parentNode.children;for(let t=o.length-1;t>-1;--t)o[t]!==e&&o[t].classList.toggle("_tb_hide_binding","none"===i)},Tt(e,i){const o=i.tfTag("input"),l=(i,l)=>{for(let t=o.length-1;t>-1;--t)o[t].parentNode.classList.toggle("_tb_disable",i&&"all"!==o[t].value);!0===i?e.dataset.checked=1:e.removeAttribute("data-checked"),!0===l&&t.triggerEvent(e.children[0].tfTag("select")[0],"change")};for(let t=o.length-1;t>-1;--t)o[t].tfOn("change",(function(){l("all"===this.value,!0)}),{passive:!0}),!0===o[t].checked&&"all"===o[t].value&&l(!0,null)},update(t,e,i){const o=["top","right","bottom","left"],l=t+"-type";for(let e=0;e<4;++e){let l=t+"_"+o[e],s=l+"_color",n=l+"_style",a=l+"_width";i.color.update(s,i.getStyleVal(s),i),i.select.update(n,i.getStyleVal(n),i),this.It(i.getEl(n)),i.range.update(a,i.getStyleVal(a),i)}i.radio.update(l,i.getStyleVal(l),i)},render(t,e){const i=["top","right","bottom","left"],o=A("ul","tb_seperate_items tb_borders tb_group_element_border"),l=t.id,s=this,n=t.selector,a=r.Helper.cloneObject(t),_=r.Helper.cloneObject(t),c=E();_.options=[{value:"all",name:"all",class:"style_apply_all ",icon:'<i class="tic-border-all"></i>',label_class:"tb_radio_label_borders"}],_.option_js=!0,_.id=l+"-type",_.no_toggle=!0,_.default="top",_.prop=null,a.options=e.getOptions("border"),a.prop=null;for(let t=0;t<4;++t){let r=A("li","tb_group_element_"+i[t]),c=l+"_"+i[t];_.options.push({value:i[t],name:i[t],icon:'<i class="tic-border-'+i[t]+'"></i>',label_class:"tb_radio_label_borders"}),"top"===i[t]&&(r.className+=" tb_group_element_all"),e.styles[c+"_color"]={prop:"border-"+i[t],selector:n},a.id=c+"_color",a.type="color",a.class="border_color",r.appendChild(e.color.render(a,e)),e.styles[c+"_width"]={prop:"border-"+i[t],selector:n},a.id=c+"_width",a.type="range",a.class="border_width",a.units={px:{max:300}},r.appendChild(e.range.render(a,e)),e.styles[c+"_style"]={prop:"border-"+i[t],selector:n},a.id=c+"_style",a.type="select",a.class="border_style tb_multi_field";let d=e.select.render(a,e),p=d.querySelector("select");r.appendChild(d),o.appendChild(r),p.tfOn("change",(function(){s.It(this)}),{passive:!0}),"none"===p.value&&s.It(p)}return c.appendChild(e.radioGenerate("icon_radio",_,e)),s.Tt(o,c.querySelector("#"+_.id)),c.appendChild(o),t.label??="b",c}},slider:{render(t,e){const i=t.label||"sl_opt",o={fast:.5,normal:1,slow:4};return["crossfade","cover-fade","uncover-fade"].includes(e.values.effect_slider)&&(e.values.effect_slider="fade"),o[e.values.speed_opt_slider]&&(e.values.speed_opt_slider=o[e.values.speed_opt_slider]),e.create([{type:"group",label:g[i]||i,display:"accordion",options:t.options||e.getOptions("slider_options"),wrap_class:t.wrap_class}])}},custom_css:{render(t,e){t.class="large",t.control=!1,t.help="custom_css_help";const i=e.text.render(t,e);return r.activeModel.options(i.querySelector("#"+t.id),t.type),i}},custom_css_id:{render(t,e){let i,o={id:"custom_css_id",required:{rule:"custom_css_id",message:"errorId"},type:"text",label:"id_name",help:"id_help",control:!1,class:"large",wrap_class:"tb_disable_dc"};if(!1!==t.accordion){const l=[];t.custom_css&&l.push({id:t.custom_css,type:"custom_css"}),l.push(o),i=e.create([{type:"group",label:"cc",display:"accordion",options:l,wrap_class:"tb_field_group_css"}],e)}else i=e.create([o],e);const l=i.querySelector("#custom_css_id");return"row"===e.component?r.activeModel.options(l,t.type):l.tfOn("input",(t=>{const e=t.currentTarget,i=r.Forms.getValidator("custom_css_id")(e,r.activeModel.el),o=!1===i?g.errorId:i,l=e.parentNode.tfClass("tb_field_error_msg")[0];!0===i?(l?.remove(),r.activeModel.el.id=e.value):l?l.textContent=o:e.after(A("span","tb_field_error_msg",o))}),{passive:!0}),i}},hidden:{update(t,e,i){const o=i.getEl(t);o&&(o.value=e||e)},render(t,e){let i=A("input"),o=e.getStyleVal(t.id)??t.value??t.default??"";if(o&&"object"==typeof o)try{o=d.stringify(o)}catch(t){}return i.type="hidden",!0===e.is_repeat?(i.className=!0===e.is_sort?"tb_lb_sort_child":"tb_lb_option_child",i.dataset.inputId=t.id):(i.className="tb_lb_option",i.id=t.id),t.class!==y&&(i.className+=" "+t.class),i.value=o,e.O(i,t)}},frame:{render:(t,e)=>(t.options=e.getOptions("frame"),t.class="tb_frame tf_scrollbar",t.binding={not_empty:{show:["tb_frame_multi_wrap","tb_frame_color"]},empty:{hide:["tb_frame_multi_wrap","tb_frame_color"]}},e.layout.render(t,e))},title:{render:(t,e)=>(t.control={event:"keyup",control_type:"change",selector:".module-title"},e.text.render(t,e))},url:{render(e,i){e.input_type="url";const o=E(),l=i.text.render(e,i),s=A("button",{class:"tb_add_link"},g.addl);return s.tfOn(b,(async function(){"undefined"==typeof TB_Link_Lightbox&&(await t.loadJs(t.builder_url+"js/editor/lazy-components/link-lightbox.js"),this.click())}),{once:!0}),o.append(l,s),o}},advacned_link:{render:(t,e)=>e.create([{id:"link",type:"radio",label:"l",wrap_class:" tb_compact_radios",link_to:!0,binding:{permalink:{show:["open_link","no_follow"],hide:"custom_link"},custom:{show:["open_link","no_follow","custom_link"],hide:"open_link"},none:{hide:["custom_link","open_link","no_follow"]}}},{id:"custom_link",type:"url",label:"cl"},{id:"open_link",type:"radio",label:"o_l",link_type:!0,control:!1,wrap_class:" tb_compact_radios",binding:{lightbox:{show:"tb_t_m_lightbox"},regular:{hide:"tb_t_m_lightbox"},newtab:{hide:"tb_t_m_lightbox"}}},{type:"multi",wrap_class:"tb_t_m_lightbox",label:"lg",options:[{id:"lightbox_w",type:"range",label:"w",control:!1,default_unit:"%",units:{"%":"",px:{max:1e3}}},{id:"lightbox_h",type:"range",label:"ht",control:!1,default_unit:"%",units:{"%":"",px:{max:1e3}}}]}])},button:{render(t,e){const i=A("button",{type:"button",class:"builder_button",id:t.id},t.name);return t.class!==y&&(i.className+=" "+t.class),e.O(i,t)}},row_anchor:{render(t,e){t.control=!1;const i=e.text.render(t,e);return r.activeModel.options(i.querySelector("#"+t.id),t.type),i}},widget_form:{render:t=>A("",{id:t.id,class:"module-widget-form-container wp-core-ui tb_lb_option"})},widget_select:{_data:null,ct:new h,render(t,e){const i=E(),o=A("",{id:"available-widgets-filter",class:"tf_inline_b tf_vmiddle tf_rel"}),l=A("i","tb_loading_widgets tf_loader"),s=A("input",{type:"text",id:"widgets-search",autocomplete:"off",placeholder:g.search_widget,"data-validation":"not_empty","data-error-msg":"widget_validate"}),a=A("",{id:"available-widgets",class:"tf_scrollbar",tabindex:-1}),_=A("",{id:t.id,class:"tb_lb_option tb_widget_select"}),c=e.values[t.id],d=()=>{const i=[],o=(e,o)=>{for(let t=i.length-1;t>-1;--t)i[t].classList.remove("selected");e.classList.add("selected");const l=e.dataset.value;s.value=e.tfClass("widget-title")[0].textContent,a.style.display="none",this.Et(l,this._data[l].b,o,t)};for(let l in this._data){let s=A("",{class:"widget-tpl "+this._data[l].b,"data-value":l}),n=A("","widget-title");if(n.appendChild(A("h3","",this._data[l].n)),s.tfOn(b,(function(i){i.preventDefault(),i.stopPropagation(),e.settings[t.id]=this.dataset.value,o(this,null)})).appendChild(n),i.push(s),this._data[l].d!==y){let t=A("","widget-description");t.innerHTML=this._data[l].d,s.appendChild(t)}_.appendChild(s),c===l&&o(s,e.values.instance_widget)}this.At(s,a),l.remove()};if(this.N=_,o.append(l,s),a.appendChild(_),i.append(o,a),null===this._data){r.LocalFetch({action:"tb_get_widget_items"}).then((t=>{this._data=t,d()})).catch((()=>{r.Spinner.showLoader("error")}));for(let t in m.widget_css)S.loadCss(m.widget_css[t],null,themify_vars.wp);m.widget_css=null}else n(d,5);return i},At(t,e){const i=this;t.tfOn("focus",i.jt.bind(i),{passive:!0}).tfOn("blur",(t=>{"available-widgets"!==t.relatedTarget?.id&&(e.style.display="none")}),{passive:!0}).tfOn("keyup",(function(){i.jt();const t=this.value.trim(),e=RegExp(t,"i"),o=i.N.tfClass("widget-tpl");for(let i=0;i<o.length;++i)if(""===t)o[i].style.display="block";else{let t=o[i].tfTag("h3")[0];t=t.textContent||t.innerText,o[i].style.display=e.test(t)?"":"none"}}),{passive:!0})},jt(){this.N.closest("#available-widgets").style.display="block"},Et(e,o,l,s){const n=$("#instance_widget",r.LightBox.el),a=a=>{const _=()=>{const t=$(a.form);if(n.addClass("open").html(t.html()),l)for(let t in l)n.find('[name="'+t+'"]').val(l[t]);"text"===o?x.wp.textWidgets&&(this.Lt||(r.isVisual&&x.wp.textWidgets.init(),this.Lt=!0),l&&delete x.wp.textWidgets.widgetControls[l["widget-id"]]):x.wp.mediaWidgets&&(this.Mt||(x.wp.mediaWidgets.init(),this.Mt=!0),l&&delete x.wp.mediaWidgets.widgetControls[l["widget-id"]]),$(i).trigger("widget-added",[n]),"text"===o&&ThemifyConstructor.O(n.find(".wp-editor-area")[0],{control:{control_type:"wp_editor",type:"refresh"}});const _=r.Helper.cloneObject(s);_.id=n[0].id,n.on("change",(function(){null===r.is_ajax_call&&ThemifyConstructor.control.widget_select(this,_)})),e&&ThemifyConstructor.control.widget_select(n[0],_),n.removeClass("tb_loading_widgets_form").find("select").wrap('<span class="tf_inline_b tf_vmiddle tf_rel"/>')},c=(e,o)=>{const l=e.length;t.loadJs(e[o].src,null,a.v).then((()=>{e[o].extra?.after&&(t=>{let e="";if("object"==typeof t)for(let i in t)t[i]&&(e+=t[i]);if(""!==e){const t=A("script");t.text=e,i.tfTag("script")[0].before(t)}})(e[o].extra.after),++o<l?c(e,o):_()}))};this.ct.has(o)?_():(a.template&&(k.insertAdjacentHTML("beforeend",a.template),r.isVisual&&w.insertAdjacentHTML("beforeend",a.template)),a.src.length>0?c(a.src,0):_())};if(n.addClass("tb_loading_widgets_form").html('<div class="tf_loader"></div>'),l)for(let t in l){if(!t)continue;let e=t.match(/.*\[\d\]\[(.*)\]/);e&&e[1]!==y&&Array.isArray(e)&&(delete l[t],l[e[1]]=v)}const _={action:"module_widget_get_form",load_class:e,tpl_loaded:this.ct.has(o)?1:0,id_base:o,widget_instance:l};r.LocalFetch(_).then((t=>{t&&t.form&&(a(t),this.ct.set(o,1))})).catch((()=>{r.Spinner.showLoader("error")}))}},message:{render(t){const e=A("",t.class||"");return e.innerHTML=g[t.comment]||t.comment,e}},filters:{Rt:()=>({hue:{label:"hue",units:{deg:{max:360}},prop:"hue-rotate"},saturation:{label:"sat",units:{"%":{max:200}},prop:"saturate"},brightness:{label:"bri",units:{"%":{max:200}},prop:"brightness"},contrast:{label:"con",units:{"%":{max:200}},prop:"contrast"},invert:{label:"inv",units:{"%":""},prop:"invert"},sepia:{label:"se",units:{"%":""},prop:"sepia"},opacity:{label:"op",units:{"%":""},prop:"opacity"},blur:{label:"bl",units:{px:{max:50}},prop:"blur"}}),update(t,e,i){const o=this.Rt(),l=i.I[t].mid;i.select.update(l,i.getStyleVal(l),i);for(let e in o){let o=t+"_"+e;i["hue"===e?"angle":"range"].update(o,i.getStyleVal(o),i)}},render(t,e){const i=t.selector,o=this.Rt(),l=E(),s=A("ul","tb_seperate_items tb_filters_fields"),n=e.create([{id:t.mid,type:"select",label:"b_m",prop:"mix-blend-mode",selector:i,blend:!0}]);for(let l in o){let n=o[l],a=A("li");n.id=t.id+"_"+l,n.class="tb_filters_field",n.type="hue"===l?"angle":"range",n.selector=i,a.appendChild(e.create([n])),s.appendChild(a)}return l.append(n,s),l}},help(t){const e=A("","tb_help tf_rel"),i=A("","tb_help_content tf_hide tf_box"),o=A("i",{class:"icon",tabindex:-1});return i.innerHTML=g[t]||t,o.appendChild(r.Helper.getIcon("ti-help")),e.append(o,i),e},hint:t=>A("span","tb_tooltip_up",g[t]||t),description(t){const e=A("small");return e.innerHTML=g[t]||t,e},after(t){const e=A("span","tb_input_after",g[t.after]||t.after);return t.label!==y&&""!==t.label||t.help===y||""===t.help||e.appendChild(this.help(t.help)),e},toggle_switch:{update(t,e,i){i.checkbox.update(t,i.getStyleVal(t),i)},nt(t,e){t.tfOn("change",(function(){this.value=!0===this.checked?e.on.name:e.off?.name||"","visibility"===ThemifyConstructor.clicked&&null!==r.activeModel&&r.activeModel.visibilityLabel()}),{passive:!0})},render(t,e){let i=r.Helper.cloneObject(t),l={},s=A("","switch_label"),n="off",a=e.getStyleVal(t.id);i.control=!1,i.class===y?i.class="toggle_switch":i.class+=" toggle_switch";let _=i.options;_!==y&&"simple"!==_||("simple"===_?_={on:{name:"yes",value:"y"},off:{name:"no",value:"no"}}:(_={on:{name:"no",value:"s"},off:{name:"yes",value:"hi"}},i.default??="on")),a===y?("on"===i.default&&(n="on"),a="on"===n?_.on.name??"":_.off?.name??""):(!1===a&&(a=""),n=_.on.name===a?"on":"off");for(let t in _){let e=_[t].value;i.after===y&&e!==y&&(s.dataset[t]=g[e]??e),l[t]=_[t]}const c=o.keys(_)[0];delete i.binding,delete _[c].value,delete i.default,i.options=[_[c]],i.wrap_checkbox??="",i.wrap_checkbox+=" tb_switcher";const d=e.checkboxGenerate("checkbox",i),p=d.querySelector(".toggle_switch");return p.value=a,p.checked="on"===n,this.nt(p,l),p.parentNode.appendChild(s),e.O(p,t),d}},height:{update(t,e,i){i.width.update(t,e,i)},render(t,e){let{minid:i,maxid:o}=t;return i||!1===i||(i="mi_h"),o||!1===o||(o="mx_h"),e.width.render(t,e,i,o,{px:{max:3500},vh:"","%":"",em:{max:200}})}},width:{update(t,e,i){i.range.update(t,e,i)},render(t,e,i,o,l){l||(l={px:{max:2e3},"%":"",em:{max:20}});const s=t.id,n=t.prop,a=t.selector,r="tb_wrap_"+n+"_field";"width"===n&&(i||(i="min_"+s),o||(o="max_"+s));const _=[{label:"width"===n?"w":"ht",id:s,type:"range",prop:n,selector:a,wrap_class:r,units:l},{id:s+"_auto_"+n,origId:s,type:"checkbox",label:"",prop:n,selector:a,options:[{value:"width"===n?"a_wd":"a_ht",name:"auto"}],binding:{checked:{hide:r},not_checked:{show:r}}}];return!1!==i&&_.push({label:"width"===n?"mi_wd":"m_ht",id:i,type:"range",prop:"min-"+n,selector:a,units:l}),!1!==o&&_.push({label:"width"===n?"ma_wd":"mx_ht",id:o,type:"range",prop:"max-"+n,selector:a,units:l}),e.create(_)}},aspectRatio:{update(t,e,i){const o=e.split("/"),l=o[0]||"",s=o[1]||"",n=i.getEl(t).closest(".tb_aspect_ratio").tfClass("tb_range");i.hidden.update(t,e,i),n[0].value=n[0].classList.contains("tb_aspect_to")?s:l,n[1].value=n[1].classList.contains("tb_aspect_to")?s:l},render(e,i){const o=i.getStyleVal(e.id)||"",s=o.split("/"),n=i.create([{type:"multi",label:"asp",wrap_class:"tb_aspect_ratio",options:[{type:"hidden",id:e.id,prop:e.prop,value:o||"",selector:e.selector},{type:"range",value:s[0]||"",id:"",min:1},{type:"message",comment:"/"},{id:"",class:"tb_aspect_to",type:"range",value:s[1]||"",min:1}]}]),a=n.querySelector("#"+e.id);for(let e=n.querySelectorAll(".tb_lb_option"),i=e.length-1;i>-1;--i)e[i]!==a&&e[i].tfOn("keyup",(e=>{const i=e.currentTarget;l((()=>{let e=a.value,o=i.classList.contains("tb_aspect_to")?1:0,l=1===o?0:1;e=e.split("/"),e[o]=i.value,e[l]||(e[l]=1),a.value=e.join("/"),t.triggerEvent(a,"change")}))}),{passive:!0});return n}},zIndex:{update(t,e,i){i.range.update(t,e,i)},render:(t,e)=>e.create([{id:t.id,label:"zi",type:"range",prop:t.prop,selector:t.selector,min:-99999,max:99999,help:"zhelp"}])},fontSize:{update(t,e,i){i.range.update(t,e,i)},render(t,e,i){i||(i=t.units||{px:{min:1,max:900},em:{min:.1,max:50},"%":{min:1,max:4e3},vw:{min:1,max:100},rem:{min:.1,max:50}});const o=e.create([{type:"range",id:t.id,selector:t.selector,prop:t.prop,wrap_class:t.wrap_class,class:t.class,help:t.help,description:t.description,after:t.after,units:i}]);return"font-size"===t.prop&&(t.label??="f_s"),o}},lineHeight:{update(t,e,i){i.range.update(t,e,i)},render(t,e){const i=e.fontSize.render(t,e,t.units||{px:{min:-400,max:400},em:{min:.1,max:50},"%":{min:1,max:4e3},vw:{min:1,max:100},rem:{min:.1,max:50}});return t.label??="l_h",i}},letterSpace:{update(t,e,i){i.range.update(t,e,i)},render(t,e){const i=e.fontSize.render(t,e,t.units||{px:{min:-50,max:500},em:{min:-3,max:50},vw:{min:1,max:100},rem:{min:.1,max:50}});return t.label??="l_s",i}},fontStyle:{update(t,e,i){const o=i.I[t].id2;i.radio.update(t,e,i),i.radio.update(o,i.getStyleVal(o),i)},render(t,e){const i=t.selector,o=e.create([{type:"multi",wrap_class:"tb_multi_fonts",options:[{id:t.id+"_regular",type:"icon_radio",options:e.getOptions("font_style"),prop:t.prop,selector:i},{id:t.id2,type:"icon_radio",options:e.getOptions("font_weight"),prop:"font-weight",selector:i}]}]);return t.label??="f_st",o}},position:{update(t,e,i){i.select.update(t,e,i);for(let e=["top","right","bottom","left"],o=e.length-1;o>-1;--o){let l=t+"_"+e[o],s=l+"_auto";i.range.update(l,i.getStyleVal(l),i),i.checkbox.update(s,i.getStyleVal(s),i)}},render(t,e){const{id:i,selector:o,prop:l}=t,s="tb_css_pos",n=[{type:"select",prop:l,id:i,selector:o,class:t.class||"",options:{"":"",static:"st",relative:"re",absolute:"abs",fixed:"fi"},binding:{empty:{hide:s},static:{hide:s},relative:{show:s},absolute:{show:s},fixed:{show:s}}}],a=[{type:"group",label:"po",wrap_class:"tb_css_pos_wrap",options:n}];t.binding=n[0].binding;for(let t=["top","right","bottom","left"],e=0;e<t.length;++e){let l=i+"_"+t[e];n.push({type:"multi",label:t[e],wrap_class:s,options:[{type:"range",id:l,selector:o,prop:t[e],units:{px:{min:-2e3,max:2e3},"%":{min:-1e3,max:1e3}}},{id:l+"_auto",is_position:!0,posId:l,prop:t[e],type:"checkbox",selector:o,options:[{name:"auto",value:"auto"}],binding:{checked:{hide:l},not_checked:{show:l}}}]})}return e.create(a)}},transform:{update(t,e,i){for(let e=["scale","translate","skew"],o=e.length-1;o>-1;--o){let l=t+"_"+e[o];i.margin.update(l,i.getStyleVal(l),i)}for(let e=["x","y","z"],o=e.length-1;o>-1;--o){let l=t+"_rotate_"+e[o];i.angle.update(l,i.getStyleVal(l),i)}const o=t+"_position";i.position_box.update(o,i.getStyleVal(o),i)},render(t,e){const{id:i,selector:o,prop:l}=t,s="tb_transform_field "+(t.class||""),n=[{id:"top",label:"X"},{id:"bottom",label:"Y"}];return e.create([{type:"group",wrap_class:"tb_transform_fields tf_w "+(t.wrap_class||""),label:"",options:[{id:i+"_scale",type:"margin",label:"sc",prop:l,selector:o,class:s,units:{"":{min:-100,max:1e3,increment:.1}},options:n},{id:i+"_translate",type:"margin",label:"tl",prop:l,selector:o,class:s,units:{px:{min:-2e3,max:2e3},"%":{min:-100,max:100},em:{min:0,max:100}},options:n},{id:i+"_skew",type:"margin",label:"sk",prop:l,selector:o,class:s,units:{deg:{min:-180,max:180}},options:n},{type:"multi",label:"ro",wrap_class:"tb_tr_rotate",options:[{id:i+"_rotate_x",type:"angle",tooltip:"X",prop:"rotate",selector:o,class:s},{id:i+"_rotate_y",type:"angle",tooltip:"Y",prop:"rotate",selector:o,class:s},{id:i+"_rotate_z",type:"angle",tooltip:"Z",prop:"rotate",selector:o,class:s}]}]},{id:i+"_position",label:"orig",type:"position_box",prop:"transform-origin",selector:o}])}},clickable:{render(t,e){let i=e.create([{type:"group",label:"l",display:"accordion",wrap_class:"tf_w",options:[{type:"url",id:"_link",label:"clickl",binding:{empty:{hide:["_link_o","_link_n"]},not_empty:{show:["_link_o","_link_n"]}}},{type:"toggle_switch",id:"_link_o",label:"houtl"},{type:"toggle_switch",id:"_link_n",label:"olnknt",options:"simple"}]}]);return r.isVisual&&(i=this.rt(i)),i},rt(e){const i=e.querySelector("#_link"),o=e.querySelector("#_link_o input");return i.tfOn("input",(()=>{this.Nt(i.value,o.checked)})),o.tfOn("change",(()=>{this.Nt(i.value,o.checked)})),t.loadCss(ThemifyBuilderModuleJs.cssUrl+"clickable-component","tf_clickablecomponent"),e},Nt(t,e){e&&""!==t?(r.liveStylingInstance.el.dataset.tb_link=t,r.liveStylingInstance.el.classList.add("tb_link_outline")):(delete r.liveStylingInstance.el.dataset.tb_link,r.liveStylingInstance.el.classList.remove("tb_link_outline"))}},code:{render(e,i){const o=[{id:"lng",label:e.options.lng,type:"select",options:{markup:"Markup(markup, html, xml, svg, mathml, ssml, atom, rss)",css:"CSS",javascript:"JavaScript",abap:"ABAP",abnf:"ABNF",actionscript:"ActionScript",ada:"Ada",agda:"Agda",al:"AL",antlr4:"ANTLR4",apacheconf:"Apache Configuration",apex:"Apex",apl:"APL",applescript:"AppleScript",aql:"AQL",arduino:"Arduino",arff:"ARFF",armasm:"ARM Assembly",arturo:"Arturo",asciidoc:"AsciiDoc",aspnet:"ASP.NET (C#)",asm6502:"6502 Assembly",asmatmel:"Atmel AVR Assembly",autohotkey:"AutoHotkey",autoit:"AutoIt",avisynth:"AviSynth","avro-idl":"Avro IDL",awk:"AWK",bash:"Bash",basic:"BASIC",batch:"Batch",bbcode:"BBcode",bbj:"BBj",bicep:"Bicep",birb:"Birb",bison:"Bison",bnf:"BNF",bqn:"BQN",brainfuck:"Brainfuck",brightscript:"BrightScript",bro:"Bro",bsl:"BSL (1C:Enterprise)",c:"C",csharp:"C#",cpp:"C++",cfscript:"CFScript",chaiscript:"ChaiScript",cil:"CIL",cilkc:"Cilk/C",cilkcpp:"Cilk/C++",clojure:"Clojure",cmake:"CMake",cobol:"COBOL",coffeescript:"CoffeeScript",concurnas:"Concurnas",csp:"Content-Security-Policy",cooklang:"Cooklang",coq:"Coq",crystal:"Crystal",csv:"CSV",cue:"CUE",cypher:"Cypher",d:"D",dart:"Dart",dataweave:"DataWeave",dax:"DAX",dhall:"Dhall",diff:"Diff",django:"Django/Jinja2","dns-zone-file":"DNS zone file",docker:"Docker",dot:"DOT (Graphviz)",ebnf:"EBNF",editorconfig:"EditorConfig",eiffel:"Eiffel",ejs:"EJS",elixir:"Elixir",elm:"Elm",etlua:"Embedded Lua templating",erb:"ERB",erlang:"Erlang","excel-formula":"Excel Formula",fsharp:"F#",factor:"Factor",flow:"Flow",fortran:"Fortran",ftl:"FreeMarker Template Language",gml:"GameMaker Language",gap:"GAP (CAS)",gcode:"G-code",gdscript:"GDScript",gedcom:"GEDCOM",gettext:"gettext",gherkin:"Gherkin",git:"Git",glsl:"GLSL",gn:"GN","linker-script":"GNU Linker Script",go:"Go","go-module":"Go module",gradle:"Gradle",graphql:"GraphQL",groovy:"Groovy",haml:"Haml",handlebars:"Handlebars",haskell:"Haskell",haxe:"Haxe",hcl:"HCL",hlsl:"HLSL",hoon:"Hoon",http:"HTTP",hpkp:"HTTP Public-Key-Pins",hsts:"HTTP Strict-Transport-Security",ichigojam:"IchigoJam",icon:"Icon","icu-message-format":"ICU Message Format",idris:"Idris",ignore:".ignore",inform7:"Inform 7",ini:"Ini",io:"Io",j:"J",java:"Java",javadoclike:"JavaDoc-like",javastacktrace:"Java stack trace",jexl:"Jexl",jolie:"Jolie",jq:"JQ",jsdoc:"JSDoc",json:"JSON",json5:"JSON5",jsonp:"JSONP",jsstacktrace:"JS stack trace",julia:"Julia",keepalived:"Keepalived Configure",keyman:"Keyman",kotlin:"Kotlin",kumir:"KuMir (КуМир)",kusto:"Kusto",latex:"LaTeX",latte:"Latte",less:"Less",lilypond:"LilyPond",liquid:"Liquid",lisp:"Lisp",livescript:"LiveScript",llvm:"LLVM IR",log:"Log file",lolcode:"LOLCODE",lua:"Lua",magma:"Magma (CAS)",makefile:"Makefile",markdown:"Markdown",mata:"Mata",matlab:"MATLAB",maxscript:"MAXScript",mel:"MEL",mermaid:"Mermaid",metafont:"METAFONT",mizar:"Mizar",mongodb:"MongoDB",monkey:"Monkey",moonscript:"MoonScript",n1ql:"N1QL",n4js:"N4JS","nand2tetris-hdl":"Nand To Tetris HDL",naniscript:"Naninovel Script",nasm:"NASM",neon:"NEON",nevod:"Nevod",nginx:"Nginx",nim:"Nim",nix:"Nix",nsis:"NSIS",objectivec:"Objective-C",ocaml:"OCaml",odin:"Odin",opencl:"OpenCL",openqasm:"OpenQasm",oz:"Oz",parigp:"PARI/GP",parser:"Parser",pascal:"Pascal",pascaligo:"Pascaligo",psl:"PATROL Scripting Language",pcaxis:"PC-Axis",peoplecode:"PeopleCode",perl:"Perl",php:"PHP",phpdoc:"PHPDoc","plant-uml":"PlantUML",plsql:"PL/SQL",powerquery:"PowerQuery",powershell:"PowerShell",processing:"Processing",prolog:"Prolog",promql:"PromQL",properties:".properties",protobuf:"Protocol Buffers",pug:"Pug",puppet:"Puppet",pure:"Pure",purebasic:"PureBasic",purescript:"PureScript",python:"Python",qsharp:"Q#",q:"Q (kdb+ database)",qml:"QML",qore:"Qore",r:"R",racket:"Racket",cshtml:"Razor C#",jsx:"React JSX",tsx:"React TSX",reason:"Reason",regex:"Regex",rego:"Rego",renpy:"Ren'py",rescript:"ReScript",rest:"reST (reStructuredText)",rip:"Rip",roboconf:"Roboconf",robotframework:"Robot Framework",ruby:"Ruby",rust:"Rust",sas:"SAS",sass:"Sass (Sass)",scss:"Sass (SCSS)",scala:"Scala",scheme:"Scheme","shell-session":"Shell session",smali:"Smali",smalltalk:"Smalltalk",smarty:"Smarty",sml:"SML",solidity:"Solidity (Ethereum)","solution-file":"Solution file",soy:"Soy (Closure Template)",sparql:"SPARQL","splunk-spl":"Splunk SPL",sqf:"SQF:Status Quo Function (Arma 3)",sql:"SQL",squirrel:"Squirrel",stan:"Stan",stata:"Stata Ado",iecst:"Structured Text (IEC 61131-3)",stylus:"Stylus",supercollider:"SuperCollider",swift:"Swift",systemd:"Systemd configuration file","t4-templating":"T4 templating","t4-cs":"T4 Text Templates (C#)","t4-vb":"T4 Text Templates (VB)",tap:"TAP",tcl:"Tcl",tt2:"Template Toolkit 2",textile:"Textile",toml:"TOML",tremor:"Tremor",turtle:"Turtle",twig:"Twig",typescript:"TypeScript",typoscript:"TypoScript",unrealscript:"UnrealScript",uorazor:"UO Razor Script",uri:"URI",v:"V",vala:"Vala",vbnet:"VB.Net",velocity:"Velocity",verilog:"Verilog",vhdl:"VHDL",vim:"vim","visual-basic":"Visual Basic",warpscript:"WarpScript",wasm:"WebAssembly","web-idl":"Web IDL",wgsl:"WGSL",wiki:"Wiki markup",wolfram:"Wolfram language",wren:"Wren",xeora:"Xeora","xml-doc":"XML doc (.net)",xojo:"Xojo (REALbasic)",xquery:"XQuery",yaml:"YAML",yang:"YANG",zig:"Zig"}},{id:"theme",label:e.options.theme,type:"select",options:{"":"Default",a11y_d:"A11y Dark",atom_d:"Atom Dark",cb:"CB",cld_c:"Coldark Cold",cld_d:"Coldark Dark",coy:"Coy",dark:"Dark",dracula:"Dracula",du_d:"Duotone Dark",du_f:"Duotone Forest",gr_d:"Gruvbox Dark",gr_l:"Gruvbox Light",lucario:"Lucario",mt_l:"Material Light",night_owl:"Night Owl",okaidia:"Okaidia",tmr:"Tomorrow Night",twilight:"Twilight",vs:"VS",vs_d_p:"VS Dark Plus"}},{id:"code",label:e.options.code,type:"textarea",codeeditor:i.getStyleVal("lng")||"javascript",control:{event:"change"}}],l=i.create(o),s=l.querySelector("#lng"),n=l.querySelector("#code");return s.tfOn("change",(e=>{const i=n.tf_mirror;i&&(i.save(),i.destroy()),r.Helper.codeMirror(n,e.currentTarget.value).then((e=>{e?.editor.on("change",(()=>{t.triggerEvent(e.el,"change")}))}))}),{passive:!0}),l}},image_size:{render(t,e){if(m.imgphp){const i=e.getOptions("image_size");if(i)return e.create([{type:"select",id:t.id,label:t.label||"imgs",binding:t.binding,help:t.help,wrap_class:t.wrap_class,after:t.after,options:i}])}return!1}},post_filter:{render:(t,e)=>e.create([{id:"post_filter",type:"toggle_switch",label:e.type.includes("product")?"productf":"postf",options:"simple",wrap_class:"tb_group_element_all tb_group_element_category",default:"off",binding:{not_checked:{show:["disable_masonry","masonry","sort"],hide:["filter_hashtag","ajax_filter_wrap"]},checked:{hide:["disable_masonry","masonry","sort"],show:["filter_hashtag","ajax_filter_wrap"]}}},{id:"filter_hashtag",type:"toggle_switch",label:"uhtag",options:"simple",default:"off"},{type:"group",wrap_class:"ajax_filter_wrap tf_w",options:[{id:"ajax_filter",type:"toggle_switch",label:"ajaxf",options:"simple",default:"off",binding:{not_checked:{hide:"ajax_filter_cat_wrap"},checked:{show:"ajax_filter_cat_wrap"}}},{type:"group",wrap_class:"ajax_filter_cat_wrap tf_w",options:[{id:"ajax_filter_categories",type:"radio",label:"",default:"exclude",options:[{value:"include",name:"include"},{value:"exclude",name:"exclude"}],binding:{include:{hide:"ajax_filter_exclude",show:"ajax_filter_include"},exclude:{hide:"ajax_filter_include",show:"ajax_filter_exclude"}}},{id:"ajax_filter_exclude",type:"text",class:"large",label:"exclcatf",help:"exclcatfh"},{id:"ajax_filter_include",type:"text",class:"large",label:"inclcatf",help:"inclcatfh"},{id:"ajax_sort",type:"toggle_switch",label:"sortf",options:"simple",default:"off"}]}]},{id:"masonry_align",type:"toggle_switch",label:"alignp",options:"simple",help:"alignph",default:"off"}],e)},grid_flow:{update:(t,e,i)=>i.radio.update(t,e,i),render(e,i){e.label="gflow",e.option_js=!0,e.default="row",e.no_toggle=1;const o=t.builder_url+"css/editor/img/alignment.svg#";return e.options=[{value:"row",name:"vertical",icon:'<svg class="tb_align"><use href="'+o+'vertical"/></svg>'},{value:"column",name:"hrztal",icon:'<svg class="tb_align"><use href="'+o+'horizontal"/></svg>'}],i.icon_radio.render(e,i)}},gap:{update:(t,e,i)=>i.slider_range.update(t,e,i),render(t,e){const i=t.units||{px:{max:1e3},em:{max:50}},o=t.prop;t.units||"row-gap"===o||(i["%"]="");const l={...t,grid_gap:1,units:i,options:{unit:e.getStyleVal(t.id+"_unit")||(i["%"]!==y?"%":"px"),default:0,inputRange:!0,range:!1}};return t.label??="column-gap"===o?"ng":"row-gap"===o?"rg":"gap",e.slider_range.render(l,e)}},grid:{id:"tb_grid_lb_root",update(t,e,i,o){const l=i.getEl(t),s=r.Forms.parseSettings(l).v,n={};l.replaceWith(this.render(i.I[t],i));for(let t in s)n[o+"_"+t]=s[t];i.values[t]={...i.values[t],...n}},get(){const t=ThemifyConstructor.values[this.id];return t?{...t}:null},set(t){const e=ThemifyConstructor,i=this.id,o=e.getEl(i),l=o?.shadowRoot.querySelector(".grid_list .selected").dataset.grid,s=t[r.activeBreakPoint+"_size"]?.toString();e.values[i]={...t},s!==l&&o&&o.replaceWith(this.render(e.I[i],e))},render(t,e){let o=this.id,l=A("",{id:o,class:"tf_w tb_lb_option tb_grid_root"}),s=A("",{id:"grid",class:"tb_field"}),n=i.tfId("tmpl-builder_row_action").content,a=n.querySelector("#module_form_fields_style").cloneNode(!0),_=n.querySelector("#module_row_grids_style").cloneNode(!0),c=i.tfId("module_lightbox_grid_style").cloneNode(!0),d={grid_list:"pgrids",alignment:"align",auto_dir:"cht",right:"gutter"},p=E();e.I[o]===y&&(e.values[o]={...r.activeModel.get("sizes")},e.I[o]=r.Helper.cloneObject(t)),c.removeAttribute("type"),r.activeModel.gridMenu(s);for(let t in d){let e=s.querySelector("."+t),i=A();if("grid_list"!==t){let e="right"===t?"gutter":t;i.className=e+"_wrap","alignment"!==e&&(i.className+=" alignment_wrap")}i.append(A("","tb_label",g[d[t]]),e),p.appendChild(i)}return s.replaceChildren(p),l.attachShadow({mode:"open"}).append(r.ToolBar.getBaseCss(),a,_,c,s),l}},random:{render:(t,e)=>(t.control=!1,t.default=r.activeModel.id+(new Date).getUTCMilliseconds()+f.random().toString(36).substr(2),e.hidden.render(t,e))}}})(tb_app,I,w,T,z,C,S),((a,_,c,d,p,u,h)=>{const{isFrontend:w,Registry:v}=a;a.ToolBar={isLoaded:!1,el:null,init(){if(w){const t=h.tfId("tf_svg");if(t){const e=t.firstChild,o=e.querySelector("#tf_fonts_style"),l=E();o&&(i.tfId("tf_fonts_style").textContent+=o.textContent,o.remove());for(let t=e.children,i=t.length-1;i>-1;--i)l.appendChild(t[i]);i.tfId("tf_svg").firstChild.appendChild(l),t.remove()}}const e=i.tfId("tb_main_toolbar_root"),s=e.firstElementChild,r=A("style"),p=E(),f=i.tfId("tf_svg").cloneNode(!0);let m="";for(let t=a.breakpointsReverse,e=t.length-1;e>-1;--e)"desktop"!==t[e]&&(m+="--tb_bp_"+t[e]+":"+a.Utils.getBPWidth(t[e])+"px;");r.textContent=":root{"+m+"}",c.appendChild(r.cloneNode(!0)),d.appendChild(f.cloneNode(!0)),p.append(i.tfId("tf_lazy_common").cloneNode(!0),f.cloneNode(!0)),s&&(e.attachShadow({mode:s.getAttribute("shadowrootmode")}).appendChild(s.content),s.remove()),e.shadowRoot.prepend(p),w&&d.appendChild(e),this.el=e.shadowRoot.tfId("toolbar");const g=this.el.getRootNode().querySelector("#module_combine_style");w&&h.head.prepend(r,g.cloneNode(!0)),i.tfId("themify-builder-admin-ui-css").before(g.cloneNode(!0)),t.on("themify_builder_ready",(()=>{w||(i.tfId("tb_canvas_block")||i.tfClass("tb_active_builder")[0]).before(e),this.isLoaded=!0,t.trigger("tb_toolbar_loaded"),this.Dt(),l((()=>{l((()=>{e.style.display="",this.Pt()}))})),n((()=>{c.prepend(a.MainPanel.el.getRootNode().querySelector("#module_drag_grids_style").cloneNode(!0)),u.loadCss(t.url+"themify-metabox/css/themify.minicolors"),u.loadCss(t.builder_url+"css/editor/themify-combobox");const e={[_]:{".revision_btn":"initRevision",".layout":"initLayout",".import":"initImport",".export":"initExport",".duplicate":"duplicate",".save_btn":"save",".switch":"switchTo",".tf_close":"panelClose",".breakpoint_switch":"breakpointSwitcher",".devices":"deviceSwitcher",".custom_css":"addCustomCSS",".zoom":"zoom",".preview":"previewBuilder",".tree":"initTree",".backend_mode":"backendMode",".help":"initHelp",".plus":"showPanel"},change:{".mode input":"modChange"}};for(let t in e)this.el.tfOn(t,(t=>{const i=o.keys(e[t.type]),l=t.target.closest(i);if(l)for(let o=0;o<i.length;++o)if(l.matches(i[o])){const s=e[t.type][i[o]];t.stopPropagation(),t.item=l,this[s](t);break}t=null}),{passive:!0});a.Drag(a.Builder.get().el),a.Utils.updateDocumentSize(),n((()=>{this.Ot(),b.removeItem("tb_mode"),w&&(u.on("tfsmartresize",(e=>{t.trigger("tfsmartresize",e)})),this.Bt())}),2e3)}),800)}),!0,a.is_builder_ready).trigger("tb_toolbar_style_ready")},Pt(){let t;new ResizeObserver((e=>{s(t);const i=e[0].target;t=l((()=>{i.classList.toggle("compact_menu",i.getBoundingClientRect().width<=800)}))})).observe(this.el)},getBaseCss(){const t=E(),e=this.el.getRootNode(),i=e.querySelector("#tf_lazy_common"),o=e.querySelector("#tf_svg"),l=e.querySelector("#tf_base");return t.append(i.cloneNode(!0),o.cloneNode(!0),l.cloneNode(!0)),t},Dt(){const t=b.getItem("tb_dark_mode");("1"===t||"-1"!==t&&e.matchMedia("(prefers-color-scheme:dark)").matches)&&(this.el.tfClass("dark_mode")[0].checked=!0,this.qt(!0)),w&&(b.getItem("tb_inline_editor")&&(a.inlineEditor=!1,this.el.tfClass("inline_editor_mode")[0].checked=!1),b.getItem("tb_right_click")&&(this.el.tfClass("right_click_mode")[0].checked=!1))},showPanel(){a.MainPanel.openFloat()},Ot(){w&&i.head.insertAdjacentHTML("afterbegin",'<base target="_parent">'),x.tfOn("beforeunload",(t=>{if(!0!==this.preventBeforeMsg&&!1===a.Builder.get().isSaved&&a.undoManager.hasUndo())return t.preventDefault(),t.returnValue="Are you sure"}))},panelClose(){return new r((t=>{(!1===a.Builder.get().isSaved&&a.undoManager.hasUndo()?a.LiteLightBox.confirm({msg:"builderClose",buttons:{no:"save_no",yes:"saveClose"}}):r.resolve("no")).then((e=>{"yes"===e?this.save().then((()=>{t(e),this.panelClose()})):"no"===e&&(this.preventBeforeMsg=!0,x.location.reload())}))}))},async initRevision(i){const o=i.target;if(o.classList.contains("load_revision")&&a.Spinner.showLoader(),await r.all([t.loadJs(a.componentsURL+"revisions",e.TB_Revisions),u.loadCss(t.builder_url+"css/editor/components/revisions")]),await TB_Revisions.init(o),o.classList.contains("load_revision")){const t=o.closest("ul");t.style.display="none",n((()=>{t.style.display=""}),50)}},async initLayout(i){const o=i.target;o.classList.contains("load_layout")&&a.Spinner.showLoader(),await r.all([t.loadJs(a.componentsURL+"layouts",!!e.TB_Layouts),u.loadCss(t.builder_url+"css/editor/components/layouts")]),await TB_Layouts.init(o)},async initImport(i){const o=i.target;o.hasAttribute("data-type")&&a.Spinner.showLoader(),await t.loadJs(a.componentsURL+"import",!!e.TB_Import),await TB_Import.init(o)},async initExport(i){a.Spinner.showLoader(),await r.all([t.loadJs(a.componentsURL+"export",!!e.TB_Export),a.Helper.loadJsZip()]),await TB_Export.init()},async initHelp(){a.Spinner.showLoader(),await t.loadJs(a.componentsURL+"help",!!e.TB_Help),await TB_Help.init()},async backendMode(o){await a.LightBox.save();const l=this.el.tfClass("backend_mode")[0].classList;if(!l.contains("working")){l.add("working"),a.Spinner.showLoader(),a.SmallPanel.hide(),await(e.TB_BuilderContentLightbox?.saveAll());const o=a.Builder.get(),s=o.toJSON(),n="tb_backend_mode",_=i.tfId(n),u=i.tfId("themify-builder-admin-ui-css"),h=this.el.tfClass("padding_dragging_mode")[0],f=this.el.tfClass("inline_editor_mode")[0],m=[c,d],g=[],y=!a.isVisual;a.isVisual=y,_?_.disabled=a.isVisual:g.push(t.loadCss(t.builder_url+"css/editor/backend-mode",n,null,u.nextSibling)),y?(a.inlineEditor=f.checked=!b.getItem("tb_inline_editor"),h.checked=!b.getItem("tb_disable_padding_dragging"),h.disabled=f.disabled=!1):(h.checked=f.checked=a.inlineEditor=!1,h.disabled=f.disabled=!0,a.liveStylingInstance.reset()),l.toggle("active",!y),p.toggle("themify_builder_active",y);for(let t=m.length-1;t>-1;--t)m[t].classList.toggle("tb_backend_mode",!y);h.closest(".switch-wrapper").classList.toggle("disabled",!y),f.closest(".switch-wrapper").classList.toggle("disabled",!y),a.EdgeDrag.init(),t.trigger("tb_inline_editor_changed"),g.push(o.reLoad({builder_data:s,custom_css:o.customCss},!1,!1)),await r.all(g),l.remove("working"),a.Module.loadBackendLightbox("preload")}},async duplicate(){const t=await a.LiteLightBox.confirm({msg:"confirm_on_duplicate_page"});if(t){"yes"===t&&await a.Builder.get().save();try{a.Spinner.showLoader("show");const t=await a.LocalFetch({action:"tb_duplicate_page",tb_is_admin:a.isVisual?0:1});let e=t.data;if(!t.success)throw e;w&&(e+="#builder_active"),await a.Spinner.showLoader("done"),x.location.href=e.replaceAll("&","&")}catch(t){a.Spinner.showLoader("error"),TF_Notification.showHide("error",t,4e3)}}},modChange(e){const i=e.item.classList,o=!0===e.item.checked;if(i.contains("right_click_mode"))o?b.removeItem("tb_right_click"):b.setItem("tb_right_click",1),a.RightClick?.bind();else if(i.contains("padding_dragging_mode"))o?b.removeItem("tb_disable_padding_dragging"):b.setItem("tb_disable_padding_dragging",1),a.EdgeDrag.init();else if(i.contains("dark_mode")){b.setItem("tb_dark_mode",o?1:-1),this.qt(o);const t=d.querySelectorAll(".tf_cdm textarea");for(let e=t.length-1;e>-1;--e)t[e].tf_mirror?.setDarkMode(o)}else i.contains("inline_editor_mode")&&(o?b.removeItem("tb_inline_editor"):b.setItem("tb_inline_editor",1),a.inlineEditor=o,t.trigger("tb_inline_editor_changed"))},qt(e){const o=i.tfId("tb_dark_mode_style"),l=w?h.getElementById("tb_dark_mode_style"):null;if(e){const e=i.tfId("themify-builder-admin-ui-css");t.loadCss(t.builder_url+"css/editor/darkmode-ui","tb_dark_mode_style",null,e.nextSibling),w&&u.loadCss(t.builder_url+"css/editor/darkmode-ui","tb_dark_mode_style",null,h.querySelector('link[href*="/components/lightbox."]').nextSibling)}o&&(o.disabled=!e),l&&(l.disabled=!e),a.isDarked=e},switchTo(e){const i=e.item.getAttribute("href");w?this.save().then((()=>{x.location.href=i})):t.trigger("tb_switch_frontend",[i])},async save(){a.isOld||(a.GS.activeGS&&await a.LightBox.save(),await(e.TB_BuilderContentLightbox?.saveAll()),a.LayoutPart?.item&&(await a.LayoutPart.item.save(),await a.LayoutPart.item.close()),await a.Builder.get().save())},zoom:t=>new r((e=>{if(w&&"desktop"===a.activeBreakPoint){const i=t.item;let o=""+i.dataset.zoom||"100",l="",s=d.tfClass("tb_iframe")[0],n=i.closest(".zoom_menu"),r=n.querySelectorAll(".submenu .zoom"),_=n.tfClass("zoom_toggle")[0].parentNode;if(i.classList.contains("zoom_toggle")&&(o=a.zoomMeta||"100"!==o?"100":"50"),a.zoomMeta===o||"100"===o&&!a.zoomMeta)return void e();for(let t=r.length-1;t>-1;--t)r[t].parentNode.classList.toggle("selected_zoom","100"!==o&&r[t].dataset.zoom===o);if(s.tfOn("transitionend",(()=>{a.Utils.onResize(!0),e()}),{passive:!0,once:!0}),a.zoomMeta=!1,"100"!==o){const t="50"===o?2:1.25;s.parentNode.classList.add("tb_zoom_bg"),l=f.max(x.innerHeight*t,600)+"px",a.zoomMeta=o}_.classList.toggle("selected_zoom",a.zoomMeta),p.toggle("tb_zoom_only",a.zoomMeta),s.parentNode.style.height=l,s.classList.remove("tb_zooming_50","tb_zooming_75"),"100"!==o&&s.classList.add("tb_zooming_"+o)}else e()})),async addCustomCSS(e){try{await a.LightBox.save();const o={contructor:!0,loadMethod:"html",save:{},data:{css:{options:[{id:"custom_css",type:"textarea",rows:17,class:"fullwidth"},{id:"custom_css_m",type:"message",label:"",comment:"cus_css_m"},{id:"postid",type:"hidden",value:a.Builder.get().id}]}}},l=e.target.closest(".custom_css"),s=l.getBoundingClientRect();l.classList.add("active"),a.LightBox.el.classList.add("tb_custom_css_lightbox");let n,r=await a.LightBox.setStandAlone(s.left,s.top).open(o),c=r.querySelector("#custom_css"),d=r.tfClass("builder_save_button")[0],p=a.Builder.get(),b="tb_custom_css_"+p.id,u=async t=>{t&&(t.stopImmediatePropagation(),t.preventDefault()),n.save();const e=c.value.trim()||"",o=i.tfId(b),l=x.CodeMirror.lint.css(e,{errors:1});if(l?.length>0){if("no"===await a.LiteLightBox.confirm({msg:m.i18n.broken_code.replace("%s","CSS")}))return}o&&(o.innerHTML=e),p.customCss=e,a.LightBox.close()};c.value=p.customCss||"",n=await a.Helper.codeMirror(c,"css",{autofocus:!0}),n.editor.on("change",(t=>{const e=t.getValue().trim();if(a.isVisual){let t=i.tfId(b);null===t&&(t=A("style",{id:b}),i.head.appendChild(t)),t.innerHTML=e}})),d.tfOn(_,u),t.on("tb_save_lb",u).on("themify_builder_lightbox_close",(()=>{r.classList.remove("tb_custom_css_lightbox"),d.tfOff(_,u,{once:!0}),t.off("tb_save_lb",u),a.Builder.get(1)===y?this.el.tfClass("custom_css")[0].classList.toggle("active",!!p.customCss):l.classList.remove("active"),n.destroy(),c=d=n=p=null}),!0)}catch(e){}},async previewBuilder(t){const e=t.item,i=a.Builder.get().el;if(e.classList.toggle("active"),a.isPreview=!a.isPreview,a.isPreview?!a.isVisual&&w&&await this.backendMode(t):h.tfId("tb_iframe").style.height="",p.toggle("tb_preview_only"),p.toggle("themify_builder_active"),z.toggle("tb_preview_only"),a.ToolBar.el.classList.toggle("tb_preview_only"),a.MainPanel.el.classList.toggle("tb_preview_only"),a.isPreview){for(let t=i.tfClass("row_inner"),e=t.length-1;e>-1;--e)if(1===t[e].childElementCount&&t[e].tfClass("active_module")[0]===y){let i=t[e].tfClass("module_column")[0];if(i!==y){let l=v.get(i.dataset.cid);if(l&&0===o.keys(l.get("styling")).length){let i=t[e].closest(".module_row"),l=v.get(i.dataset.cid);l&&0===o.keys(l.get("styling")).length&&i.classList.add("tf_hide")}}}}else for(let t=i.querySelectorAll(".tf_hide.module_row"),e=t.length-1;e>-1;--e)t[e].classList.remove("tf_hide");for(let t=i.querySelectorAll("[data-cid]"),e=t.length-1;e>-1;--e){let i=t[e];w&&v.get(t[e].dataset.cid)?.previewVisibility(),i.draggable=!a.isPreview}},Bt(){const t=themify_vars.breakpoints,e={ip7pl:[414,736],ipxr:[414,896],ipxs:[375,812],ip8:[375,667],glxs9pl:[412,846],glxs8pl:[360,740],glxs7:[360,640],huawp20:[360,748],huawp10:[360,640]},i={nexus9:[768,1024],ipadm:[768,1024],glxyt10:[800,1280],ip_air:[820,1180],ippro:[1024,1366]},o=this.el.tfClass("breakpoint_switcher")[0];for(let l in t)if("desktop"!==l){let s=A("ul",{class:"submenu devices tf_hide tf_abs_t",tabindex:-1}),n=A("li","","Breakpoint Settings"),a=t[l],r="mobile"===l?e:i;n.dataset.width="mobile"===l?a:a[1],"mobile"!==l&&(n.dataset.height="tablet"===l?t.tablet_landscape[1]:a[0]),s.appendChild(n);for(let t in r){let e="tablet_landscape"===l?[r[t][1],r[t][0]]:r[t];s.appendChild(A("li",{"data-width":e[0],"data-height":e[1]},g[t]+" ("+e[0]+"X"+e[1]+")"))}o.tfClass(l)[0].appendChild(s)}},deviceSwitcher(t){const e=t.target,{width:i,height:o}=e.dataset;return i?(this.el.tfClass("selected_device")[0]?.classList.remove("selected_device"),e.classList.add("selected_device"),this.switchToBreakpoint(1*i,1*o)):r.reject()},breakpointSwitcher(t){let e,i="desktop";if("string"==typeof t)i=t;else{const e=t.item;e.classList.contains("breakpoint-tablet")?i="tablet":e.classList.contains("breakpoint-tablet_landscape")?i="tablet_landscape":e.classList.contains("breakpoint-mobile")&&(i="mobile")}if(a.activeBreakPoint!==i)return e="desktop"!==i?a.Utils.getBPWidth(i)-1:"",this.switchToBreakpoint(e,"")},Ft(){this.scrollY!==e.scrollY&&e.scroll(0,this.scrollY),this.scrollY!==x.scrollY&&x.scroll(0,this.scrollY)},switchToBreakpoint(o,l){return new r((s=>{if(z.contains("tb_start_change_mode"))return void s();let _="desktop",c=a.activeBreakPoint,b=h.tfId("tb_iframe");if(o){o*=1;const t=themify_vars.breakpoints;for(let e in t)if(Array.isArray(t[e])){if(t[e][0]<=o&&o<=t[e][1]){_=e;break}}else if(o<=t[e]){_=e;break}if(!1!==a.isDocked&&"tablet_landscape"===_){const t=d.tfClass("tb_workspace_container").offsetWidth;t<o&&(o=t)}o+="px"}else o="";if(l>0?l+="px":l="",null!==b&&o===b.style.width&&l===b.style.height)return void s();if(a.SmallPanel.hide(),a.ActionBar.disable=!0,null!==b){let t=""!==o?"width":"";""!==l&&(t+=""!==l&&""!==t?",height":""),b.style.willChange=t,a.ActionBar.clear()}let u,f=[p,z,this.el.classList,a.MainPanel.el.classList,a.SmallPanel.el.classList],m=[],g=b?.classList.contains("tb_resizing_start"),v=()=>{if(w){for(let t=m.length-1;t>-1;--t)m[t].style.display="";p.toggle("tf_scrollbar","desktop"!==_)}for(let t=f.length-1;t>-1;--t){let e=f[t];e.remove("builder-breakpoint-"+c),e.toggle("tb_responsive_mode","desktop"!==_),e.add("builder-breakpoint-"+_)}const o=()=>{t.trigger("themify_builder_change_mode",[c,_]),a.scrollTo=a.ActionBar.disable=f=u=b=m=g=c=_=null};if(w){b.style.willChange="","desktop"===_&&(d.style.height=""),x.tfOff("scroll",this.Ft,{passive:!0}),e.tfOff("scroll",this.Ft,{passive:!0}),"desktop"!==_&&(x.tfOn("scroll",this.Ft,{passive:!0}),e.tfOn("scroll",this.Ft,{passive:!0})),!a.scrollTo&&u&&(a.scrollTo=u),a.Utils.scrollTo(a.scrollTo);for(let t=f.length-1;t>-1;--t)f[t].remove("tb_start_animate");null!==b&&(b.style.transition=""),n((()=>{a.Utils.onResize(!0).then((()=>{a.Utils.setColumnsCount(i.tfClass("module_column")),"desktop"===_&&this.el.tfClass("selected_device")[0]?.classList.remove("selected_device"),a.Utils.scrollTo(a.scrollTo),x.scroll(0,e.scrollY);for(let t=f.length-1;t>-1;--t)f[t].remove("tb_start_change_mode");o(),s()}))}),150)}else o(),s()};(a.zoomMeta&&100!=~~a.zoomMeta?this.zoom({item:this.el.tfClass("zoom_toggle")[0]}):r.resolve()).then((()=>{if(a.activeBreakPoint=_,w){u=a.liveStylingInstance.el?a.liveStylingInstance.el:i.elementFromPoint(t.w/2-20,this.el.offsetHeight);const e=a.Builder.get().el.children,s=e=>{if(null!==e&&e!==y){const i=e.getBoundingClientRect();(i.bottom<0&&i.top<0||i.top>t.h)&&(e.style.display="none",m.push(e))}};for(let t=e.length-1;t>-1;--t)s(e[t]);s(i.tfId("headerwrap")),s(i.tfId("footerwrap"));for(let t=f.length-1;t>-1;--t)f[t].add("tb_start_animate","tb_start_change_mode");n((()=>{g?v():(b.tfOn("transitionend",v,{passive:!0,once:!0}).style.height=l,b.style.width=o)}),50)}else v()}))}))}},"interactive"===i.readyState||"complete"===i.readyState?a.ToolBar.init():i.tfOn("DOMContentLoaded",(()=>{a.ToolBar.init()}),{once:!0,passive:!0})})(tb_app,I,w,T,k,C,S),((a,u,w,v,k,x,C,S,T)=>{a.LightBox=class{static#t=a.isFrontend?"themify_builder_lightbox_frontend_pos_size":"themify_builder_lightbox_backend_pos_size";static#e=!1;static#i=null;static el=null;static Ut(){k.appendChild(i.tfId("tmpl-builder_lightbox").content),this.el=w.tfId("tb_lightbox_parent"),this.Gt(),a.Forms.Ht()}static Gt(){if(t.on("tb_opened_lightbox",(()=>{const t=this,e=t.el;e.tfOn("keydown paste copy",(t=>{t.stopPropagation()}),{passive:!0}).tfClass("tb_close_lightbox")[0].tfOn(C,(()=>{t.close()}),{passive:!0}),e.tfClass("builder_cancel_docked_mode")[0].tfOn(C,(e=>{e.preventDefault(),e.stopPropagation(),a.Dock.close(!1),t.Xt(),a.MainPanel.updateStorage()})),!1===t.#e&&(t.Xt(),t.setupLightboxSizeClass()),n((()=>{t.Vt(),t.Yt()}),250)}),!0),!m.disableShortcuts){const t=t=>{const e=w.activeElement;"INPUT"===e.tagName||"TEXTAREA"===e.tagName||w.fullscreenElement||e.isContentEditable||("Escape"!==t.key&&"Escape"!==t.code||!a.activeModel&&!a.LiteLightBox.isOpen()?"KeyS"!==t.code||!0!==t.ctrlKey&&!0!==t.metaKey||(t.preventDefault(),t.stopPropagation(),a.LiteLightBox.close(),a.activeModel?this.save():a.Builder.get().save()):(t.preventDefault(),t.stopPropagation(),a.LiteLightBox.isOpen()?a.LiteLightBox.close():this.save().then((()=>{this.close()}))))};i.tfOn("keydown",t),a.isFrontend&&w.tfOn("keydown",t)}}static open(e,i){return new r((o=>{const l=async i=>{const l=this.el,s=l.querySelector("#tb_lightbox_container"),n=l.tfClass("tb_lightbox_actions_wrap")[0],r=A("button",{class:"builder_button builder_save_button",title:g.ctr_save,type:"button"},g.done),_=a.activeModel;if(l.classList.add("tf_hide"),_&&(l.classList.add("tb_lb_"+_.get("mod_name")),await(_.beforeOpenLightbox?.(i))),"string"==typeof i?s.innerHTML=i:s.replaceChildren(i),n.replaceChildren(),!1!==e.save){if(_){a.isDocked&&l.classList.add("tb_lightbox_small"),a.isVisual&&(null!==a.GS.activeGS?(a.liveStylingInstance=a.createStyleInstance(),a.liveStylingInstance.init(null,!0)):(a.liveStylingInstance||(a.liveStylingInstance=a.createStyleInstance()),a.liveStylingInstance.init()));const t=i=>{i.stopImmediatePropagation(),this.save().then((()=>{!0!==a.isGSPage&&(r.tfOff(i.type,t,{passive:!0}),e.tfOff(i.type,t,{passive:!0}))})).catch((t=>{}))},e=A("a",{class:"tb_tooltip",href:"javascript:;"}),i=A("li","tb_top_save_btn");e.append(a.Helper.getIcon("ti-check"),A("span","",g.done)),i.appendChild(e),l.tfClass("tb_options_tab")[0].appendChild(i),r.tfOn(C,t,{passive:!0}),e.tfOn(C,t,{passive:!0}),a.undoManager.start("saveLightbox",_),a.restoreVals=a.Helper.cloneObject(_.get("mod_settings"))}n.appendChild(r)}if("html"===e.loadMethod&&!0!==e.contructor){const t=s.querySelectorAll(".tb_tab_nav a");for(let e=t.length-1;e>-1;--e)t[e].tfOn(C,T.switchTabs)}await(_?.openLightbox?.(s)),l.classList.remove("tf_hide"),s.style.scrollBehavior="auto",s.scrollTop=0,s.style.scrollBehavior="",this.Jt(),t.trigger("tb_opened_lightbox"),a.Spinner.showLoader("spinhide"),a.SmallPanel.hide(),l.focus(),o(l)};this.close(),i&&(a.activeModel=i);try{a.ActionBar.clearClicked(),l("html"===e.loadMethod?!0===e.contructor?T.run(e.data):e.data:T.run(e))}catch(t){}}))}static close(){const e=this.el,i=a.activeModel;return e.classList.contains("tf_hide")||!0===a.isGSPage||(t.trigger("themify_builder_lightbox_before_close",e),e.classList.add("tf_hide"),this.Qt(),a.undoManager.enable(),a.Utils.removeViewPortClass(e),t.trigger("themify_builder_lightbox_close",e),a.isVisual&&u.trigger("themify_builder_lightbox_close",e),null!==i&&(e.classList.remove("tb_lb_"+i.get("mod_name")),a.isVisual&&a.liveStylingInstance.clear(),!0===i.is_new?i.destroy():!i.is_saved&&a.undoManager.has("saveLightbox")&&i.restore(),i.is_saved||a.undoManager.clear("saveLightbox"),i.close?.(),i.el?.classList.remove("tb_current_module","tb_outline_anim"),a.activeModel=a.restoreVals=null)),this}static setStandAlone(e,i){return t.on("tb_opened_lightbox",(()=>{const o=this,l=o.el.style;o.#e=!0,x.add("tb_standalone_lightbox"),l.width=l.height="";const s=a.ToolBar.el.getBoundingClientRect(),n=p(o.el),r=_(n.width),c=_(n.height),d=v.innerWidth-10,b=v.innerHeight+10;i<s.bottom?i=s.bottom:i+c>b&&(i=b-c),e<0?e=0:e+r>d&&(e=d-r),l.transform="translate("+e+"px,"+i+"px)",l.width=r+"px",l.height=c+"px",o.setupLightboxSizeClass(r),t.on("themify_builder_lightbox_close",(t=>{x.remove("tb_standalone_lightbox"),t.style.transform=t.style.width=t.style.height="",o.#e=!1,o.Xt(),o.setupLightboxSizeClass(o.Kt().w)}),!0)}),!0),this}static Qt(){const t=this.el.querySelectorAll("#tb_lightbox_container,.tb_options_tab,.tb_lightbox_actions_wrap,.tb_action_breadcrumb");for(let e=t.length-1;e>-1;--e)t[e].replaceChildren();return this}static async save(){const e=a.activeModel;if(!this.el.classList.contains("tf_hide")){if(null!==e){if(!0!==a.isGSPage&&!a.Forms.isValidate(this.el.querySelector("#tb_options_setting")))throw"invalid";T.setStylingValues(a.activeBreakPoint);let i=e.get("mod_settings"),o={...a.Helper.cloneObject(T.values),...a.Forms.serialize("tb_options_setting",!0)};"column"!==e.type&&(o={...o,...a.Forms.serialize("tb_options_animation",!0),...a.Forms.serialize("tb_options_visibility",!0)},a.isVisual&&e.el.classList.toggle("tb_visibility_hidden","hide_all"===o.visibility_all||"hide"===o.visibility_desktop||"hide"===o.visibility_tablet||"hide"===o.visibility_tablet_landscape||"hide"===o.visibility_mobile),"module"===e.type&&a.Builder.get().removeLayoutButton()),a.ActionBar?.id===e.id&&a.ActionBar.clear(),a.Base.builderSave(o,"empty"),a.Base.builderSave(i,"empty"),e.saveLightbox&&await e.saveLightbox(o,i);const l=a.Helper.compareObject(i,o);!0===l&&(await t.trigger("themify_builder_save_component",[o,i]),a.isVisual&&await u.trigger("themify_builder_save_component",[o,i]),e.set("mod_settings",o)),e.is_new=!1,e.is_saved=!0,this.close(),!0!==a.isGSPage&&!0===l?a.undoManager.end("saveLightbox"):a.undoManager.clear("saveLightbox"),e.is_new=e.is_saved=null}else x.contains("tb_standalone_lightbox")&&await t.trigger("tb_save_lb");!0===a.isGSPage&&await TF_Notification.showHide("done",m.globalStyleData.save_text,2e3)}}static Yt(){const e=this,i=e.el.tfClass("tb_resizable");for(let o=i.length-1;o>-1;--o)i[o].tfOn("pointerdown",(function(i){if(0===i.button){i.stopImmediatePropagation();let o,n=this.ownerDocument,a=e.el;a.style.willChange="transform,width,height";const r=350,c=880,d=.9*n.documentElement.clientHeight,b=_(p(a).getPropertyValue("min-height")),u=this.dataset.axis,h=~~a.offsetHeight,f=~~a.offsetWidth,{clientX:m,clientY:g}=i,y=()=>{n.body.classList.add("tb_start_animate")},w=i=>{i.stopImmediatePropagation(),o=l((()=>{let o;const{clientX:l,clientY:s}=i,n=new DOMMatrix(p(a).transform);if("w"===u)o=m+f-l,o>c&&(o=c),o>=r&&o<=c&&(n.m41+=_(a.style.width)-o,a.style.width=o+"px",e.setupLightboxSizeClass(o));else{const t="-y"===u||"ne"===u||"nw"===u?g+h-s:h+s-g;o="sw"===u||"nw"===u?m+f-l:f+l-m,o>c&&(o=c),("se"===u||"x"===u||"sw"===u||"nw"===u||"ne"===u)&&o>=r&&o<=c&&("sw"!==u&&"nw"!==u||(n.m41+=_(a.style.width)-o),a.style.width=o+"px",e.setupLightboxSizeClass(o)),("se"===u||"y"===u||"-y"===u||"sw"===u||"nw"===u||"ne"===u)&&t>=b&&t<=d&&("-y"!==u&&"nw"!==u&&"ne"!==u||(n.m42+=_(a.style.height)-t),a.style.height=t+"px")}a.style.transform="translate("+n.m41+"px,"+n.m42+"px)",t.trigger("tb_resize_lightbox")}))},v=function(t){t.stopImmediatePropagation(),s(o),this.tfOff("pointermove",y,{passive:!0,once:!0}).tfOff("pointermove",w,{passive:!0}).tfOff("lostpointercapture pointerup",v,{passive:!0,once:!0}),a.style.willChange="",e.Xt(),n.body.classList.remove("tb_start_animate"),n=a=o=null};this.tfOn("lostpointercapture pointerup",v,{passive:!0,once:!0}).tfOn("pointermove",y,{passive:!0,once:!0}).tfOn("pointermove",w,{passive:!0}).setPointerCapture(i.pointerId)}}),{passive:!0})}static Vt(){const e=this,i=e.el.querySelectorAll(".tb_lightbox_top_bar,.tb_action_breadcrumb");for(let o=i.length-1;o>-1;--o)i[o].tfOn("pointerdown",(function(i){if(0===i.button){const o=i.target.classList;if(!o.contains("tb_lightbox_top_bar")&&!o.contains("tb_action_breadcrumb"))return;i.stopImmediatePropagation();let n,r=e.el,_=this.ownerDocument,c=r.getBoundingClientRect(),d=c.left-i.clientX,p=c.top-i.clientY,b=c.width,u=e=>{e.stopImmediatePropagation(),n=l((()=>{if(null!==r){let i=d+e.clientX,o=p+e.clientY;o<0&&(o=0),r.style.transform="translate("+i+"px,"+o+"px)",t.trigger("tb_panel_drag",[i,b])}}))},h=i=>{i.stopImmediatePropagation(),_.body.classList.add("tb_start_animate","tb_drag_lightbox"),a.ToolBar.el.classList.add("tb_start_animate","tb_drag_lightbox"),a.MainPanel.el.classList.add("tb_start_animate","tb_drag_lightbox"),t.trigger("tb_panel_drag_start"),!1===e.#e&&e.setupLightboxSizeClass()},f=function(i){i.stopImmediatePropagation(),s(n),this.tfOff("pointermove",h,{passive:!0,once:!0}).tfOff("pointermove",u,{passive:!0}).tfOff("lostpointercapture pointerup",f,{passive:!0,once:!0}),r.style.willChange="",t.trigger("tb_panel_drag_end"),!1===e.#e&&(e.Xt(),e.setupLightboxSizeClass()),_.body.classList.remove("tb_start_animate","tb_drag_lightbox"),a.ToolBar.el.classList.remove("tb_start_animate","tb_drag_lightbox"),a.MainPanel.el.classList.remove("tb_start_animate","tb_drag_lightbox"),n=r=_=d=b=p=null};r.style.willChange="transform",this.tfOn("lostpointercapture pointerup",f,{passive:!0,once:!0}).tfOn("pointermove",h,{passive:!0,once:!0}).tfOn("pointermove",u,{passive:!0}).setPointerCapture(i.pointerId)}}),{passive:!0})}static Jt(){let e=null,i=0,o=null,l=()=>{const t=()=>{if(null===e&&(e=this.el.querySelector(".tb_styling_tab_nav ul"),null!==e)){const t=e.lastElementChild;i=t.offsetLeft+t.offsetWidth}if(null!==e&&0!==i){a.isDocked?e.style.display="none":e.style.flexDirection="row";if(e.parentNode.offsetWidth<=i||a.isDocked){e.style.display="none";const t=e.tfClass("current")[0];null===o&&(o=A("span",{class:"tb_ui_dropdown_label",tabindex:-1}),e.before(o)),t&&(o.textContent=t.textContent),n((()=>{e.style.display=""}),100)}else null!==o&&(o.remove(),o=null);return e.style.flexDirection="",!0}return!1};a.isDocked&&t()||n(t,0)};l(),t.on("tb_builder_tabsactive",l).on("tb_resize_lightbox",l).on("themify_builder_lightbox_close",(()=>{t.off("tb_builder_tabsactive",l).off("tb_resize_lightbox",l),e=i=o=l=null}),!0)}static setupLightboxSizeClass(t){const e=this,i=e.el;t||(t=a.isDocked?_(p(i).width):e.Kt().width||~~i.offsetWidth);const o=i.classList;o.toggle("larger-lightbox",t>750),o.toggle("tb_lightbox_small",t<540)}static Kt(){const t=this;if(null===t.#i){let e=b.getItem(t.#t);e=e?d.parse(e):{},t.#i={top:100,left:f.max(0,v.innerWidth/2-300),width:600,height:500,...e}}return t.#i}static Xt(){if(!1===this.#e){const t=this,e=t.el,i=e.style,l=i.transform,s=l?new DOMMatrix(l):null,n=e.tfClass("tb_lightbox_top_bar")[0].getBoundingClientRect(),r=v.innerHeight-n.height,c=v.innerWidth,p=t.Kt();let u={width:_(i.width),height:_(i.height)};return s&&(u.top=s.m42,u.left=s.m41),(u.height<=0||isNaN(u.height))&&delete u.height,(u.width<=0||isNaN(u.width))&&delete u.width,u={...p,...u},(u.left<0||u.left+n.width>c)&&(u.left=u.left<0?0:c-n.width),(u.top<0||u.top>r)&&(u.top=u.top<0?0:r),i.transform="translate("+u.left+"px,"+u.top+"px)",u.width&&(i.width=u.width+"px"),u.height&&(i.height=u.height+"px"),a.isDocked||""+o.entries(u)==""+o.entries(p)||(t.#i=null,b.setItem(t.#t,d.stringify(u))),u}}},a.LiteLightBox=class{static isOpen(){return this.el?.childElementCount>0}static open(t){const e=this,o=A("form","content tf_abs_c tf_textc tf_box");if(!e.el){const t=i.tfId("tb_lite_lightbox_root"),o=t.firstElementChild,l=a.ToolBar.el.getRootNode().querySelector("#tf_base");o&&(t.attachShadow({mode:o.getAttribute("shadowrootmode")}).appendChild(o.content),o.remove()),t.shadowRoot.prepend(l.cloneNode(!0)),e.el=t.shadowRoot.tfId("wrapper"),e.el.tfOn(C,(t=>{const i=t.target;(e.el===i||i.classList.contains("tf_close"))&&e.close(t)})),k.appendChild(t)}o.append(t,A("button",{class:"tf_close",type:"button"})),e.el.appendChild(o),e.el.getRootNode().host.classList.remove("tf_hide")}static close(t){this.el&&this.isOpen()&&(t?.stopPropagation(),S.trigger(this.el,"close"))}static create(t){const e=E();for(let i in t){let o=t[i];if("buttons"===i){let i=A("","btns");for(let e in o){let l=A("button",{class:"tf_inline_b tf_textc","data-type":e},g[o[e]]||o[e]);l.tfOn(C,(t=>{this.Wt(t)})),t.input!==y||"yes"!==e&&"ok"!==e||(l.autofocus=1,n((()=>{l.focus()}),15)),i.appendChild(l)}e.appendChild(i)}else if("msg"===i){let t=A("","msg");t.innerHTML=g[o]||o,e.appendChild(t)}else if("input"===i){let t=A("input",{class:o.class+" tf_w",value:o.value||"",type:o.type});t.tfOn("keydown",(t=>{this.Zt(t)}),{passive:!0}),n((()=>{t.focus()}),100),e.appendChild(t)}}return e}static confirm(t={}){return t.buttons??={no:"no",yes:"y"},this.open(this.create(t)),new r((t=>{S.on(this.el,"confirm",(e=>{let i=this.el.querySelector(".content").tfTag("input")[0];i?(i=i.value||"",t([e,i])):t(e)})).on(this.el,"close",(()=>{t(null)}))})).finally((()=>{S.off(this.el,"confirm").off(this.el,"close").remove(this.el),this.el.getRootNode().host.classList.add("tf_hide"),this.el.innerHTML=""}))}static alert(t){return this.confirm({msg:t,buttons:{yes:"ok"}})}static prompt(t,e){return this.confirm({msg:t,input:{type:"text",class:"prompt_input",value:e},buttons:{no:"cancel",yes:"ok"}})}static Wt(t){t.preventDefault(),t.stopPropagation();const e=t.currentTarget.dataset.type;"cancel"===e?this.close():S.trigger(this.el,"confirm",e)}static Zt(t){"Enter"===t.key&&S.trigger(this.el,"confirm","yes",t.currentTarget.value.trim())}},a.Forms={$t:new h,parseSettings(t,i){const o=t.classList,l=i?t.dataset.inputId:t.id;if(!l)return!1;if(!o.contains("tb_row_js_wrapper")){let e=t.closest(".tb_field");if(!(null===e||e.classList.contains("_tb_hide_binding")||"none"===e.style.display&&e.className.includes("tb_group_element_"))&&(e=e.parentNode,e.classList.contains("tb_multi_fields")&&e.parentNode.classList.contains("_tb_hide_binding")))return!1}let s="";if(o.contains("tb_lb_wp_editor")){const e=t.id,i=tinyMCE?.get(e)||null;s=null!==i?!1===i.hidden?i.getContent():switchEditors.wpautop(tinymce.DOM.get(e).value):t.value}else if(o.contains("tb_checkbox_wrap")){const e=[],i=t.tfClass("tb_checkbox"),l=o.contains("tb_switcher");for(let t=0;t<i.length;++t)!0!==l&&!0!==i[t].checked||""===i[t].value||e.push(i[t].value);s=e.length>0?e.join("|"):!!l&&""}else if(o.contains("themify-layout-icon"))s=t.tfClass("selected")[0]?.id||"";else if(o.contains("tb_search_input")){s=t.dataset.value;let e=t.closest(".tb_input").tfClass("query_category_multiple")[0];e&&(e=e?.value.trim()||"",""!==e?s=e+"|"+(e.includes(",")?"multiple":"single"):s+="|single")}else if(o.contains("tb_radio_wrap")){let e=null;for(let i=t.tfTag("input"),o=i.length-1;o>-1;--o)if(!0===i[o].checked){e=i[o];break}null===e||"desktop"!==a.activeBreakPoint&&e.classList.contains("tb_responsive_disable")||(s=e.value)}else if(o.contains("tb_search_container"))s=t.previousElementSibling.dataset.value;else if(o.contains("tb_row_js_wrapper")){s=[];for(let e=t.tfClass("tb_repeatable_field_content"),i=0;i<e.length;++i){let t=e[i].tfClass("tb_lb_option_child");s[i]={};for(let e=0;e<t.length;++e){let o=this.parseSettings(t[e],!0);o?.id&&(s[i][o.id]=o.v)}}}else if(o.contains("module-widget-form-container"))s=this.serializeObject(t);else if(o.contains("tb_widget_select"))s=t.tfClass("selected")[0]?.dataset.value??"";else if(o.contains("tb_sort_fields_parent")){s=[];for(let e=t.children,i=0;i<e.length;++i){let t=e[i].dataset.type;if(t){let o=e[i].tfClass("tb_sort_field_dropdown")[0],l={type:t,id:e[i].dataset.id};if(o!==y){l.val={};let t=o.tfClass("tb_lb_sort_child");for(let e=t.length-1;e>-1;--e){let i=this.parseSettings(t[e],!0);i?.id&&(l.val[i.id]=i.v)}}else{let t=e[i].tfTag("input")[0].value;""!==t&&(l.val=d.parse(t))}s.push(l)}}0===s.length&&(s="")}else if(o.contains("tb_accordion_fields")){s={};for(let e=t.children,i=0;i<e.length;++i){let t=e[i].dataset.id;if(t){let o=e[i].tfClass("tb_accordion_fields_options")[0],l={};if(o!==y)l.val=this.serialize(o,null,!0);else{let t=e[i].tfTag("input")[0]?.value||"";""!==t&&(l.val=d.parse(t))}s[t]=l}}}else if(o.contains("tb_toggleable_fields")){s=[];for(let e=t.children,i=0;i<e.length;++i){let t=e[i].dataset.id;if(t){let o=e[i].tfClass("tb_toggleable_fields_options")[0],l={id:t,on:e[i].tfClass("tb_switcher")[0].tfClass("toggle_switch")[0].value};if(o!==y)l.val=this.serialize(o,null,!0);else{let t=e[i].tfTag("input")[0]?.value||"";""!==t&&(l.val=d.parse(t))}s.push(l)}}}else if(t.multiple&&"SELECT"===t.nodeName){s=[];for(let e=t.selectedOptions,i=0;i<e.length;++i)s.push(t.selectedOptions[i].value)}else if(o.contains("tb_grid_root")){s={};for(let e=t.shadowRoot.querySelectorAll("[data-col]"),i=e.length-1;i>-1;--i){let t=e[i].dataset.col;if("grid"===t)s.size=e[i].tfClass("selected")[0].dataset.grid;else if("gutter"===t){let o=e[i].parentNode,l=o.querySelector("#range").value;l>0&&(l+=o.querySelector("#range_unit").value),s[t]=ThemifyStyles.getGutter(l)}else"direction"!==t&&("autoHeight"===t?t="auto_h":"alignment"===t&&(t="align"),s[t]=e[i].tfClass("selected")[0].dataset.value)}}else if(s=t.value,l===e.tbpDynamic?.field_name){if(""===s)return!1;"string"==typeof s&&(s=d.parse(s))}else{if(l===a.GS.key&&"desktop"!==a.activeBreakPoint)return!1;if(""!==s)if("builder_content"===l)"string"==typeof s&&(s=d.parse(s));else{if("string"==typeof s&&s.includes(":")&&s.includes("{"))try{s=d.parse(s)}catch(t){}let e=t.dataset.opacity;null!==e&&""!==e&&(e=c(""+c((+e).toFixed(2))),e<.99&&(s+="_"+e))}}return s!==y&&"undefined"!==s&&null!==s||(s=""),{id:l,v:s}},serialize(t,e,i){const o={},l="string"==typeof t?a.LightBox.el.querySelector("#"+t):t;if(i??=!1,null!==l){const t=l.tfClass(i?"tb_lb_option_child":"tb_lb_option");for(let l=t.length-1;l>-1;--l){let s=this.parseSettings(t[l],i);!1===s||!s.id||!0!==e&&""===s.v||(o[s.id]=s.v)}}return o},Ht(){this.registerValidator("email",(t=>{const e="string"==typeof t?t:t.value.split(","),i=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;for(let t=e.length-1;t>-1;--t)if(!i.test(e[t]))return!1;return!0})),this.registerValidator("row_anchor",(t=>{let e=t.value;return e&&(e=e.replaceAll("#","").replaceAll(" ","").trim()),t.value=e,!0})),this.registerValidator("custom_css_id",((t,e)=>{let o=0,l=t.value.trim();if(l){l=l.replace(/[^a-zA-Z0-9\-\_]/g,"");while(1){if(isNaN(l[0]))break;l=l.substring(1)}if(l){e??=a.activeModel.el;const t=i.querySelectorAll("#"+l);if(t.length>0)for(let i=t.length-1;i>-1;--i)if(e!==t[i]&&null!==t[i].closest(".module_row")){++o;break}}}return t.value=l,0===o})),this.registerValidator("custom_css",(t=>{let e=t.value;if(e){e=e.replace(/\s\s+/g," ").split(" ");for(let t=e.length-1;t>-1;--t)if(e[t]=e[t].replace(/[^a-zA-Z0-9\s\-\_]/g,""),""!==e[t][0])while(1){if(isNaN(e[t][0]))break;e[t]=e[t].substring(1)}e=e.join(" ")}return t.value=e,!0})),this.registerValidator("not_empty",(t=>""!==(""+t.value).trim()))},registerValidator(t,e){this.$t.set(t,e)},getValidator(t){return this.$t.get(t)||this.$t.get("not_empty")},isValidate(e){const i=e.tfClass("tb_must_validate"),o=i.length;let l=!0;if(o>0){for(let t=o-1;t>-1;--t){let e=i[t].tfClass("tb_lb_option")[0],o=this.getValidator(i[t].dataset.validation)(e);if(!0!==o){if(!e.classList.contains("tb_field_error")){let l=e.parentNode.tfClass("tb_field_error_msg")[0],s=l||A("span"),n="SELECT"===e.tagName||e.classList.contains("tb_uploader_input")?e.parentNode:e,a=i[t].dataset.errorMsg;s.textContent=!1===o?g[a]||a:o,e.classList.add("tb_field_error"),l||(s.className="tb_field_error_msg",n.after(s))}l=!1}else{e.classList.remove("tb_field_error");for(let e=i[t].tfClass("tb_field_error_msg"),o=e.length-1;o>-1;--o)e[o].remove()}}if(!1===l){const i=a.LightBox.el.querySelector('a[data-id="'+e.id+'"]');i.parentNode.classList.contains("current")||t.triggerEvent(i,C),a.LightBox.el.focus(),TF_Notification.showHide("error",g.lightBoxRequiredFields)}}return l},serializeObject(t){const e={},i=t.querySelectorAll("input,select,textarea");for(let t=i.length-1;t>-1;--t){let{type:o,value:l,id:s,tagName:n}=i[t],a=i[t].name||s;if(a&&"button"!==o&&"submit"!==o&&""!==l){if(i[t].classList.contains("wp-editor-area")&&"undefined"!=typeof tinyMCE){let t=tinyMCE.get(s);t&&(l=t.getContent().trim())}else if("radio"===o||"checkbox"===o||"select"===n)if("select"===n){if(i[t].hasAttribute("multiple")){let e=[];for(let o=0,l=i[t].children;o<l.length;++o)l[o].selected&&e.push(l[o].value);l=e}}else if(!i[t].checked)continue;""!==l&&("checkbox"===o?(e[a]??=[],e[a].push(l)):e[a]=l)}}return e}},a.LightBox.Ut()})(tb_app,C,S,x,T,z,I,tb_app.Registry,ThemifyConstructor),((o,c,d)=>{let b,h;const f=i.tfId("tmpl-builder_row_action").content,g=i.tfId("tmpl-builder_column_action").content,w=i.tfId("tmpl-builder_subrow_action").content,v=i.tfId("tmpl-builder_module_action").content,{isFrontend:x,Registry:C}=o,S=(t,e)=>{let i=t.getRootNode(),l=t.dataset.href;"options"===l&&(i.querySelector("#"+l).classList.add("selected"),l=i.querySelector(".row_menu .selected"),l=l?.dataset.href||"grid");const s=i.querySelector("#"+l),n=i.querySelector("#grid"),a=i.host.closest("[data-cid]").dataset.cid,r="grid"===l?i.querySelector("#row_options"):n,_=i.querySelector("#options");if(s.childElementCount<2){const t=C.get(a);t&&("grid"===l?t.gridMenu(n):t.optionsTab(s))}for(let e=t.parentNode.children,i=e.length-1;i>-1;--i)e[i].classList.toggle("selected",e[i]===t);s.classList.add("selected"),r?.classList.remove("selected"),"click"!==e&&null!==_&&o.Utils.addViewPortClass(_)},T=t=>{b?.classList.remove("tb_current_module")||k.add("tb_nested_hover"),t&&(b=C.get(t).el,b.classList.add("tb_current_module"))},z=async e=>{e.stopPropagation();const l=e.target.dataset.cid;if(l){const s=e.currentTarget,a=C.get(l),r="subrow"===a.type?a.el.tfClass("module_subrow")[0]:a.el,_=r.querySelector(":scope>.tb_"+a.type+"_action");await a.edit(),"module"===a.type&&(s.closest(".tb_small_bar")?.classList.remove("tb_small_bar"),a.el.classList.remove("tb_small_bar")),r.classList.add("tb_show_action"),t.triggerEvent(_,"pointerover",{target:_},!0),o.ActionBar.disable=o.ActionBar.disableClear=!0,T(l),s.tfOff(c,z,{passive:!0}).remove(),n((()=>{const e=l=>{l&&0!==l.button||(o.Builder.get().el.tfOff("pointerdown",e,{passive:!0}),i.tfOff("pointerdown",e,{passive:!0}),d.tfOff("pointerdown",e,{passive:!0}),t.off("themify_builder_lightbox_close",e),n((()=>{for(let t=o.Builder.get().el.tfClass("tb_show_action"),e=t.length-1;e>-1;--e)t[e].classList.remove("tb_show_action");o.ActionBar.disableClear=o.ActionBar.disable=null,t.triggerEvent(l.target,"pointerover",{target:l.target},!0)}),100))};o.Builder.get().el.tfOn("pointerdown",e,{passive:!0}),i.tfOn("pointerdown",e,{passive:!0}),t.on("themify_builder_lightbox_close",e,!0),x&&d.tfOn("pointerdown",e,{passive:!0})}),150)}},I=t=>{t.stopPropagation();const e=t.currentTarget,i=e.getRootNode(),l=t.target,s=l.classList.contains("more")||l.classList.contains("inner_more")?l.tfClass("menu")[0]:null;if((s||l.classList.contains("inner_more")||l.classList.contains("menu"))&&o.Utils.addViewPortClass(s||l),l.hasAttribute("data-href"))S(l);else{const t=i.querySelector(".tab");if(null!==t){for(let t=e.children,i=t.length-1;i>-1;--i)t[i].classList.remove("selected");t.classList.remove("selected")}else if(s||!l.part.contains("nested")||i.querySelector(".nested_menu"))l.dataset.cid&&l.parentNode.classList.contains("nested_menu")&&T(l.dataset.cid);else{let t=i.host.closest("[data-cid]"),e=o.Builder.get().el,s=[t.dataset.cid],n=0,a=A("ul","menu nested_menu tf_hide tf_box tf_scrollbar");if(t.classList.contains("tb_show_action"))return;while(1){if(t=t.parentNode.closest("[data-cid]"),!t||!e.contains(t))break;s.push(t.dataset.cid)}for(let t=0;t<s.length;++t){let e=C.get(s[t]);if(!0!==e.locked){let i,o=e.type,l=A("li","","module"===o?e.getName():e.isSubCol?"Sub Column":o);if(0===t&&e.isEmpty)return;"subrow"===o||"row"===o?i=n-1:(i="module"===o?n=0:n,++n),l.className="lvl"+i,l.dataset.cid=s[t],0!==i&&(l.style.marginInlineStart=5*i+"px"),a.appendChild(l)}}a.tfOn(c,z,{passive:!0}).part="menu nested_menu",l.appendChild(a),o.Utils.addViewPortClass(a)}}},j=function(l){l.stopPropagation();const s=l.target.closest("[data-action],[part]");if(s){let n=C.get(this.host.closest("[data-cid]").dataset.cid),a=n.el,r=s.dataset.action||s.part.item(0);if("edit"===r||"styling"===r||"visibility"===r||"swap"===r)"edit"===r&&"module"===n.type&&this.querySelector(".swap")?.offsetParent&&(r="editBuilder"),n.edit(r);else if("add_col"===r){const t=new o.Column({},"subrow"===n.type);o.undoManager.start("move"),o.Drop.column(t.el,a,"right").then((()=>{o.undoManager.end("move")}))}else if("up"===r||"down"===r){const l="up"===r?a.previousElementSibling:a.nextElementSibling,s=_(p(i.querySelector(":root")).getPropertyValue("--tb_toolbar_h"));o.ActionBar.clear(),a.classList.add("tb_draggable_item"),o.undoManager.start("move"),"up"===r?l.before(a):l.after(a),t.trigger("tb_"+n.type+"_sort",[a]),o.undoManager.end("move"),a.classList.remove("tb_draggable_item"),o.Utils.scrollTo(a,2*s-e.scrollY,{behavior:"smooth"})}else n[r]&&n[r]("paste"===r?l.target.classList.contains("style"):l.target)}else l.target.hasAttribute("data-href")&&S(l.target,"click")};class L extends HTMLElement{connectedCallback(){const t=this.constructor.te.cloneNode(!0),e=t.querySelector(".dropdown"),i=this.constructor===M?this.parentNode.parentNode:null,o=i?.offsetWidth<220;!0===o&&(e.classList.add("tb_small_bar"),e.children[~~(e.childElementCount/2)].after(e.firstElementChild)),i?.classList.toggle("tb_small_bar",o),this.attachShadow({mode:"open"}).appendChild(t),e.tfOn("pointerover",I,{passive:!0}),this.shadowRoot.tfOn(c,j,{passive:!0})}disconnectedCallback(){const t=this.shadowRoot.tfOff(c,j,{passive:!0}).querySelector(".dropdown");t?.tfOff("pointerover",I,{passive:!0}).tfClass("nested_menu")[0]?.tfOff(c,z,{passive:!0}),k.remove("tb_nested_hover"),b?.classList.remove("tb_current_module"),b=null}}class M extends L{static te=v}customElements.define("tb-row-bar",class extends L{static te=f}),customElements.define("tb-column-bar",class extends L{static te=g}),customElements.define("tb-subrow-bar",class extends L{static te=w}),customElements.define("tb-module-bar",M),o.ActionBar={cid:null,disable:null,breadCrumbs:null,disablePosition:null,Ut(){const e=v.querySelector("style"),r=E(),_=f.querySelector("#module_row_grids_style"),p=f.querySelector("#module_form_fields_style"),b=new u(["move","pencil","settings","brush","layers","more","save","export","import","files","clipboard","eye","new-window","desktop","tablet","tablet","mobile","help","widgetized"]),h=d.head;r.appendChild(o.ToolBar.getBaseCss());const y=r.querySelectorAll("#tf_svg symbol");for(let t=y.length-1;t>-1;--t){let e=y[t].id.replace("tf-ti-","");b.has(e)||y[t].remove()}v.prepend(r.cloneNode(!0)),r.appendChild(e.cloneNode(!0)),f.prepend(r.cloneNode(!0)),g.prepend(r.cloneNode(!0)),r.appendChild(p.cloneNode(!0)),w.prepend(r,_.cloneNode(!0)),x?h.prepend(p.cloneNode(!0)):h.appendChild(p.cloneNode(!0)),!0!==o.isGSPage&&(this.breadCrumbs=A("ul","tb_action_breadcrumb"),t.on("themify_builder_ready",(()=>{const e=o.Builder.get().el;if(e.tfOn(c,(e=>{const i=e.target;if(o.isDocked&&i.classList.contains("tb_dragger"))return e.preventDefault(),e.stopPropagation(),void o.EdgeDrag.openLightBox(i);if(i.closest(".tb_visibility_hint,.tb_row_info")){const o=C.get(i.closest("[data-cid]").dataset.cid);i.closest(".tb_visibility_hint")?o.edit("visibility"):o.edit().then((i=>{const o=i.querySelector(".tb_field_group_css .tb_style_toggle.tb_closed");o&&t.triggerEvent(o,e.type)})).catch((()=>{}))}else this.yt(e)})).tfOn("pointerover",(t=>{t.stopPropagation(),s(this.req),a(this.timer),!0===t.isTrusted?this.req=l((()=>{this.timer=n((()=>{this.hover(t)}),0)})):this.hover(t)}),{passive:!0}),!t.isTouch&&(e.tfOn("pointerleave",(t=>{t.relatedTarget!==t.currentTarget.ownerDocument.body&&this.clear(),o.isVisual&&o.EdgeDrag.clearTimer(t.clientX,t.clientY)}),{passive:!0}).tfOn("dblclick",(e=>{const l=e.target,s=l.tagName;if(!i.activeElement.isContentEditable&&"INPUT"!==s&&"TEXTAREA"!==s)if("DIV"===s&&l.classList.contains("tb_dragger"))o.EdgeDrag.openLightBox(l);else if(!o.isDocked){const i=l.closest("[data-cid]");if(i){e.preventDefault();const o=C.get(i.dataset.cid),s=o.el.tfTag("tb-"+o.type+"-bar")[0];if(!0!==o.isEmpty)if(s){if(!s.contains(l)){const e=s.shadowRoot.querySelector(".edit");e&&t.triggerEvent(e,c)}}else this.yt(e)}}})),!m.disableShortcuts)){const t=x?null:i.tfId("tb_canvas_block");null===t?(i.tfOn("keydown",(t=>{this.actions(t)})),d.tfOn("keydown",(t=>{this.actions(t)}))):t.tfOn("keydown",(t=>{this.actions(t)}))}}),!0,o.is_builder_ready))},async actions(t){const e=t.target,l=e.tagName;if(!("INPUT"===l||"TEXTAREA"===l||i.activeElement.isContentEditable||o.LightBox.el.contains(e)||x&&o.activeModel?.el?.contains(i.activeElement))){const e=t.code,i=o.Builder.get().el.tfClass("tb_element_clicked");let l=i.length;if(l>0){let s=t.action,n=!0;if(s||("Delete"===e?s="delete":!0!==t.ctrlKey&&!0!==t.metaKey||("KeyC"===e?s="copy":"KeyD"===e?s="duplicate":"KeyV"===e&&(s="paste"))),s){"copy"===s?l=1:"paste"===s&&(n=!0===t.shiftKey),"function"==typeof t.preventDefault&&(t.preventDefault(),t.stopPropagation()),"delete"!==s&&"paste"!==s||await o.LightBox.save(),o.undoManager.start(s);const e=[];for(let t=l-1;t>-1;--t){let o=i[t].closest("[data-cid]");if(null!==o){let t=C.get(o.dataset.cid);t&&e.push(t[s](n,!0))}}"delete"===s&&this.clear();try{await r.all(e)}catch(t){}o.undoManager.end(s)}}}},columnDragers(t){let e=t.parentNode,i=o.Builder.get().el.querySelectorAll(".tb_hide_drag_left,.tb_hide_drag_right"),l=e.offsetLeft,s=o.isVisual?3:13;for(let t=i.length-1;t>-1;--t)i[t].classList.remove("tb_hide_drag_left","tb_hide_drag_right");l<=s&&e.classList.add("tb_hide_drag_left"),l+e.offsetWidth+s>=e.parentNode.offsetWidth&&e.classList.add("tb_hide_drag_right")},hover(t){const e=t.target;if(!0!==o.isPreview&&!k.contains("tb_start_animate")&&null===this.disable&&"tb_small_toolbar_root"!==e.id&&(o.isVisual&&(o.EdgeDrag.setTimer(e),o.EdgeDrag.clearTimer(t.clientX,t.clientY)),null===this.disablePosition)){const t=e.closest("[data-cid]");if(null===t||t.classList.contains("tb_active_layout_part"))this.clear();else{const l=t.dataset.cid,s=C.get(l);if(this.cid!==l){this.clear(),e.classList.contains("tb_grid_drag")&&this.columnDragers(e);const n="module"===s.type?t.querySelector(":scope > .tb_"+s.type+"_action"):e.classList.contains("tb_action_wrap")?e:null;if(n){this.cid=l;let e=s.get("mod_name"),a="tb_bar",r=i.createElement("tb-"+s.type+"-bar"),_=n.tfClass("tb_action_wrap")[0];if(!0===s.isEmpty)a+=" tb_disabled_module";else if(!0===s.isSubCol)a+=" tb_bar_sub_column";else if("row"===e)if(s.el.classList.contains("tb-page-break"))e="page_break";else{let e=t.parentNode,i=e.lastElementChild.previousElementSibling;while(!i.classList.contains("module_row"))i=i.previousElementSibling;t===e.firstElementChild&&(a+=" tb_row_first"),t===i&&(a+=" tb_row_last")}a+=" tb_bar_"+e,"desktop"!==o.activeBreakPoint&&(a+=" tb_bar_responsive_mode"),r.className=a,n.id="tb_component_bar",_?.replaceWith(r)||n.appendChild(r),o.Utils.addViewPortClass(r.shadowRoot.querySelector(".dropdown"))}o.isVisual&&o.EdgeDrag.addEdges(s)}}}},async yt(e){if(o.isPreview||!0===this.disable||null!==e.target.closest(".tb_disable_sorting,.tb_grid_drag"))return;const i=e.target,l=i.closest("[data-cid]");if(!l||-1!==i.tagName.indexOf("-")&&!i.closest(".module"))return;e.preventDefault();const s=C.get(l.dataset.cid);if(s&&!0!==s.isEmpty)if(!0===e.ctrlKey||!0===e.metaKey)l.classList.toggle("tb_element_clicked");else if(("dblclick"===e.type||o.isDocked)&&!l.classList.contains("tb_active_layout_part"))try{a(h);const e=o.activeModel?.id===s.id;await s.edit(),h=n((()=>{const l=i.closest(".tb_is_repeat");if(l){let i=l.dataset.swiperSlideIndex;if(i=""!==i&&i!==y?~~i:t.convert(l.parentNode.children).indexOf(l),!e&&i>0||e&&-1!==i){const t=o.LightBox.el.querySelector("#tb_lightbox_container"),l=t.tfClass("tb_repeatable_field")[i];l&&(e||(t.style.scrollBehavior="auto"),l.scrollIntoView(),t.style.scrollBehavior="")}}h=null}),e?5:20)}catch(e){}},clear(){if(!0!==this.disableClear){for(let t=o.Builder.get().el.querySelectorAll("#tb_component_bar"),e=t.length-1;e>-1;--e){let i=t[e].lastChild;t[e].removeAttribute("id"),"SVG"!==i.tagName&&i.remove()}this.cid=null}},clearClicked(){if(!0!==this.disableClear)for(let t=o.Builder.get().el.querySelectorAll(".tb_element_clicked,.tb_current_module"),e=t.length-1;e>-1;--e)t[e].classList.remove("tb_element_clicked","tb_current_module")}},t.on("tb_toolbar_loaded",(()=>{o.ActionBar.Ut()}),!0,!0===o.ToolBar?.isLoaded)})(tb_app,I,S),((o,n,a,r,d)=>{const{isFrontend:b,Registry:h,ActionBar:g,ToolBar:w}=o;o.Drag=_=>{if(!0===o.isGSPage)return;let f;_.tfOn("pointerdown",(t=>{if(0!==t.button||o.isPreview||t.target.closest(".tb_dragger,.tb_disable_sorting,.tb_editor_on"))f=null;else if(f=t.target,f.classList.contains("tb_grid_drag")){f=null;(new o.columnResize).start(t)}else 0===f.tagName.indexOf("TB-")&&(f=t.composedPath()[0],f.closest(".tab")&&(f=null))}),{passive:!0}).tfOn("dragstart",(function(_){if(!0===o.isPreview)return;if(!f||_.target.nodeType===Node.TEXT_NODE)return _.preventDefault(),void(f=null);let v=_.target.closest("[draggable]");if("desktop"!==o.activeBreakPoint&&v&&(v=v.closest(".module_column")),!v||"desktop"!==o.activeBreakPoint&&v.classList.contains("active_module"))return _.preventDefault(),void(f=null);let k=v.classList,C=k.contains("module_row"),S=C,T=!C&&k.contains("module_column");C||T||(C=k.contains("page_break_module")||k.contains("predesigned_row")||k.contains("tb_item_row")),f=null,_.stopImmediatePropagation();let z,I,E,j,L,M,R,N,D,P=null,O=C?"row":T?"column_move":k.contains("tb_grid")?"column":"module",B=[O],q=0,F=0,U=null,G=[w.el.getRootNode().host,d.tfId("tb_fixed_bottom_scroll")],H=o.Builder.get().el,X=[a],V=A("","tb_sortable_helper tf_box tf_overflow");const Y=t=>{D=l((()=>{let e=N*R;"tb_main_toolbar_root"!==t&&"wpadminbar"!==t||(e*=-1),M.scroll({top:(M.scrollY??M.scrollTop)+e,behavior:"instant"}),Y(t)}))},J=function(){clearInterval(L),R=5,L=setInterval((()=>{R<51?R+=5:(clearInterval(L),L=null)}),1200),E=null,null!==P&&(P.style.display="none");for(let t=H.querySelectorAll("[data-pos]"),e=t.length-1;e>-1;--e)t[e].removeAttribute("data-pos");null===U&&(U=!0,Y(this.id))},Q=()=>{clearInterval(L),s(D),U=L=R=D=null},K=t=>{if(!0===t){for(let t=G.length-1;t>-1;--t)G[t].tfOff("dragenter",J,{passive:!0}).tfOff("dragleave",Q,{passive:!0});return C&&o.isVisual&&w.zoom({item:w.el.querySelector('[data-zoom="100"]')}),Q(),void(G=N=M=null)}if(N=1,b||(M=w.el.getRootNode().host.closest(".interface-interface-skeleton__content")||i.tfClass("edit-post-layout__content")[0],N/=2),M||(M="desktop"===o.activeBreakPoint?e:x),M){C&&o.isVisual&&w.zoom({item:w.el.querySelector('[data-zoom="50"]')});for(let t=G.length-1;t>-1;--t)G[t].tfOn("dragenter",J,{passive:!0}).tfOn("dragleave",Q,{passive:!0})}},W=t=>{t.dataTransfer.dropEffect=t.dataTransfer.effectAllowed="none",E?.removeAttribute("data-pos"),null!==P&&(P.style.display="none")},Z=t=>{t.preventDefault(),t.stopImmediatePropagation();let{target:e,clientY:l,clientX:s}=t;if(z&&(z.style.top=l-I+"px"),!e||null!==U||e===v||!H.contains(e)||"module"===O&&e.classList.contains("module_row"))W(t);else if((null===P||e!==P&&!e.classList.contains("tb_sortable_placeholder"))&&(t.dataTransfer.effectAllowed="move",0===q||0===F||l-q>5||q-l>5||s-F>5||F-s>5)){q=l,F=s;const n=e.getBoundingClientRect();let a=(q-n.top)/n.height>.5?"bottom":"top";if(!0===T){let t,l=e.classList;if(l.contains("row_inner")||l.contains("module_subrow"))t=e,e=t.tfClass("module_column")[0],a=null;else if(l.contains("tb_col_side"))a=l[1].replace("tb_col_side_",""),e=e.parentNode,t=e.parentNode;else{if(!l.contains("module_column"))return;a=(F-n.left)/n.width>.5?"right":"left",t=e.parentNode}let s=t.dataset.dragW,r=e.dataset.dragArea;if(!s||!r){const e=p(t);if(!s){const o=t.closest("[data-cid]");if(!o)return;const l=t.offsetWidth;let n=h.get(o.dataset.cid).getSizes("gutter");n=n?ThemifyStyles.getGutterValue(n):"",n||(n=e.getPropertyValue("--colg"));let a=n.replace(""+c(n),"")||"%";n=c(n),s=0===n?"none":"%"===a?""+c(c(l*n/100).toFixed(2)):"em"===a?n*c(e.getPropertyValue("font-size")):n,t.dataset.dragW=s;for(let e=t.children,o=e.length-1;o>-1;--o)if(e[o].classList.contains("module_column"))for(let t=e[o].children,l=t.length-1;l>-1;--l){let e=t[l],o=e.style;if(e.classList.contains("tb_col_side")){o.marginLeft=o.marginRight="";let t=e.classList.contains("tb_col_side_right")?"50":"-50";o.width="none"===s?"":s+"px",o.transform="none"===s?"translateX("+t+"%)":"";let l=e.getBoundingClientRect().left;l<0?o.marginLeft="10px":l>=i.documentElement.clientWidth&&(o.marginRight="10px")}}}if(!r){if(r=e.getPropertyValue("--area"),r){r=r.split('" "');for(let t=r.length-1;t>-1;--t){let e=r[t].replaceAll('"',"").split(" ");e=Array.from(new u(e)),r[t]=e.join(" ")}r='"'+r.join('" "')+'"'}else r="1";t.dataset.dragArea=r}}if(null===a)return;if(l=e.classList,"1"!==r&&!l.contains("tb_drag_side_column")&&!l.contains("tb_drag_one_column")){const t=p(e).getPropertyValue("grid-area").split("/")[0].replace('"',"").trim();"desktop"===o.activeBreakPoint||r.includes(t+" ")||r.includes(" "+t)?l.add("tb_drag_side_column"):l.add("tb_drag_one_column")}l.contains("tb_drag_one_column")&&(a=(q-n.top)/n.height>.5?"right":"left")}if(e!==G[0]&&e!==G[1]){if(!z&&!1===T){const i=e.classList;if(i.contains("tb_active_builder"))e="top"===a?e.firstElementChild:e.lastElementChild.previousElementSibling;else{if(i.contains("module_column")){if(e=e.tfClass("tb_holder")[0],!e)return void W(t)}else i.contains("tb_dragger")&&(e=e.parentNode);if(e.classList.contains("tb_holder")&&e.childElementCount>0&&(e="top"===a&&e.firstChild!==v?e.firstChild:e.lastChild,e===v))return void W(t)}}if(E&&E!==e){if(!1===T){const t="top"===a?e.previousSibling:e.nextElementSibling;if(t===E){const e=t.dataset.pos;if("top"===a&&"bottom"===e||"bottom"===a&&"top"===e)return}}E.removeAttribute("data-pos")}e.dataset.pos!==a&&(e.dataset.pos=a,null!==P&&(P.style.display="",e.classList.contains("tb_holder")?e.appendChild(P):"top"===a?e.before(P):e.after(P))),E=e}}},tt=function(e){t.trigger("disableInline"),e.stopImmediatePropagation(),X.push(o.MainPanel.el,w.el.getRootNode().host);for(let t=X.length-1;t>-1;--t)X[t].classList.add("tb_start_animate","tb_drag_start","tb_drag_"+B[0]),B[1]&&X[t].classList.add(B[1]);if(o.SmallPanel.hide(),g.clear(),g.disable=!0,this.classList.add("tb_draggable_item"),!0===T){this.parentNode.classList.add("tb_column_drag_inner");const t=H.querySelectorAll(".row_inner,.module_subrow");for(let e=t.length-1;e>-1;--e){let i=t[e].children,o=t[e].getBoundingClientRect().width-5;for(let t=i.length-1;t>-1;--t)i[t].classList.contains("module_column")&&i[t].offsetWidth+i[t].offsetLeft<o&&i[t].classList.add("tb_hide_drag_col_right")}}K(),z&&(z.style.top=e.clientY+"px")},et=t=>{t.stopImmediatePropagation()},it=async l=>{l.target&&(l.preventDefault(),l.stopImmediatePropagation()),j=!0;let s=l.target||l;if(s.classList.contains("module_column")||s.classList.contains("tb_col_side"))s=T?s.closest(".module_column"):s.querySelector("[data-pos]");else if(T){s=null;for(let t=i.tfClass("tb_column_drag_inner"),e=t.length-1;e>-1;--e)t[e].classList.remove("tb_column_drag_inner")}else if(s.classList.contains("tb_active_builder")){const t=s.firstElementChild;s=t.dataset.pos?t:s.lastElementChild.previousElementSibling}else s.classList.contains("tb_dragger")&&(s=s.closest("[draggable]"));if((s===P||s.classList.contains("tb_sortable_placeholder"))&&(s=s?.closest(".tb_active_builder")?.querySelector("[data-pos]"),s?.classList.contains("tb_sortable_placeholder")&&(s=s.closest(".tb_holder"))),!s||"module"===O&&s.classList.contains("module_row"))return void v.classList.remove("tb_draggable_item");let n=null!==v.closest(".module_row"),a=n?v:v.cloneNode(!0),r=s.dataset.pos;if(P?.remove(),a===s)return void v.classList.remove("tb_draggable_item");o.undoManager.start("move"),v.classList.remove("tb_draggable_item");const _=o.isVisual?y:e.TB_BuilderContentLightbox?.getActiveEl()?.manager.get("mod_name");if(n){if(a.classList.contains("active_subrow")){const t=a.parentNode,e=t.classList;if(1===t.childElementCount&&(e.contains("tab-content")||e.contains("accordion-content"))){const e=A();t.prepend(e),o.Drop.row(e,"grid",1,!1)}}}else a.style.display="none";if(s.classList.contains("tb_holder"))s.appendChild(a);else if(!T){const t=s.parentNode.classList;if("module"!==O||!t.contains("tab-content")&&!t.contains("accordion-content")&&("accordion"!==_&&"tab"!==_||a.classList.contains("active_subrow")||s.closest(".module_subrow")))"top"===r?s.before(a):s.after(a);else{const t=new o.Subrow({cols:[{}]});t.el.tfClass("tb_holder")[0].appendChild(a),"top"===r?s.before(t.el):s.after(t.el)}}if(T||n)T&&await o.Drop.column(a,s,r),t.trigger("tb_"+O+"_sort",[a]),o.Utils.onResize(!0),o.undoManager.end("move");else{let e=k.contains("tb_grid")?"grid":k.contains("page_break_module")?"pagebreak":"predesign",i=v.dataset.slug,s="grid"===e?"row":O;v.dataset.type&&(e=v.dataset.type,"row"===s&&k.contains("library_item")&&(e="library"));try{await o.Drop[s](a,e,i),t.trigger("tb_"+O+"_sort",[a]),"module"===s&&"part"!==e&&"module"!==e?o.undoManager.clear("move"):o.undoManager.end("move")}catch(l){o.undoManager.clear("move")}}};if(k.contains("active_subrow")&&B.push("tb_drag_subrow"),S)if(r.add("tb_drag_row"),o.isVisual)V.innerHTML="Row";else{z=V.cloneNode(),V.style.opacity=0;const t=v.getBoundingClientRect();z.style.width=t.width+"px",z.style.left=t.left+"px",z.innerHTML="Row",n.appendChild(z),I=z.offsetHeight/2}else if("module"===O||T)if(T||k.contains("active_subrow"))V.innerHTML=T?"Column":"Subrow";else{const t=v.dataset.slug||h.get(v.dataset.cid).get("mod_name"),e=m.modules[t];if(e){const t=e.icon,i=A("span","tf_vmiddle",e.name);t&&V.appendChild(o.Helper.getIcon("ti-"+t)),V.appendChild(i)}}else if("column"===O)V.className+=" "+v.className,V.innerHTML=v.innerHTML;else if("row"===O&&(k.contains("page_break_module")||k.contains("predesigned_row"))){const t=k.contains("page_break_module")?"page_break_title":"predesigned_title";V.textContent=v.tfClass(t)[0].textContent}C&&(P=A("","tb_sortable_placeholder tf_rel tf_w")),V.style.top="-1000px",V.tfClass("add_module_btn")[0]?.remove(),n.appendChild(V),_.dataTransfer.effectAllowed="move",_.dataTransfer.setData("Text","id"),_.dataTransfer.setDragImage(V,V.offsetWidth/2+2,V.offsetHeight/2),v.tfOn("dragend",(function(t){if(t.stopImmediatePropagation(),n.tfOff("dragover",Z),H.tfOff(["dragenter","dragleave","pointermove","pointerover","pointerout","pointerenter","pointerleave","mousemove","mouseover","mouseout","mouseenter","mouseleave"],et,{passive:!0}).tfOff("drop",it,{once:!0}),this.tfOff("drag",tt,{once:!0,passive:!0}),!j){const t=H.querySelector("[data-pos]");t&&it(t)}g.disable=null,V.remove(),z?.remove(),P?.remove();for(let t=i.querySelectorAll("[data-drag-w],[data-drag-area],[data-pos]"),e=t.length-1;e>-1;--e)t[e].removeAttribute("data-pos"),t[e].removeAttribute("data-drag-w"),t[e].removeAttribute("data-drag-area");for(let t=i.querySelectorAll(".tb_hide_drag_col_right,.tb_drag_one_column,.tb_drag_side_column,.tb_column_drag_inner"),e=t.length-1;e>-1;--e)t[e].classList.remove("tb_hide_drag_col_right","tb_drag_one_column","tb_drag_side_column","tb_column_drag_inner");if(this.classList.remove("tb_draggable_item","tb_drag_one_column","tb_drag_side_column"),K(!0),!b)for(let t=i.tfClass("is-drop-target"),e=t.length-1;e>-1;--e)t[e].classList.remove("is-drop-target");for(let t=X.length-1;t>-1;--t)X[t].classList.remove("tb_start_animate","tb_drag_start","tb_drag_start_"+B[0],"tb_drag_"+B[0]),B[1]&&X[t].classList.remove(B[1]);P=j=f=v=k=E=V=z=I=H=F=q=B=O=T=X=null}),{once:!0,passive:!0}),b&&X.push(n);for(let t=X.length-1;t>-1;--t)X[t].classList.add("tb_drag_start_"+B[0]),B[1]&&X[t].classList.add(B[1]);v.tfOn("drag",tt,{once:!0,passive:!0}),n.tfOn("dragover",Z),H.tfOn("dragenter dragleave",et,{passive:!0}).tfOn("drop",it,{once:!0}),t.isTouch||H.tfOn(["pointermove","pointerover","pointerout","pointerenter","pointerleave","mousemove","mouseover","mouseout","mouseenter","mouseleave"],et,{passive:!0})}))},o.columnResize=class{start(e){let i,l=this,s=e.target,n=[],a=[],r=s.parentNode,d=r.parentNode,b=p(d),u=o.Utils.getColumns(d),m=u.length,g=d.offsetWidth,y=s.classList.contains("tb_drag_right")?"w":"e",w=t.isRTL?"w"===y?"e":"w":y,v=A("","tb_grid_drag_tooltip"),k=v.cloneNode(!1),x=p(r).getPropertyValue("grid-area").split("/")[0].replace('"',"").trim(),C=x&&"auto"!==x&&"initial"!==x&&"none"!==x?b.getPropertyValue("--area").replace(/[\r\n]/gm,"").replace(/ +/g," ").trim().split('" "'):"",S=b.getPropertyValue("column-gap"),T=c(S)||0,z=b.getPropertyValue("--col").replace(/\s\s+/g," ").trim(),I=100,E=0,j=0,L=0;if(t.trigger("disableInline"),"none"===z)z="";else if(z.includes("repeat"))if(z.includes("auto-fit")||z.includes("auto-fill"))z="";else{let t="",e=z.replace(/\s\,\s|\s\,|\,\s/g,",").replace(/\s\(\s|\s\(|\(\s/g,"(").replaceAll(" )",")").trim().split(" ");for(let i=0;i<e.length;++i)if(e[i].includes("repeat")){let o=e[i].split("(")[1].replace(")","").split(","),l=~~o[0],s=o[1].trim();isNaN(l)&&(s="1fr",l=m),t+=" "+(" "+s).repeat(l)}else t+=" "+e[i];z=t.trim()}if(C){let t=0;for(let e=C.length-1;e>-1;--e)if(C[e].includes(x)){let i=C[e].replace(/\s\s+/g," ").replaceAll('"',"").trim().split(" ");for(let o=i.length-1;o>-1;--o)i[o]===x&&(n.push(o),t=e);if(n.length>0)break}if(n.length>0){const e="w"===w?f.max.apply(null,n)+1:f.min.apply(null,n)-1,o=C[t].replace(/\s\s+/g," ").replaceAll('"',"").trim().split(" ")[e]?.trim();if(!o)return;for(let t=C.length-1;t>-1;--t)if(C[t].includes(o)){let e=C[t].replace(/\s\s+/g," ").replaceAll('"',"").trim().split(" ");for(let t=e.length-1;t>-1;--t)e[t]===o&&a.push(t);if(a.length>0)break}for(let t=u.length-1;t>-1;--t)if(r!==u[t]&&o===p(u[t]).getPropertyValue("grid-area").split("/")[0].replace('"',"").trim()){i=u[t];break}}const e=C[0].trim().split(" ").length;if(z){const t=e-z.split(" ").length;t>0&&(z+=" 1fr".repeat(t))}else z="1fr ".repeat(e).trim()}else{if(i="w"===w?r.previousElementSibling||r.nextElementSibling:r.nextElementSibling||r.previousElementSibling,!z){const t=[];for(let e=0;e<u.length;++e)t.push(u[e].getBoundingClientRect().width);const e=f.min.apply(null,t).toFixed(2);for(let i=t.length-1;i>-1;--i)t[i]=e===t[i].toFixed(2)?"1fr":(t[i]/e).toFixed(2)+"fr";z=t.join(" ")}const e=t.convert(u);n.push(e.indexOf(r)),a.push(e.indexOf(i))}z=z.split(" "),z[n[0]]||(n[0]%=z.length),z[a[0]]||(a[0]%=z.length);let M,R=z.length;S&&!S.includes("%")?S.includes("px")?(M=_(T),L=(R-1)*M):S.includes("em")&&(j=(R-1)*T,M=b.getPropertyValue("font-size")*T):(I-=(R-1)*T,M=g*(T/100));for(let t=R-1;t>-1;--t){let e=z[t];e.includes("fr")?E+=c(e):e.includes("%")?I-=c(e):e.includes("em")?j+=c(e):e.includes("px")&&(L+=c(e))}if(0!==j&&(j=c(b.getPropertyValue("font-size"))*j),s.classList.add("tb_drag_grid_current"),r.classList.add("tb_current_module"),"w"===w?(v.className+=" tb_grid_drag_right_tooltip",k.className+=" tb_grid_drag_left_tooltip"):(v.className+=" tb_grid_drag_left_tooltip",k.className+=" tb_grid_drag_right_tooltip"),r.style.willChange="width",i&&(i.style.willChange="width"),v.style.willChange=k.style.willChange="contents",l.tooltip1=v,l.tooltip2=k,l.cell=i,l.el=r,l.target=s,l.cols=z,l.dragIndexes=n,l.dragNextIndexes=a,l.fr1=c((c(g*I/100)-L-j)/E),l.row_inner=d,l.dir=y,l.isSame=h.get(d.closest("[data-cid]").dataset.cid).isLightboxOpen(),l.elComputed=p(r),l.cellComputed=p(i),l.gutterPX=M,e instanceof Event){e.stopPropagation(),l.startX=e.clientX;const t=t=>{t.stopImmediatePropagation(),l.drag(t.clientX)};s.tfOn("lostpointercapture",(e=>{e.stopImmediatePropagation(),s.tfOff("pointermove",t,{passive:!0}),l.end()}),{once:!0,passive:!0}).tfOn("pointermove",t,{passive:!0}).setPointerCapture(e.pointerId)}}drag(t){this.timer=l((()=>{let e=~~t-this.startX;this.startX=t,this.setValue(e)}))}setValue(t){const e=this;if(!0!==e.isDragged&&(e.isDragged=!0,g.clear(),o.undoManager.start("style"),e.target.append(e.tooltip1,e.tooltip2),r.add("tb_start_animate","tb_drag_grid_start")),0!==t){"e"===e.dir&&(t*=-1);let i=c(t/e.fr1);if(i){const{cols:t,dragIndexes:o,dragNextIndexes:l}=e,s=o.length,n=l.length;i=c(i/(s+n));let a=c(t[o[0]])+i,r=c(t[l[0]])-i;if(a>.001&&r>.001){let i=a.toFixed(3),c=r.toFixed(3);a=i+"fr",r=c+"fr";for(let e=s-1;e>-1;--e)t[o[e]]=a;for(let e=n-1;e>-1;--e)t[l[e]]=r;i*=s,c*=n,e.row_inner.style.setProperty("--col",t.join(" ")),e.tooltip1.textContent=i+"fr / "+_(e.elComputed.getPropertyValue("width"))+"px",e.cell&&(e.tooltip2.textContent=c+"fr / "+_(e.cellComputed.getPropertyValue("width"))+"px")}}}}end(){const e=this,{el:i,cell:n}=e;s(e.timer),l((()=>{if(e.tooltip1.remove(),e.tooltip2.remove(),g.clear(),i.classList.remove("tb_current_module"),e.target.classList.remove("tb_drag_grid_current"),i.style.willChange="",n&&(n.style.willChange=""),e.isDragged){r.remove("tb_start_animate","tb_drag_grid_start");const{row_inner:l,cols:s}=e,a=l.closest("[data-cid]");for(let t=s.length-1;t>-1;--t)s[t]=c(c(s[t]).toFixed(3).replace("0.","."))+"fr";h.get(a.dataset.cid).setCols({size:s.join(" ")}),l.style.setProperty("--col",""),o.Utils.setColumnsCount([i,n]),t.trigger("tb_grid_changed",a),o.Utils.onResize(!0),o.undoManager.end("style")}for(let t in e)e[t]=null}))}}})(tb_app,w,T,k,S),(e=>{e.Drop={async row(t,i,o,l){const s=async o=>{const l=E(),s=[],n=[],a=null===t.closest(".tb_holder");for(let t=0;t<o.length;++t){let r=!0===a?new e.Row(o[t]):new e.Subrow(o[t]);if(l.appendChild(r.el),s.push(r),e.isVisual&&"grid"!==i){n.push(r.id);for(let t=r.el.querySelectorAll("[data-cid]"),e=t.length-1;e>-1;--e)n.push(t[e].dataset.cid);"pagebreak"!==i&&(r.el.style.visibility="hidden")}}if(t.replaceWith(l),e.Builder.get().removeLayoutButton(),e.isVisual&&await e.bootstrap(n),"pagebreak"!==i){e.isVisual&&await e.correctColumnPaddings();for(let t=0;t<s.length;++t)e.Utils.setColumnsCount(s[t].el.tfClass("module_column")),e.Utils.runJs(s[t].el),s[t].el.style.visibility=""}else e.ModulePageBreak.countModules();"grid"!==i&&"pagebreak"!==i&&e.Spinner.showLoader("done")};if(!1!==l&&e.Utils.scrollTo(t),"library"===i||"predesign"===i){const t="library"===i?await this.Library.row(o):await e.preDesignedRows.get(o);await s(t)}else if("pagebreak"===i)await s(e.ModulePageBreak.cols());else{if("grid"!==i)throw"";await s(e.Utils.grid(o))}},async column(i,o,l){const s=i.parentNode,n=!o,a=!s,{activeBreakPoint:r,breakpointsReverse:_,Registry:d}=e,b=!0===a?null:d.get(s.closest("[data-cid]").dataset.cid),u=o?o.parentNode:s,h=d.get(u.closest("[data-cid]").dataset.cid),f=!0===(b?.isLightboxOpen()||!1)?ThemifyConstructor.grid.get():b?.get("sizes")||{},m="left"!==l&&o?o.nextElementSibling:o,g=p(i).getPropertyValue("grid-area").split("/")[0].replace('"',"").trim();if(s!==u){u.insertBefore(i,m);const t=u.classList.contains("module_subrow");if(i.classList.toggle("sub_column",t),i.classList.toggle("tb-column",!t),b&&(b.isSubCol=t),s&&!s.tfClass("module_column")[0]){const t=new e.Column({grid_class:"col-full"},s.classList.contains("module_subrow"));s.appendChild(t.el)}}else!0===n&&i.remove();const w=e.Utils.getColumns(u).length,v=s?e.Utils.getColumns(s).length:0,k=p(u),x=!1===n&&o?p(o).getPropertyValue("grid-area").split("/")[0].replaceAll('"',"").trim():null,C=t=>{if(!t.includes(" "))return k.getPropertyValue("--c"+t);if((t=t.replace(/\s\s+/g," ").trim()).includes("repeat")){if(t.includes("auto-fit")||t.includes("auto-fill"))return"";{let e="",i=t.replace(/\s\,\s|\s\,|\,\s/g,",").replace(/\s\(\s|\s\(|\(\s/g,"(").replaceAll(" )",")").trim().split(" ");for(let t=0;t<i.length;++t)if(i[t].includes("repeat")){let o=i[t].split("(")[1].replace(")","").split(","),l=~~o[0];e+=" "+(" "+o[1].trim()).repeat(l)}else e+=" "+i[t];t=e.trim()}}return t},S=(t,i)=>{const o=i.length,l=e.getColClass(),s=e.getColClassValues(),n=t&&!t.includes(" ")&&l[t]!==y?l[t]:l[o],a=s.length-1;for(let t=o-1;t>-1;--t){let e=i[t].classList;for(let t=a;t>-1;--t)e.remove(s[t]);n!==y&&o<7&&e.add(n[t]),e.remove("first","last")}o>1&&(i[0].classList.add("first"),i[o-1].classList.add("last"))};if(s===u&&!1===n&&!1===a)if("desktop"===r){const t={},o={},l=k.getPropertyValue("--area").replaceAll('"',"").trim().split(" "),n=e.Utils.getColumns(s),a=n.length;s.classList.remove("direction_rtl"),b.setSizes({dir:""});for(let e=a-1;e>-1;--e){let i=n[e].dataset.cid;i&&(t[i]=e+1)}let c=k.getPropertyValue("--col");if(s.insertBefore(i,m),c&&"unset"!==c&&"initial"!==c&&"none"!==c&&!c.includes("repeat")){const t=l.indexOf(g),e=p(i).getPropertyValue("grid-area").split("/")[0].replaceAll('"',"").trim(),o=l.indexOf(e);c=c.split(" ");const s=c[o];c[o]=c[t],c[t]=s,b.setCols({size:c.join(" ")},r)}for(let t=a-1;t>-1;--t){let e=n[t].dataset.cid;e&&(o[e]=t+1)}for(let e=_.length-2;e>-1;--e){let i=_[e],l=f[i+"_area"];if(l){l.includes('"')||(l=k.getPropertyValue("--area"+l).replace(/\s\s+/g," ").trim());for(let e in o)t[e]!==o[e]&&(l=l.replaceAll(t[e]+" ","#"+o[e]+"# ").replaceAll(t[e]+'"',"#"+o[e]+'#"'));b.setCols({area:l.replaceAll("#","")},i)}}S(c,n)}else{let e,i=k.getPropertyValue("--area").replace(/[\r\n]/gm,"").replace(/ +/g," ").trim(),o=k.getPropertyValue("--col"),s="right"===l?1:0,n="left",a=i.split('" "')[0].split(" ").length;i=i.replaceAll('"',"").trim().split(" ");let _=i.indexOf(x),c=i.indexOf(g),d=c,p=t.convert(i),b=i.length,u=[];if(d<_&&(n="right",s="right"===l?0:-1,d=i.lastIndexOf(g)),_+=s,e=i[_],"left"===n)for(let t=d-1;t>=_;--t){let e=i[t],o=i[t+1];if(e!==o)for(let l=t;l<b;++l)i[l]===o&&(i[l]="_"+e)}else for(let t=d+1;t<=_;++t){let e=i[t],o=i[t-1];if(e!==o)for(let l=0;l<t;++l)i[l]===o&&(i[l]="_"+e)}for(let t=b-1;t>-1;--t)"_"===i[t][0]?i[t]=i[t].substring(1):e===i[t]&&(i[t]=g);for(let t=0,e=b/a;t<e;++t)u.push('"'+i.slice(t*a,(t+1)*a).join(" ")+'"');u=u.join(" ");const f={area:u};if(o&&"unset"!==o&&"initial"!==o&&"none"!==o){const t=~~(c/a);if(~~(u.replaceAll('"',"").trim().split(" ").indexOf(g)/a)===t&&(o=C(o)?.split(" "),o)){const e=[],i=u.split('" "')[t].replaceAll('"',"").split(" ");p=p.slice(t*a,t*a+a);for(let t=0,l=i.length;t<l;++t){let l=p.indexOf(i[t]);e[t]=o[l],p.slice(l,1)}f.size=e.join(" ")}}h.setCols(f,r)}else{let o="1fr";if(!1===a){let t={},i={},l=[],n=f.desktop_size,a=~~g.replace("col","");for(let t=1;t<=v+1;++t)l[t-1]=t;n=n&&"1"!==n&&1!==n?C(n)?.split(" "):null;for(let t=l.length-1;t>-1;--t){let e=~~l[t];e===a?(n?.[t]!==y&&(o=n[t],n.splice(t,1)),l.splice(t,1)):(e>a&&--e,l[t]="col"+e)}if(o&&"1fr"!==o){let t=c(o),e=0;if(n&&t-1>.1){for(let i=n.length-1;i>-1;--i){let o=c(n[i]);(t>1&&o<1||t<1&&o>1)&&++e}if(e>0){let i=c(t/e);t<1&&(i*=-1);for(let e=n.length-1;e>-1;--e){let o=c(n[e]);(t>1&&o<1||t<1&&o>1)&&(n[e]=o+i+"fr")}}}}n=1!==v&&n?ThemifyStyles.getColSize(n.join(" "),!1):null,S(n,e.Utils.getColumns(s)),1===v?(l=null,i.gutter=t["--area"]=t["--colg"]=""):l='"'+l.join(" ")+'"',i.area=l,i.size=n,b.setCols(i),n||(t["--col"]=""),b.setGridCss(t),s.classList.remove("tb_col_count_"+(v+1)),s.classList.add("tb_col_count_"+v)}if(!1===n){let l=[],s={},n=h.getSizes("size","desktop");for(let t=1;t<w+1;++t)l[t-1]="col"+t;if(n||"1fr"===o||(n="1fr ".repeat(w).trim()),n)if(n=C(n),n){n=n.split(" ");let l=t.convert(e.Utils.getColumns(u)).indexOf(i);n.length<w?n.splice(l,0,o):n[l]=o,n=ThemifyStyles.getColSize(n.join(" "),!1)}else n=null;n||(s["--col"]=""),S(n,e.Utils.getColumns(u)),l='"'+l.join(" ")+'"',h.setCols({area:l,size:n}),h.setGridCss(s),u.classList.remove("tb_col_count_"+(w-1)),u.classList.add("tb_col_count_"+w),h.setMaxGutter()}for(let t=_.length-2;t>-1;--t){let e=_[t];if(!1===a){let t=b.getGridCss({size:"auto"},e);t["--area"]&&!t["--area"].includes(" ")?b.setCols({size:"auto"},e):(b.setGridCss({"--area":"","--col":""},e),b.setSizes({size:"auto"},e))}if(!1===n){let t=h.getGridCss({size:"auto"},e);t["--area"]&&!t["--area"].includes(" ")?h.setCols({size:"auto"},e):(h.setGridCss({"--area":"","--col":""},e),h.setSizes({size:"auto"},e)),h.setMaxGutter()}}}e.Utils.onResize(!0)},async module(t,i,o,l,s){if(!1!==l&&e.Utils.scrollTo(t),"part"===i||"module"===i)await this.Library.module(t,i,o);else try{const i=s||e.Module.getDefault(o),l=e.Module.initModule({mod_settings:i,mod_name:o});return l.is_new=!0,await l.edit(),t.replaceWith(l.el),e.isVisual&&"layout-part"!==o&&"overlay-content"!==o&&await l.visualPreview(i),l}catch(e){throw t.remove(),e}},Library:{async row(t){let i=await e.Library.get(t,"row");if(!Array.isArray(i)){i=Array(i);const t=e.GS.findUsedItems(i);t?.length&&(i[0].used_gs=t)}return i},async module(t,i,o,l){const s=await e.Library.get(o,i),n=e.Module.initModule(s);n.is_new=!0;try{return await n.edit(),t.replaceWith(n.el),e.isVisual&&(await e.bootstrap([n.id]),e.Utils.runJs(n.el,"module")),!1!==l&&e.Utils.scrollTo(n.el),e.Builder.get().removeLayoutButton(),n}catch(e){throw n.destroy(),t.remove(),e}}}}})(tb_app),((e,l,s)=>{const a=i.tfId("tb_global_styles_root").content;let _,c={};class p{constructor(t,i){let o=this,l=i.value;if(o.el=t,o.ee=t.tfClass("selected_wrap")[0],o.ie=t.tfClass("list")[0],o.oe=i,l){t.classList.remove("empty"),l=l.split(" ");let s="";for(let t=l.length-1;t>-1;--t)e.GS.styles[l[t]]!==y&&(s+=" "+l[t],o.le(l[t]));i.value=s.trim()}o.i()}i(){const i=this,o=i.el;o.tfClass("actions")[0].tfOn(l,(t=>{t.stopPropagation();const e=t.target.dataset.action;"insert"===e?i.Ut():"save"===e&&i.se()}),{passive:!0}),i.ee.tfOn(l,(t=>{const o=t.target.closest(".selected")?.dataset.id;o&&(t.target.closest(".delete")?i.H(o):t.target.closest(".edit")&&e.GS.gsEdit(o))})),i.ie.tfOn(l,(t=>{const e=t.target.closest(".item");e&&i.ne(e.dataset.id)})),o.querySelector("#search").tfOn("input",(t=>{const o=t.target.value.toUpperCase().trim(),l=t.target.closest(".form").tfClass("item"),s=()=>{let t=0===l.length;for(let e=l.length-1;e>-1;--e){let i=l[e].tfClass("title")[0];if(i){let s=""===o||i.innerHTML.toUpperCase().includes(o)?"":"none";!1===t&&""===s&&(t=!0),l[e].style.display=s}}i.ae(t)};_&&(_.abort(),_=null),""===o||c[o]!==y||e.GS.re?s():n((()=>{i._e(o).then(s).catch((t=>{}))}),100)}),{passive:!0}),o.tfClass("clear_search")[0].tfOn(l,(e=>{e.stopPropagation();const i=o.querySelector("#search");i.value="",i.focus(),t.triggerEvent(i,"input")}),{passive:!0}),o.parentNode.querySelector(".overlay").tfOn(l,(function(t){t.preventDefault(),t.stopPropagation(),this.remove()}),{once:!0})}ce(t){if(t.length>0){const i=E(),o=this,l=o.oe.value.split(" ");for(let s=0;s<t.length;++s){let n=t[s];if(!o.ie.querySelector('[data-id="'+n+'"]')){let t=e.GS.styles[n],o=A("","title"),s=A("",{"data-id":n,class:"item"+(l.includes(n)?" selected":"")});o.innerHTML=t.title,s.append(o,A("","type",t.type)),i.appendChild(s)}}o.ie.appendChild(i),o.de()}}le(t){const i=this,o=e.GS.styles[t],l=A("",{class:"selected","data-id":t}),s=A("span","edit"),n=A("span","tf_overflow");n.innerHTML=o.title,s.appendChild(e.Helper.getIcon("ti-pencil")),l.append(s,n,A("span","delete tf_close")),i.ie.querySelector('[data-id="'+t+'"]')?.classList.add("selected"),i.ee.appendChild(l),i.de()}async ne(t){const i=this;if(!i.ee.querySelector('[data-id="'+t+'"]')){i.le(t);let o=i.oe.value+" "+t;i.oe.value=o=o.trim(),i.ee.closest("#container").classList.remove("empty"),await e.GS.setGsStyle(o.split(" "))}}async H(t){const i=this;i.ie.querySelector('[data-id="'+t+'"]')?.classList.remove("selected"),i.ee.querySelector('[data-id="'+t+'"]')?.remove();let o=i.oe.value.trim().split(" ");o.splice(o.indexOf(t),1),o=o.join(" "),i.oe.value=o,""===o&&i.ee.closest("#container").classList.add("empty"),i.de(),await e.GS.setGsStyle(o.split(" "),!0)}Ut(){const t=this,i=t.el.querySelector(".form");if(!t.pe){t.pe=!0;const i=o.keys(e.GS.styles);t.ce(i),!0!==e.GS.re&&(i.length<10&&t._e(),t.be=t.ie.tfOn("scroll",(e=>{t.ue(e)}),{passive:!0}).tfClass("reload")[0],t.be.tfOn(l,(e=>{e.stopPropagation(),e.preventDefault(),t._e()})))}this.ae(),i.focus()}_e(t=""){const i=this.el.classList,l=[];if(i.contains("loading"))return r.reject();if(c[t]!==y)return r.resolve();for(let t in e.GS.styles)e.GS.styles[t].id!==y&&l.push(e.GS.styles[t].id);i.add("loading");const s={s:t,action:"tb_get_gs_posts",loaded:l};return _=new AbortController,e.LocalFetch(s,"json",{signal:_.signal}).then((i=>{this.ae(!0),e.GS.extend(i);const l=o.keys(i);t?c[t]=!0:(e.GS.re=l.length<10,e.GS.re&&(this.be.remove(),this.be=null)),this.ce(l)})).catch((()=>{})).finally((()=>{i.remove("loading")}))}async se(){const t=await e.LiteLightBox.prompt("enterGlobalStyleName");if("yes"===t?.[0]){const i=t[1];if(i){s.setStylingValues(e.activeBreakPoint);const t=e.Helper.cloneObject(e.Base.builderSave(s.values,"empty"));delete t[e.GS.key];const o={action:"tb_save_as_new_global_style",styles:t,title:i,type:e.activeModel.get("mod_name")};e.Spinner.showLoader();try{let t=await e.LocalFetch(o);if(e.Spinner.showLoader("hide"),"success"===t.status){const i=t.msg;t=t.post_data,await e.Utils.saveCss(e.Base.builderSave(t.data,"empty"),"",t.id),await TF_Notification.showHide("done",i),e.GS.styles[t.class]=t;const o=await e.LiteLightBox.confirm({msg:"addSavedGS"});o&&("yes"===o&&await s.resetStyling(e.activeModel),this.ce([t.class]),"yes"===o&&this.ne(t.class))}else e.LiteLightBox.alert(t.msg)}catch(t){e.Spinner.showLoader("error")}}else TF_Notification.showHide("error","enterGlobalStyleName"),this.se()}}ue(t){if(!1===e.GS.re){const e=t.target,i=f.max(e.scrollHeight-(e.scrollTop+e.offsetHeight),0);i>0&&i<=200&&this._e().catch((t=>{}))}}ae(t){t??=this.ie.tfClass("item")[0]!==y,this.ie.tfClass("no_gs")[0].classList.toggle("tf_hide",t)}de(){this.be?.classList.toggle("tf_hide",this.ie.scrollHeight>this.ie.clientHeight)}he(){_?.abort();for(let t in this)this[t]=null;_=null}}class b extends HTMLElement{disconnectedCallback(){this.el.he()}connectedCallback(){const t=a.cloneNode(!0),i=s.hidden.render({id:e.GS.key,is_responsive:!1,value:s.values[e.GS.key],control:!1},s);this.el=new p(t.querySelector("#container"),i),this.attachShadow({mode:"open"}).appendChild(t),this.before(i)}}customElements.define("tb-gs",b),e.GS={styles:{},el:null,activeGS:null,key:"global_styles",previousId:null,oe:null,fe:null,re:!1,init(){t.on("tb_toolbar_loaded",(()=>{const t=E();t.appendChild(e.ToolBar.getBaseCss()),a.prepend(t.cloneNode(!0))}),!0,!0===e.ToolBar?.isLoaded),!0===e.isGSPage?t.on("themify_builder_ready",(()=>{const t=()=>{this.openStylingPanel(),e.Registry.off(e.Builder.get(),"tb_init",t)};e.is_builder_ready?t():e.Registry.on(e.Builder.get(),"tb_init",t)}),!0,e.is_builder_ready):m.globalStyles&&(this.extend(m.globalStyles),m.globalStyles=null)},extend(t){for(let e in t)this.styles[e]===y&&t[e]!==y&&(this.styles[e]=t[e]);return this.styles},openStylingPanel(){let t,i=m.globalStyleData.type;switch(i){case"row":case"column":t="module_"+i;break;case"subrow":t="active_subrow";break;default:t="active_module";break}e.Registry.get(e.Builder.get().el.tfClass(t)[0].dataset.cid).edit("styling"),e.ToolBar.previewBuilder({item:e.ToolBar.el.tfClass("preview")[0]})},setCss(t,i,o){e.isVisual&&e.liveStylingInstance.setCss(t,i,o)},async createCss(t,i,l,s){ThemifyStyles.GS={},l||=e.Builder.get().id;const n=await ThemifyStyles.createCss(l,t,i,s,this.styles,y,s);if(!0===s&&o.keys(this.styles).length>0&&n.gs){n.gs.used="";for(let t in this.styles)n.gs.used+=""===n.gs.used?"":", ",n.gs.used+=this.styles[t].title}return n},findUsedItems(t){t=d.stringify(t);let e,i=/"global_styles":"(.*?)"/gm,o="";while(null!==(e=i.exec(t)))o+=" "+e[1].trim();if(e=null,o=o.trim(),""!==o){o=[...new u(o.split(" "))];const t=[];for(let e=o.length-1;e>-1;--e)this.styles[o[e]]!==y&&t.push(o[e]);return t}return!1},globalStylesHTML(){return!0!==e.isGSPage&&null===this.activeGS&&A("tb-gs")},updated(t,i,o,l){!1===e.isGSPage&&e.isVisual&&"module"!==l.type&&this.extraStyle(t,i,o,l)},async setImport(t,i,l){if(!0!==l)for(let e in t)this.styles[e]!==y&&delete t[e];if(o.keys(t).length>0){const o={action:"tb_import_gs_posts_ajax",data:d.stringify(t),onlySave:l?1:0};return e.LocalFetch(o).then((t=>{if(t)for(let e in t)this.styles[e]=t[e];return i}))}return i},async setGsStyle(t,i,o){if(!0===e.isGSPage||!e.isVisual)return;o??=e.activeModel;let l=o.get("mod_name"),n=o.id,a={styling:ThemifyStyles.generateGSstyles(t,l,this.styles),element_id:n};ThemifyStyles.disableNestedSel=!0,null===this.fe&&(this.fe=e.createStyleInstance(),this.fe.init(!0,!0,o));const r=await this.createCss([a],l),_=this.fe,c=[],d=e.activeBreakPoint,p=_.prefix,b=RegExp(p,"g");if(ThemifyStyles.disableNestedSel=null,!0===i){const t=s.breakpointsReverse;for(let i=t.length-1;i>-1;--i){e.activeBreakPoint=t[i],_.setMode(t[i],!0);let o=_.currentSheet,l=o.cssRules||o.rules;for(let t=l.length-1;t>-1;--t)if(l[t].selectorText.includes(p)){let e=l[t].selectorText.replace(/\,\s+/g,",").replace(b,"").split(","),i=l[t].cssText.split("{")[1].split(";");if(e[0].includes(".tb_text_wrap"))for(let t=e.length-1;t>0;--t)e[t].includes(".tb_text_wrap")&&e.splice(t,1);for(let t=i.length-2;t>-1;--t)_.setLiveStyle(i[t].trim().split(": ")[0].trim(),"",e)}}}delete r.gs;for(let t in r)if("fonts"===t||"cf_fonts"===t)for(let e in r[t]){let i=e;r[t][e].length>0&&(i+=":"+r[t][e].join(",")),c.push(i)}else{e.activeBreakPoint=t,_.setMode(t,!0);for(let e in r[t]){let i=e.replace(/\,\s+/g,",").replace(b,"").split(",");for(let o=0,l=r[t][e].length;o<l;++o){let l=r[t][e][o].split(";");for(let t=l.length-2;t>-1;--t)if(""!==l[t]){let e=l[t].split(":")[0],o=l[t].replace(e+":","").trim();"background-image"===e&&l[t].includes("svg")&&l[t].includes("data:")&&(o+=";"+l[t+1]),_.setLiveStyle(e,o,i)}}}}c.length>0&&s.font_select.loadGoogleFonts(c.join("|")),e.activeBreakPoint=d,this.updated(r,a,t,o),this.fe=null},async gsEdit(i){let o;null!==e.activeModel&&(this.previousId=e.activeModel.id);const l=this.styles[i],n=e.Helper.cloneObject(l.data[0]),a=l.type;this.activeGS=i,"row"===a?(delete n.cols,delete n.styling[this.key],o=new e.Row(n)):"subrow"===a?(delete n.cols,delete n.styling[this.key],o=new e.SubRow(n)):(delete n.styling,"column"===a?(delete n.cols[0].modules,delete n.cols[0].styling[this.key],o=new e.Column(n.cols[0])):(delete n.cols[0].styling,delete n.cols[0].modules[0].mod_settings[this.key],o=e.Module.initModule(n.cols[0].modules[0]))),e.LightBox.el.className+=" gs_post";try{const i=await o.edit("styling"),n=()=>{t.off("themify_builder_lightbox_close",n).off("themify_builder_save_component",r),i.classList.remove("gs_post"),e.isVisual||null===this.previousId||"row"!==a&&"column"!==a&&"subrow"!==a||"module"===e.Registry.get(this.previousId)?.type&&(e.liveStylingInstance.removeBgSlider(),e.liveStylingInstance.removeBgVideo(),e.liveStylingInstance.removeFrames(),e.liveStylingInstance.getComponentBgOverlay()?.remove(),e.liveStylingInstance.el.classList.remove("builder-zoom-scrolling","builder-zooming")),o.destroy(),this.reopenPreviousPanel(),this.activeGS=this.previousId=null},r=async t=>{const i=this.activeGS,o=this.styles[i];delete s.values.cid;const l=e.Helper.cloneObject(t);delete l[this.key],"row"===a||"subrow"===a?(o.data[0].styling=l,delete o.data[0].cols):(delete o.data[0].styling,delete o.data[0].cols[0].grid_class,"column"===a?(delete o.data[0].cols[0].modules,o.data[0].cols[0].styling=l):(delete o.data[0].cols[0].styling,o.data[0].cols[0].modules[0].mod_settings=l)),e.Spinner.showLoader();try{if(await e.Utils.saveCss(o.data,"",o.id),this.styles[i].data=o.data,e.isVisual){const t=e.Registry,o=t.items.keys();for(let e of o){let o=t.get(e)?.get("styling");o?.[this.key]?.includes(i)&&await this.setGsStyle(o[this.key].split(" "))}this.fe=null}await e.LocalFetch({action:"tb_update_global_style",bid:o.id,data:o.data}),e.Spinner.showLoader("done"),n()}catch(t){this.activeGS=this.previousId=null,e.Spinner.showLoader("error")}};i.tfClass("current")[0].tfClass("tb_tooltip")[0].innerHTML=g.g_s+" - "+l.title,t.on("themify_builder_lightbox_close",n,!0).on("themify_builder_save_component",r,!0)}catch(t){console.error(t)}},reopenPreviousPanel(t){null!==this.previousId&&(e.Registry.get(this.previousId)?.edit("styling"),this.previousId=null)},extraStyle(i,o,l,s){let n=this.fe||e.liveStylingInstance,a=n.prefix.length-1,r=null!==n.getComponentBgOverlay(s.type),_=n.el,c=r,d={top:!1,bottom:!1,left:!1,right:!1},p=0,b="builder-parallax-scrolling",u="builder-zoom-scrolling";t:for(let t in i)if("fonts"!==t&&"cf_fonts"!==t&&"gs"!==t)for(let e in i[t]){if(!1===c&&(c=e.includes("builder_row_cover",a)),e.includes("tb_row_frame",a))for(let t in d)if(!1===d[t]&&e.includes("tb_row_frame_"+t,a)){d[t]=!0,++p;break}if(!0===c&&4===p)break t}if(i=null,!1===r&&!0===c&&n.addOrRemoveComponentOverlay(),p>0){let t=E(),e=_.querySelector(":scope>.tb_row_frame_wrap");e||(e=A("span","tb_row_frame_wrap tf_overflow tf_abs"),_.tfClass("tb_"+s.type+"_action")[0].after(e));for(let i in d)!0!==d[i]||e.tfClass("tb_row_frame_"+i)[0]||t.appendChild(A("span","tf_abs tf_overflow tf_w tb_row_frame tb_row_frame_"+i));e.appendChild(t)}let h=o.styling!==y?o.styling.background_type||"image":"none";"image"===h&&o.styling.background_repeat===b&&o.styling.background_image?(_.classList.add(b),t.reRun(_,!0)):(_.classList.remove(b),_.style.backgroundPosition="","image"===h&&o.styling.background_repeat===u&&o.styling.background_image?(_.classList.add(u),t.reRun(_,!0)):(_.classList.remove(u),_.style.backgroundSize=""))},reset(){this.styles={},c={},this.re=!1}},e.GS.init()})(tb_app,I,ThemifyConstructor),((a,c,f,w,v,x,C,S)=>{const T=a.isFrontend;a.MainPanel=class{static size=null;static#t="tb_module_panel";static async initialize(){const e={},l=i.tfId("tb_main_panel_root"),s=l.firstElementChild,n=E();n.append(c.getBaseCss(),c.el.getRootNode().querySelector("#module_combine_style").cloneNode(!0)),s&&(l.attachShadow({mode:s.getAttribute("shadowrootmode")}).appendChild(s.content),s.remove()),l.shadowRoot.prepend(n),this.el=l.shadowRoot.tfId("main_panel");let r=1,_=m.favorite,d=m.modules,p=m.i18n.label,b=o.keys(d).sort(),u=new h;"object"!=typeof _||null===_||Array.isArray(_)||(_=o.values(_)),await a.jsModuleLoaded(),t.on("tb_toolbar_loaded",(()=>{for(let t=0;t<b.length;++t){let i=b[t];if("page-break"!==i){let t=A("","module module_"+i),o=A("span","favorite tb_disable_sorting"),l=A("span","module_name",d[i].name),s=A("button",{class:"tf_plus_icon add_module_btn tb_disable_sorting tf_rel",type:"button",title:p.add_module}),n=t.dataset,c=d[i].icon,b=_?.includes(i),h=a.Module.getModuleClassName(i);if(h){let _=h.getGroup();n.categories=_,!0===b&&(t.className+=" favorited"),s.dataset.type="module",n.slug=i,n.index=r++,t.draggable=!0,o.title=p.add_fv,o.appendChild(a.Helper.getIcon("ti-star")),c&&t.appendChild(a.Helper.getIcon("ti-"+c)),t.append(o,l,s);let d=!0===b?["favorite"]:_;for(let i=0;i<d.length;++i)e[d[i]]??=E(),e[d[i]].appendChild(t.cloneNode(!0))}else u.set(i,d[i].name||i)}}let t=this.el.tfClass("panel_category");for(let i=t.length-1;i>-1;--i){let o=t[i].dataset.category;o&&(y!==e[o]?t[i].appendChild(e[o]):t[i].parentNode.style.display="none")}u.size>0&&(a.isOld=!0,this.me(u)),T&&v.appendChild(l);try{if(!CSS.supports("container-type:inline-size")||!CSS.supports("selector(:has(*))"))throw""}catch(t){this.ge()}}),!0,!0===c?.isLoaded)}static init(){this.updateStorage(),a.isDocked?a.Dock.setDocked(!1):this.closeFloat(),this.Vt(),this.initClick(),this.initSearch(),a.jsModuleLoaded().then((()=>{n((()=>{a.Drag(this.el)}),1e3)})),this.el.getRootNode().host.classList.remove("tf_hide")}static tabs(e){const i=e.dataset.target;if(i){const o=e.closest(".panel"),l=o.tfClass(e.dataset.hide),s=o.tfClass(i),n=o.tfClass("tb_no_content")[0],a=o.tfClass("panel_search")[0],r=e.closest("li"),_=r.parentNode,c=_.children,d=_.parentNode.querySelector(":scope>.dropdown_label");for(let t=l.length-1;t>-1;--t)l[t].style.display="none";for(let t=s.length-1;t>-1;--t)s[t].style.display="",s[t].classList.remove("tf_hide");n?.classList.toggle("tf_hide",s.length>0);for(let t=c.length-1;t>-1;--t)c[t].classList.toggle("current",c[t]===r);a&&(a.value=""),d&&(d.textContent=e.textContent),t.triggerEvent(this.el,"tb_panel_tab_"+i),t.trigger("tb_panel_tab_"+i,o)}}static initClick(t){this.el.tfOn(f,(t=>{const e={".add_module_btn":"addComponent",".panel_close":"closeFloat",".minimize":"minimize",".nav_tab":"tabs",".favorite":"toggleFavoriteModule",".panel_title":"toggleAccordion"};for(let i in e)if(t.target.closest(i)){t.preventDefault(),t.stopPropagation(),this[e[i]](t.target);break}})).tfOn("tb_panel_tab_panel_rows",(()=>{this.rowPanel()}),{once:!0,passive:!0}).tfOn("tb_panel_tab_panel_library",(()=>{this.libraryPanel()}),{once:!0,passive:!0}).getRootNode().querySelector(".docked_min")?.tfOn(f,(t=>{t.stopPropagation(),this.dockMinimize()}),{passive:!0})}static async rowPanel(){const e=this.el.getRootNode().querySelectorAll("style");await r.all([t.loadJs(a.componentsURL+"predesigned-rows",!!a.preDesignedRows),t.loadCss(t.builder_url+"css/editor/components/predesigned-rows",null,null,e[e.length-3].nextElementSibling)]),new a.preDesignedRows(this.el.tfClass("predesigned_container")[0])}static async libraryPanel(){const e=this.el.getRootNode().querySelectorAll("style");await r.all([t.loadJs(a.componentsURL+"library",!!a.Library),t.loadCss(t.builder_url+"css/editor/components/library",null,null,e[e.length-3].nextElementSibling)]),new a.Library(this.el.tfClass("library_container")[0])}static toggleAccordion(t){t.closest(".panel_acc").classList.toggle("tb_collapsed")}static toggleFavoriteModule(t){const e=t.closest(".module"),i=e.dataset.slug;e.tfOn("transitionend",(function(t){this.classList.toggle("favorited");const e=this.dataset.categories.split(","),o=this.closest(".panel_modules_wrap"),s=o.querySelector('[data-category="favorite"]');if(this.classList.contains("favorited"))for(let t=e.length-1;t>-1;--t){let n=o.querySelector('[data-category="'+e[t]+'"]');if(n){let t=n.tfClass("module_"+i);for(let e=t.length-1;e>-1;--e)this!==t[e]?(t[e].remove(),0===n.childElementCount&&(n.parentNode.style.display="none")):(s.appendChild(this),0===n.childElementCount&&(n.parentNode.style.display="none"),l((()=>{l((()=>{s.parentNode.style.display=this.style.transform=this.style.opacity=""}))})))}}else{for(let t=e.length-1;t>-1;--t){let i=o.querySelector('[data-category="'+e[t]+'"]'),s=this.cloneNode(!0),n=~~s.dataset.index,a=null;if(i){while(0!=--n)if(a=i.querySelector('[data-index="'+n+'"]'),null!==a)break;a?.after(s)||i.prepend(s),i.parentNode.style.display="",l((()=>{l((()=>{s.style.transform=s.style.opacity=""}))}))}}this.remove(),0===s.tfClass("module").length&&(s.parentNode.style.display="none")}}),{passive:!0,once:!0}).style.opacity=0,e.style.transform="scale(.5)",a.LocalFetch({action:"tb_module_favorite",module_name:i,module_state:e.classList.contains("favorited")?0:1},"text")}static dockMinimize(){const e=S.tfClass("tb_workspace_container")[0],i=[v,this.el];a.activeModel&&i.push(a.LightBox.el),e.tfOn("transitionend",(function(){this.style.transition="",t.trigger("tb_resize_lightbox"),a.Utils.onResize(!0)}),{passive:!0,once:!0}).style.transition="width .3s";for(let t=i.length-1;t>-1;--t)i[t].classList.toggle("tb_dock_minimized")}static minimize(t){const e=this.el,i=e.classList;if(i.contains("is_minimized")){const t=this.Kt();e.style.height=t.height?t.height+"px":""}i.toggle("is_minimized")}static openFloat(t){const e=this.el,i=[c.el.classList,e.classList,k];for(let t=i.length-1;t>-1;--t)i[t].remove("tb_panel_closed");e.style.display="",a.SmallPanel.hide(),l((()=>{e.tfClass("panel_search")[0].focus()}))}static closeFloat(t){t&&a.Dock.set(!1);const e=this.el,i=[c.el.classList,e.classList,k];e.style.display="none";for(let t=i.length-1;t>-1;--t)i[t].add("tb_panel_closed")}static addComponent(t){const e=t.dataset.type,i=t.closest("[data-slug]")?.dataset.slug||"",o=this,l=o.el!==a.SmallPanel.el;"module"===e?o.newModule(i,l):"page_break"===e?o.newPageBreak(l):"row"===e?o.newGrid(i,l):"predesigned"===e&&o.newPredesign(i,l)}static newModule(t,e,i){const o=a.Builder.get(),l=A(),s=o.el.querySelector(".tb_column_btn_plus.clicked");if(s){const t=s.parentNode;t.classList.contains("module_column")?t.tfClass("tb_holder")[0].appendChild(l):t.parentNode.after(l)}else o.newRowAvailable(!0).el.tfClass("tb_holder")[0].appendChild(l);return a.SmallPanel.hide(),a.Drop.module(l,!1,t,e,i)}static newPageBreak(t){a.undoManager.start("move");let e=a.Builder.get(),i=A(),o=e.el.querySelector(".tb_column_btn_plus.clicked");if(o)o=o.closest(".module_row");else{const t=e.el.tfClass("module_row");o=t[t.length-1]}o.after(i),a.SmallPanel.hide(),a.Drop.row(i,"pagebreak",null,t).then((()=>{a.undoManager.end("move")}))}static newGrid(t,e){a.undoManager.start("move");let i=a.Builder.get(),o=A(),l=i.el.querySelector(".tb_column_btn_plus.clicked");if(l){const t=l.parentNode;t.classList.contains("module_column")?t.tfClass("tb_holder")[0].appendChild(o):t.parentNode.after(o)}else if(!1!==i.hasRows){for(let t=i.el.children,e=t.length-1;e>-1;--e)if(t[e].classList.contains("module_row")){l=t[e];break}l?l.after(o):i.el.prepend(o)}else i.el.tfClass("tb_holder")[0].appendChild(o);a.SmallPanel.hide(),a.Drop.row(o,"grid",t,e).then((()=>{a.undoManager.end("move")}))}static newPredesign(t,e){a.undoManager.start("move");let i=a.Builder.get(),o=A(),l=i.el.querySelector(".tb_column_btn_plus.clicked")?.closest(".module_row");if(!l){const t=i.el.tfClass("module_row");l=t[t.length-1]}l.after(o),a.SmallPanel.hide(),a.Drop.row(o,"predesign",t,e).then((()=>{a.undoManager.end("move")}))}static setResponsiveTabs(t){a.isDocked||(t??=this.getPanelClass(this.Kt().width),this.el.classList.add(t))}static getPanelClass(t){let e="tb_float_large";return t<=195?e="tb_float_xsmall":t<=270&&(e="tb_float_small"),e}static Vt(){const e=this,i=this.el.tfClass("drag_handle")[0];a.isDocked||this.setResponsiveTabs(),i.tfOn("pointerdown",(function(i){if(0===i.button){i.stopImmediatePropagation();let o,n=e.el,r=this.ownerDocument;n.style.willChange="transform";const _=i.clientX,d=i.clientY,p=n.getBoundingClientRect(),b=p.left-_,u=p.top-d,h=p.width,f=e=>{e.stopImmediatePropagation(),o=l((()=>{if(null!==n){const{clientX:i,clientY:o}=e,l=b+i;n.style.transform="translate("+l+"px,"+(u+o)+"px)",t.trigger("tb_panel_drag",[l,h])}}))},m=e=>{e.stopImmediatePropagation(),r.body.classList.add("tb_start_animate"),c.el.classList.add("tb_start_animate"),n.classList.add("tb_start_animate"),a.SmallPanel.hide(),t.trigger("tb_panel_drag_start")},g=function(i){i.stopImmediatePropagation(),s(o),this.tfOff("pointermove",m,{passive:!0,once:!0}).tfOff("pointermove",f,{passive:!0}).tfOff("lostpointercapture pointerup",g,{passive:!0,once:!0}),n.style.willChange="",t.trigger("tb_panel_drag_end"),e.updateStorage(),r.body.classList.remove("tb_start_animate"),c.el.classList.remove("tb_start_animate"),n.classList.remove("tb_start_animate"),o=n=r=null};this.tfOn("lostpointercapture pointerup",g,{passive:!0,once:!0}).tfOn("pointermove",m,{passive:!0,once:!0}).tfOn("pointermove",f,{passive:!0}).setPointerCapture(i.pointerId)}}),{passive:!0}),this.Yt()}static Yt(){const t=this,e=this.el.tfClass("tb_resizable");for(let i=e.length-1;i>-1;--i)e[i].tfOn("pointerdown",(function(e){if(0===e.button){e.stopImmediatePropagation();let i,o,n=this.ownerDocument,a=t.el;a.style.willChange="transform,width,height";const r=.9*n.documentElement.clientHeight,d=50,b=p(a),u=_(b.getPropertyValue("min-width")),h=_(b.getPropertyValue("max-width")),f=this.dataset.axis,m=~~a.offsetHeight,g=~~a.offsetWidth,{clientX:y,clientY:w}=e,v=()=>{c.el.classList.add("tb_start_animate"),a.classList.add("tb_start_animate"),n.body.classList.add("tb_start_animate")},k=e=>{e.stopImmediatePropagation(),o=l((()=>{let o;const{clientX:l,clientY:s}=e,n=new DOMMatrix(p(a).transform);if("w"===f)o=y+g-l,o>h&&(o=h),o>=u&&o<=h&&(n.m41+=_(a.style.width)-o,a.style.width=o+"px");else{const t="-y"===f||"ne"===f||"nw"===f?w+m-s:m+s-w;o="sw"===f||"nw"===f?y+g-l:g+l-y,o>h&&(o=h),("se"===f||"x"===f||"sw"===f||"nw"===f||"ne"===f)&&o>=u&&o<=h&&("sw"!==f&&"nw"!==f||(n.m41+=_(a.style.width)-o),a.style.width=o+"px"),("se"===f||"y"===f||"-y"===f||"sw"===f||"nw"===f||"ne"===f)&&t>=d&&t<=r&&("-y"!==f&&"nw"!==f&&"ne"!==f||(n.m42+=_(a.style.height)-t),a.style.height=t+"px")}if(a.style.transform="translate("+n.m41+"px,"+n.m42+"px)","y"!==f&&"-y"!==f){const e=t.getPanelClass(o);i!==e&&(i&&a.classList.remove(i),i=e,t.setResponsiveTabs(e))}}))},x=function(e){e.stopImmediatePropagation(),s(o),this.tfOff("pointermove",v,{passive:!0,once:!0}).tfOff("pointermove",k,{passive:!0}).tfOff("lostpointercapture pointerup",x,{passive:!0,once:!0}),a.style.willChange="",t.updateStorage(),n.body.classList.remove("tb_start_animate"),c.el.classList.remove("tb_start_animate"),a.classList.remove("tb_start_animate"),o=i=n=a=null};this.tfOn("pointermove",v,{passive:!0,once:!0}).tfOn("pointermove",k,{passive:!0}).tfOn("lostpointercapture pointerup",x,{passive:!0,once:!0}).setPointerCapture(e.pointerId)}}),{passive:!0})}static initSearch(){const e=this.el.tfClass("panel_search")[0];if(e){e.value="";e.parentNode.tfOn("input reset",(function(e){const i=this.tfClass("panel_search")[0],o=this.closest(".panel"),l=o.querySelector(".nav_tab .current").dataset.target,s="reset"===e.type?"":i.value.trim();let n,r,_,c;if("panel_modules_wrap"===l)n=o.tfClass("module"),_=!0;else if("panel_rows"===l&&a.preDesignedRows){n=o.tfClass("predesigned_row");const e=n[0].closest(".panel_tab").tfClass("dropdown_label")[0];e.dataset.active&&t.triggerEvent(e.nextElementSibling.firstElementChild,f)}else"panel_library"===l&&a.Library&&(n=o.tfClass("library_item"),r=n[0].closest(".panel_tab").querySelector(".library_tab .current").dataset.target,c=!0);if(n){const t=""===s,e=!t&&RegExp(s,"i"),i=_?".module_name":c?"":".predesigned_title",l=new u;for(let o=n.length-1;o>-1;--o){let s=""===i?n[o]:n[o].querySelector(i),a=t||e.test(s.textContent)?"":"none";if(r&&!n[o].classList.contains(r)&&(a="none"),""===a){let t=n[o].closest(".panel_category");t&&(t.parentNode.style.display="")}n[o].style.display=a,!0===_&&""===a&&l.add(n[o].parentNode)}if(o.classList.toggle("panel_searching",!t),_){n=o.tfClass("panel_category");for(let t=n.length-1;t>-1;--t)n[t].parentNode.style.display=l.has(n[t])?"":"none"}}}),{passive:!0}),t.isTouch||a.jsModuleLoaded().then((()=>{n((()=>{e.focus()}),800)}))}}static Kt(){const t=this;if(null===t.size){let e=b.getItem(t.#t);e=e?d.parse(e):{},t.size={top:50,left:10,width:140,height:600,...e}}return t.size}static updateStorage(){const t=this,e=t.el,i=e.style,l=i.transform,s=l?new DOMMatrix(l):null,n=e.tfClass("panel_top")[0].getBoundingClientRect(),r=C.innerHeight-n.height,c=C.innerWidth,p=t.Kt();let u={width:_(i.width),height:_(i.height)};return s&&(u.top=s.m42,u.left=s.m41),(u.height<=0||isNaN(u.height))&&delete u.height,(u.width<=0||isNaN(u.width))&&delete u.width,u={...p,...u},(u.left<0||u.left+n.width>c)&&(u.left=u.left<0?0:c-n.width),(u.top<0||u.top>r)&&(u.top=u.top<0?0:r),u.width&&(i.width=u.width+"px"),u.height&&(i.height=u.height+"px"),i.transform="translate("+u.left+"px,"+u.top+"px)",a.isDocked||p===u||""+o.entries(u)==""+o.entries(p)||(t.size=null,b.setItem(t.#t,d.stringify(u))),u}static me(e){const i={"themify-builder-pro":{title:"Themify Builder Pro",modules:["acf-repeater","ptb-repeater","add-to-cart","advanced-posts","advanced-products","archive-description","archive-image","archive-posts","archive-products","archive-title","author-info","breadcrumbs","cart-icon","comments","featured-image","post-content","post-meta","post-navigation","post-title","product-description","product-image","product-meta","product-price","product-rating","product-reviews","product-stock-status","product-taxonomy","product-title","related-posts","related-products","search-form","site-logo","site-tagline","stats","taxonomy","upsell-products","wc-notices","woocommerce-breadcrumb","woocommerce-hook","readtime"]},"builder-woocommerce":{title:"Builder WooCommerce",modules:["products","product-categories"]}},o=new u;for(let[t,l]of e){let e=!1;for(let l in i)if(i[l].modules.includes(t)){o.add(i[l].title),e=!0;break}!1===e&&o.add(l)}T?w.appendChild(A("","tb_old_addons tf_abs_t tf_w tf_h")):t.on("themify_builder_ready",(()=>{a.Builder.get().el?.classList.add("tb_old_addons")}),!0,a.is_builder_ready),this.el.classList.add("tb_old_addons"),c.el.classList.add("tb_old_addons"),TF_Notification.showHide("warning",g.update_addons.replaceAll("%addons%",[...o].join(", ")),1e4)}static ge(){let t,e,i=navigator.userAgent.toLowerCase(),o="";i.includes("firefox/")?o="Firefox":i.includes("opr/")?(o="Opera",e="opr"):i.includes("edg/")?(o="Edge",e="edg"):i.includes("samsungbrowser/")?(o="Samsung Browser",e="samsungbrowser"):i.includes("chrome/")?o="Chrome":i.includes("safari/")&&(o="Safari",t=(i.split("version/")[1]||i.split("safari/")[1]).split(" ")[0]),t||(e??=o.toLowerCase(),t=i.split(e+"/")[1]?.split(" ")[0]||""),TF_Notification.showHide("warning",g.update_browser.replaceAll("%browser%",o).replaceAll("%version%",t),1e4)}},a.SmallPanel=class extends a.MainPanel{static init(){const t=i.tfId("tb_small_panel_root"),e=t.firstElementChild,o=a.MainPanel.el.getRootNode().querySelectorAll("style,#tf_svg"),l=E();e&&(t.attachShadow({mode:e.getAttribute("shadowrootmode")}).appendChild(e.content),e.remove());for(let t=0,e=o.length;t<e;++t)"module_main_panel_style"!==o[t].id&&"tf_fonts_style"!==o[t].id&&l.appendChild(o[t].cloneNode(!0));t.shadowRoot.prepend(l),T||null===i.querySelector(".edit-post-layout__content")?w.appendChild(t):i.tfClass(".edit-post-layout__content").appendChild(t),this.el=t.shadowRoot.tfId("small_panel"),i.tfOn(f,(t=>{this.el.contains(t.target)||this.el.getRootNode().host.contains(t.target)||(t.target.closest(".tb_column_btn_plus")?(t.stopImmediatePropagation(),t.preventDefault(),this.show(t.target)):this.hide())})),this.initClick()}static show(e){if(x.contains("tb_standalone_lightbox")&&a.LightBox.close(),e.classList.contains("clicked"))return;if(w.style.willChange="scroll-position",0===this.el.childElementCount){const e=a.MainPanel.el.tfClass("nav_tab")[0].cloneNode(!0),i=a.MainPanel.el.tfClass("panel_container")[0].cloneNode(!0),o=E();o.append(e,i),this.el.appendChild(o);const l=i.tfClass("modules"),s=i.tfClass("predesigned_row"),n=this.el.tfClass("tb_compact_tabs"),r=this.el.tfClass("nav_tab");for(let t=s.length-1;t>-1;--t)s[t].remove();for(let t=l.length-1;t>-1;--t)l[t].style.display="";for(let t=n.length-1;t>-1;--t)n[t].classList.remove("tb_compact_tabs");for(let e=r.length-1;e>-1;--e)t.triggerEvent(r[e].firstElementChild,f);this.initSearch(),t.triggerEvent(this.el.tfClass("panel_search")[0],"input"),a.Drag(this.el),T&&S.tfOn(f,(t=>{this.el.contains(t.target)||this.el.getRootNode().host.contains(t.target)||this.hide()})),t.on("tfsmartresize",(()=>{this.position()}))}else t.isTouch||n((()=>{this.el.tfClass("panel_search")[0].focus()}),50);const i=this.el.getRootNode().host.classList;this.el.classList.toggle("tb_subrow_open",null!==e.parentNode.closest(".sub_column")),this.clear(),e.classList.add("clicked"),c.el.classList.add("tb_panel_dropdown_openend"),a.MainPanel.el.classList.add("tb_panel_dropdown_openend"),i.add("tf_hidden"),i.remove("tf_hide"),this.position(e),i.remove("tf_hidden"),t.trigger("disableInline"),w.style.willChange=""}static hide(t){if(this.el){const t=this.el.getRootNode().host;t.classList.contains("tf_hide")||(t.classList.add("tf_hide"),c.el.classList.remove("tb_panel_dropdown_openend"),a.MainPanel.el.classList.remove("tb_panel_dropdown_openend"),this.clear())}}static position(o){const l=o||a.Builder.get().el.querySelector(".clicked.tb_column_btn_plus");if(null!==l){l.style.display="block";const o=this.el,{offsetWidth:s,offsetHeight:n}=o,r=l.getBoundingClientRect(),_=T?null:i.tfClass("edit-post-layout__content")[0],c=i.documentElement.clientWidth;let d=r.left,p=r.top+e.scrollY;_?(p+=_.scrollTop-70,d=_.clientWidth/2):t.isRTL?d-=3:d+=r.width/2,d-=s/2,d=d<0?5:s+d>c?c-s:~~d,o.style.transform="translate("+d+"px,"+p+"px)",a.Utils.addViewPortClass(this.el),o.classList.contains("tb_touch_bottom")&&(o.style.transform="translate("+d+"px,"+(p-n)+"px)"),l.style.display=""}}static clear(){for(let t=a.Builder.get().el.querySelectorAll(".clicked.tb_column_btn_plus"),e=t.length-1;e>-1;--e)t[e].classList.remove("clicked")}},a.Dock={ye:"themify_builder_docked",init(){T&&(a.isDocked=b.getItem(this.ye),"true"===a.isDocked?(a.isDocked="true"===b.getItem("themify_builder_docked_left")?"left":"right",b.removeItem("themify_builder_docked_left"),this.set(a.isDocked)):"0"===a.isDocked?a.isDocked=!1:a.isDocked||(a.isDocked=t.isRTL?"right":"left")),t.on("tb_panel_drag_start",(()=>{if(!x.contains("tb_standalone_lightbox")){this.close();let e=(t,e)=>{T&&this.drag(t,e)};t.on("tb_panel_drag",e).on("tb_panel_drag_end",(()=>{if(t.off("tb_panel_drag",e),e=null,T)if(x.contains("tb_dock_highlight")){const t=x.contains("tb_dock_left_highlight")?"left":"right";x.remove("tb_dock_highlight","tb_dock_left_highlight"),this.set(t),this.setDocked()}else this.set(null)}),!0)}}))},set(t){T&&(a.isDocked=t,t?(b.setItem(this.ye,t),a.MainPanel.openFloat(!0)):(b.setItem(this.ye,0),b.removeItem("themify_builder_docked_left")))},setDocked(e){if(a.isDocked&&!x.contains("tb_panel_docked")){const i=a.MainPanel.el,o=a.LightBox.el,l=i.classList,s=S.tfClass("tb_workspace_container")[0],n=[l,c.el.classList,x,k];if(l.remove("is_minimized"),!1!==e){const t=function(){this.style.transition=""};s.tfOn("transitionend",(function(){t.call(this),a.Utils.onResize(!0)}),{passive:!0,once:!0}).style.setProperty("transition","width .3s","important"),0!==i.offsetHeight&&i.tfOn("transitionend",t,{passive:!0,once:!0}).style.setProperty("transition","height .3s","important"),0!==o.offsetHeight&&o.tfOn("transitionend",(function(){t.call(this),a.LightBox.setupLightboxSizeClass()}),{passive:!0,once:!0}).style.setProperty("transition","height .3s","important")}for(let t=n.length-1;t>-1;--t)n[t].remove("tb_panel_right_dock","tb_panel_left_dock"),n[t].add("tb_panel_docked","tb_panel_"+a.isDocked+"_dock");return l.remove("tb_float_xsmall","tb_float_small","tb_float_large"),o.classList.remove("tb_float_xsmall","tb_float_small","tb_float_large"),a.MainPanel.setResponsiveTabs(),t.trigger("tb_resize_lightbox"),!0}return!1},drag(t,e){if(!a.isDocked&&!x.contains("tb_standalone_lightbox")){if(t<0||t+20+e>C.innerWidth){const e=t<0?"left":"right";return x.add("tb_dock_highlight"),x.toggle("tb_dock_left_highlight","left"===e),e}x.remove("tb_dock_highlight","tb_dock_left_highlight")}return!1},close(e=!1){if(a.isDocked){!1!==e&&"right"===a.isDocked&&(S.tfClass("tb_workspace_container")[0].tfOn("transitionend",(function(){this.style.transition="",a.Utils.onResize(!0)}),{passive:!0,once:!0}).style.transition="width .3s");for(let t=[c.el.classList,a.MainPanel.el.classList,x,k],e=t.length-1;e>-1;--e)t[e].remove("tb_panel_docked","tb_panel_left_dock","tb_panel_right_dock");!1!==e&&"right"===a.isDocked||a.Utils.onResize(!0),this.set(null),t.trigger("tb_resize_lightbox"),a.MainPanel.setResponsiveTabs()}}},t.on("tb_toolbar_style_ready",(()=>{a.MainPanel.initialize(),a.Dock.init()}),!0,!!c?.el).on("tb_toolbar_loaded",(()=>{a.MainPanel.init(),a.SmallPanel.init()}),!0,!0===c?.isLoaded)})(tb_app,tb_app.ToolBar,I,w,T,z,x,S),((e,l,s)=>{e.undoManager=class{static#o=[];isWorking=!1;isDisabled=!1;stack=[];state=new h;index=-1;btnUndo;btnRedo;compactBtn;#l;#s;constructor(o,n,a){const r=e.ToolBar.el,_=this.constructor.get(0)===y;if(this.btnUndo=o,this.btnRedo=n,this.compactBtn=a,_&&r.contains(o))r.tfClass("menu_undo")[0].tfOn(s,(t=>{if(t.target!==this.compactBtn){t.preventDefault(),t.stopPropagation();const e=t.target.closest(".undo_redo");null===e||e.classList.contains("disabled")||this.constructor.doChange(e.classList.contains("undo"))}}));else for(let t=[o,n],e=t.length-1;e>-1;--e)t[e].tfOn(s,(t=>{t.stopPropagation(),this.constructor.doChange(t.target.classList.contains("undo"))}));!_||t.isTouch||m.disableShortcuts||(l.tfOn("keydown auxclick",(t=>{this.constructor.keypres(t)})),e.isFrontend&&i.tfOn("keydown auxclick",(t=>{this.constructor.keypres(t)}))),this.constructor.#o.push(this)}hasUndo(){return this.index>-1}hasRedo(){return this.index<this.stack.length-1}destroy(){for(let t=this.constructor.#o,e=t.length-1;e>-1;--e)if(t[e]===this){t.splice(e,1);break}this.stack=this.state=this.btnUndo=this.btnRedo=this.compactBtn=null,this.constructor.updateUndoBtns()}static get(t){return t??=this.#o.length-1,this.#o[t]}static setActive(t){for(let e=this.#o,i=e.length-1,o=i;o>-1;--o)if(e[o]===t){[e[o],e[i]]=[e[i],e[o]];break}}static start(t,e){const i=this.get();if(!0===this.has(t))return console.warn("UndoManager:"+t+" is already started"),!1;i.#s=t,i.#l=e,i.state.set(t,this.getCurrentState(t,e))}static end(e){const i=this.get();if(e??=i.#s,!1===this.has(e))return console.warn("UndoManager:"+e+" isn`t started"),!1;t.trigger("tb_undo_add",e);const l=this.getDiff(e,this.getState(e),this.getCurrentState(e,i.#l));o.keys(l).length>0&&this.push(l),i.state.delete(e),i.#s=i.#l=null}static getCurrentState(t){const i={},o={builder:e.Helper.cloneObject(e.Builder.get().toJSON(!1))},l=e.breakpointsReverse;for(let t=l.length-1;t>-1;--t){let e=l[t],o=ThemifyStyles.getSheet(e).cssRules,s=ThemifyStyles.getSheet(e,!0).cssRules;i[e]={st:{},gs:{}};for(let t=o.length-1;t>-1;--t)i[e].st[o[t].selectorText]=o[t].style.cssText;for(let t=s.length-1;t>-1;--t)i[e].gs[s[t].selectorText]=s[t].style.cssText}return o.style=i,o}static getState(t){return this.get().state.get(t)}static has(t){return!!this.get().state.has(t)}static clear(t){const e=this.get();t===e.#s&&(e.#s=null),e.state.delete(t),e.#l=null}static hasRedo(){return this.get().hasRedo()}static hasUndo(){return this.get().hasUndo()}static disable(){const t=this.get();t.isDisabled=!0,t.btnUndo.classList.add("disabled"),t.btnRedo.classList.add("disabled"),t.compactBtn?.classList.add("disabled")}static enable(){this.get().isDisabled=!1,this.updateUndoBtns()}static update(t){const i=this.get();!0===t?--i.index:++i.index,this.updateUndoBtns(),e.ModulePageBreak.countModules()}static updateUndoBtns(){const t=this.get();if(!0!==t.isDisabled){const e=t.hasUndo(),i=t.hasRedo();t.btnUndo.classList.toggle("disabled",!e),t.btnRedo.classList.toggle("disabled",!i),t.compactBtn?.classList.toggle("disabled",!(e||i))}}static reset(){const t=this.get();t.stack=[],t.state.clear(),t.index=-1,this.updateUndoBtns()}static push(i){const o=this.get();o.stack.splice(o.index+1,o.stack.length-o.index),o.stack.push(i),o.index=o.stack.length-1,this.updateUndoBtns(),t.trigger("add_undo"),e.Builder.get().isSaved=!1}static async doChange(t){const e=this.get();!1===e.isWorking&&!1===e.isDisabled&&(e.isWorking=!0,await this.changes(t),e.isWorking=!1)}static getDiff(t,i,l){const s=i.builder,n=l.builder,a=new h,r=new u;for(let i=0;i<s.length;++i){let o=s[i],l=n[i],_=o.element_id;if(n[i]?.element_id===_)e.Helper.compareObject(o,l)&&a.set(_,{old:o,new:l});else{let l=!1;for(let i=n.length-1;i>-1;--i)if(n[i].element_id===_){if("delete"===t&&e.Helper.compareObject(o,n[i]))a.set(_,{old:o,new:n[i]});else if("move"===t&&n.length===s.length&&!a.has("sort")){let t=[],e=[];for(let e=0;e<s.length;++e)t.push(s[e].element_id);for(let t=0;t<n.length;++t)e.push(n[t].element_id);a.set("sort",{old:t,new:e})}l=!0;break}l||a.set(_,{old:o,index:i})}r.add(_)}if(n.length>s.length)for(let t=0;t<n.length;++t){let e=n[t],i=e.element_id;r.has(i)||a.set(i,{new:e,index:t})}r.clear();let _=i.style,c=l.style,d={},p=t=>{const e={};for(let i=(t=t.split("; ")).length-1;i>-1;--i){let o=t[i].indexOf(":"),l=t[i].substring(0,o);e[l]=t[i].substring(o+1).trim();let s=e[l].length;if(";"===e[l][s-1])e[l]=e[l].slice(0,-1);else if('"'===e[l][s-1]&&";"===e[l][s-2]){let t=s-2;e[l]=e[l].substring(0,t)+e[l].substring(t+1)}}return e},b=(t,e)=>{let i={old:{},new:{}};for(let o in t)if(e[o]!==y){if(e[o]!==t[o]){let l=p(t[o]),s=p(e[o]);for(let t in l)if(s[t]!==l[t]){let e=l[t].trim(),n=s[t]?.trim()??"";n!==e&&(i.old[o]??={},i.new[o]??={},i.old[o][t]=e,i.new[o][t]=n)}for(let t in s)l[t]===y&&(i.old[o]??={},i.new[o]??={},i.old[o][t]="",i.new[o][t]=s[t].trim())}}else i.old[o]=p(t[o]),i.new[o]="";for(let o in e)t[o]===y&&(i.new[o]=p(e[o]),i.old[o]="");return 0===o.keys(i.old).length&&delete i.old,0===o.keys(i.new).length&&delete i.new,i};for(let t in _)if(c[t]!==y){let e=b(_[t].st,c[t].st),i=b(_[t].gs,c[t].gs);o.keys(e).length>0&&(d[t]={st:e}),o.keys(i).length>0&&(d[t]={gs:i})}for(let t in c)if(_[t]===y){let e=b({},c[t].st),i=b({},c[t].gs);o.keys(e).length>0&&(d[t]={st:e}),o.keys(i).length>0&&(d[t]={gs:i})}l=c=_=null;const f={};return o.keys(d).length>0&&(f.styles=d),a.size>0&&(f.html=a),(f.html||f.styles)&&(f.type=t),f}static keypres(t){const o=this.get();if(!1===o.isWorking&&!1===o.isDisabled&&(3===t.button||4===t.button||!0===t.ctrlKey||!0===t.metaKey)){const o=i.activeElement.tagName,s=l.activeElement.tagName,n=t.code;"INPUT"===o||"TEXTAREA"===o||"INPUT"===s||"TEXTAREA"===s||e.LightBox.el.contains(t.target)||("KeyY"===n||4===t.button||"KeyZ"===n&&!0===t.shiftKey?this.hasRedo()&&(t.preventDefault(),this.changes(!1)):"KeyZ"!==n&&3!==t.button||!this.hasUndo()||(t.preventDefault(),this.changes(!0)))}}static async changes(t){if(e.ActionBar.clearClicked(),null!==e.activeModel&&(!e.isVisual||!i.activeElement.isContentEditable&&e.activeModel.el.contains(i.activeElement)))return await e.LightBox.save(),this.changes(t);const o=this.get(),l=o.stack[o.index+(!0===t?0:1)];if(l!==y){const e=!0===t?"old":"new";l.html&&await this.domChanges(l.html,e,l.type),l.styles&&this.styleChanges(l.styles,e,!l.html),this.update(t)}}static styleChanges(t,o,l){const s=new u;for(let i in t)for(let n in t[i]){let a=ThemifyStyles.getSheet(i,"gs"===n),r=a.cssRules;for(let _ in t[i][n][o]){let c=t[i][n][o][_],d=e.Utils.findCssRule(r,_);if(""!==c)if(!1===d||r[d]===y){let t="";for(let e in c)t+=e+":"+c[e]+";";a.insertRule(_+"{"+t+";}",r.length)}else for(let t in c){let e=c[t].trim(),i=""!==e&&e.includes("!important")?"important":"";""!==i&&(e=e.replace("!important","").trim()),r[d].style.setProperty(t,e,i)}else!1!==d&&r[d]!==y&&a.deleteRule(d);!0===l&&s.add(_)}}if(s.size>0)for(let t of s){let o=i.querySelector(t);o&&e.Utils.runJs(o)}}static async domChanges(t,i,o){let l,s=e.Builder.get().el,n=new u,a=new u,r=e.Registry,_=t.get("sort")?.[i],c=e.activeModel,d=c?.id,p=c?.type,b=t=>{for(let i=t.length-1;i>-1;--i){let o=t[i],s=o.mod_settings;if(o.element_id===d){ThemifyConstructor.setStylingValues(e.activeBreakPoint);let t={...e.Helper.cloneObject(ThemifyConstructor.values),...e.Forms.serialize("tb_options_setting",!0)};return"column"!==p&&(t={...t,...e.Forms.serialize("tb_options_animation",!0),...e.Forms.serialize("tb_options_visibility",!0)}),"module"===p?o.mod_settings=t:("column"!==p&&(l={...o.sizes}),o.styling=t),!0}if(o.cols?.length>0&&b(o.cols)||o.modules?.length>0&&b(o.modules))return;if(s){let t=s.content_accordion||s.tab_content_tab;if(t)for(let e=t.length-1;e>-1;--e)t[e].builder_content&&b(t[e].builder_content)}}};if(_)for(let t=0;t<_.length;++t){let e=s.querySelector('[data-cid="'+_[t]+'"]');0===t?s.prepend(e):s.querySelectorAll(":scope>.module_row")[t-1].after(e)}for(let[o,l]of t)if("sort"!==o){let t=l[i];if(t!==y){let i=t;d&&(i=e.Helper.cloneObject(i),b([i]));let _=l.index,c=r.get(o)?.el,p=new e.Row(i);n.add(o);for(let t=p.el.querySelectorAll("[data-cid]"),e=t.length-1;e>-1;--e)n.add(t[e].dataset.cid);_!==y?0===_?s.prepend(p.el):s.querySelectorAll(":scope>.module_row")[_-1].after(p.el):c?.replaceWith(p.el),a.add(p.el)}else r.remove(o)}if(n.size>0){if(e.isVisual){await e.bootstrap(n.keys(),y,!1);for(let t of a)e.Utils.runJs(t,"row")}d&&n.has(d)&&(e.activeModel=r.get(d),e.isVisual&&(e.liveStylingInstance.el=e.activeModel.el,e.liveStylingInstance.model=e.activeModel),l&&(ThemifyConstructor.grid.set(l),l=null),b=d=null)}}},t.on("tb_toolbar_loaded",(()=>{const t=e.ToolBar.el;new e.undoManager(t.tfClass("undo")[0],t.tfClass("redo")[0],t.tfClass("compact_undo")[0])}),!0,!0===e.ToolBar?.isLoaded)})(tb_app,S,I),(($,e,a,r)=>{$.ThemifyGradient=function(b,u){const h={gradient:$.ThemifyGradient.default,width:173,height:15,point:8,angle:180,circle:!1,type:"linear",onChange(){},onInit(){}},m=$(b);let y,w,v,k,x,C,S,T=[];return this.isInit=!1,this.initSwatchesFlag=!1,this.settings={},this.we=function(){return this.settings={...h,...u},this.update(),this.settings.onInit(),this.isInit=!0,this},this.updateSettings=function(t){return this.settings={...h,...t},this.update(),this},this.update=function(){this.ve(),this.ke(),this.xe()},this.getCSSvalue=function(){const t=[],e="radial"===this.settings.type?this.settings.circle?"circle,":"":this.settings.angle+"deg,";for(let e=0;e<T.length;++e)t.push(T[e][1]+" "+T[e][0]);return this.settings.type+"-gradient("+e+t.join(", ")+")"},this.getString=()=>{let t="";for(let e=0;e<T.length;++e)t+=T[e][0]+" "+T[e][1]+"|";return t.substr(0,t.length-1)},this.setType=function(t){this.settings.type=t,this.settings.onChange(this.getString(),this.getCSSvalue())},this.setAngle=function(t){this.settings.angle=t,this.settings.onChange(this.getString(),this.getCSSvalue())},this.setRadialCircle=function(t){this.settings.circle=t,this.settings.onChange(this.getString(),this.getCSSvalue())},this.ve=function(){T=[],T=Array.isArray(this.settings.gradient)?this.settings.gradient:this.Ce(this.settings.gradient)},this.ke=function(){const t=this,i=E(),o=A("",{class:"themifyGradient tf_rel",tabindex:-1}),l=A("","gradient-pointer-info"),s=A(),a=b.tfClass("themifyGradient")[0];x=A("a",{href:"#",class:"gradient-point-delete tf_close"}),v=A("","point-color"),k=A("input",{type:"text",class:"point-position"}),y=A("","points"),w=A("","content");let r=A("canvas",{width:t.settings.width,height:t.settings.height});s.style.backgroundColor="#00ff00",v.appendChild(s),w.append(v,A("span","gradient_delimiter"),k,A("span","gradient_percent","%"),x),l.append(A("","gradient-pointer-arrow"),w),i.append(y,r,l),o.appendChild(i),a&&a.remove(),b.prepend(o),b.tfClass("tb_gradient_swatches")[0]||(b.appendChild(this.swatchesHTML()),this.initSwatches()),w=$(w),v=$(v),k=$(k),x=$(x),y=$(y),C=r.getContext("2d"),r=$(r),r.off("click").on("click",(function(i){const o=$(this).offset();let l="rgba(0,0,0, 1)",s=999999999999,a=i.pageX-o.left;a=f.round(100*a/t.settings.width);for(let t=0;t<T.length;++t)T[t][0]=_(T[t][0]),T[t][0]<a&&a-T[t][0]<s?(s=a-T[t][0],l=T[t][1]):T[t][0]>a&&T[t][0]-a<s&&(s=T[t][0]-a,l=T[t][1]);T.push([a+"%",l]),T.sort(t.Se),t.xe();for(let e=0;e<T.length;++e)T[e][0]===a+"%"&&t.Te(y.find(".point:eq("+e+")")[0]);e.isFrontend&&n(t.ze,315)})),this.pointEvents()},this.pointEvents=function(){const t=this;w[0].tfOn("focusout keyup",(t=>{const e=t.target;if(e.classList.contains("point-position")){let i=_(e.value.trim());isNaN(i)?i=0:i<0?i=f.abs(i):i>=98&&(i=98),"focusout"!==t.type?(i=f.round(i*this.settings.width/100),$(e).closest(".themifyGradient").find(".themify_current_point").css("left",i),this.Ie()):e.value=i}}),{passive:!1}),y[0].tfOn("keyup",(t=>{"Delete"===t.code&&"INPUT"!==i.activeElement.tagName&&(k.focus(),this.removePoint(t))}),{passive:!1}).tfOn(r,(t=>{t.target.classList.contains("point")&&(this.Te(t.target),e.isFrontend&&this.ze())}),{passive:!0}).tfOn("pointerdown",(function(e){if(0===e.button&&e.target.classList.contains("point")){let i;e.stopImmediatePropagation();const o=e.target,n=t=>{b.focus(),o.classList.add("tb_gradient_drag_point"),a.add("tb_start_animate","tb_move_drag","tb_gradient_drag")},r=t.settings.width,_=c(p(o).getPropertyValue("margin-left"))||0,d=o.offsetLeft-e.clientX,u=e=>{e.stopImmediatePropagation(),i=l((()=>{let i=d+e.clientX-_;i>r?i=r:i<0&&(i=0),o.style.left=i+"px",t.Te(o,!0),t.Ie()}))},h=function(t){i&&s(i),t.stopImmediatePropagation(),this.tfOff("pointermove",n,{passive:!0,once:!0}).tfOff("pointermove",u,{passive:!0}).tfOff("lostpointercapture pointerup",h,{passive:!0,once:!0}),a.remove("tb_start_animate","tb_move_drag","tb_gradient_drag"),this.classList.remove("tb_gradient_drag_point"),b.focus(),i=null};o.tfOn("lostpointercapture pointerup",h,{passive:!0,once:!0}).tfOn("pointermove",n,{passive:!0,once:!0}).tfOn("pointermove",u,{passive:!0}).setPointerCapture(e.pointerId)}}),{passive:!0})},this.xe=function(){this.Ee(),this.Ie()},this.ze=()=>{const t=$(e.LightBox.el),i=w.find(".tfminicolors"),o=i.find(".tfminicolors-panel");o.length>0&&(t.offset().left+t.width()<=o.offset().left+o.width()?i.addClass("tb_minicolors_right"):i.removeClass("tb_minicolors_right"))},this.Ee=function(){const t=E();for(let e=0,i=T.length;e<i;++e){let i=A("","point");i.style.backgroundColor=T[e][1],i.style.left=_(T[e][0])*this.settings.width/100+"px",t.appendChild(i)}y[0].replaceChildren(t)},this.hexToRgb=t=>{t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,((t,e,i,o)=>e+e+i+i+o+o));const e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);return e?{r:_(e[1],16),g:_(e[2],16),b:_(e[3],16)}:null},this.Te=function(t,e){if(!t)return;const i=this;let o=_(t.style.left);if(k.val(f.round(o/this.settings.width*100)),o-=30,o<0&&a.contains("tb_module_panel_docked")&&(o=3),w[0].parentNode.style.marginLeft=o+"px",e)return!1;m.focus(),S=$(t),S.addClass("themify_current_point").siblings().removeClass("themify_current_point");let l=S.css("backgroundColor");m.find(".point-color .tfminicolors").remove();let s=v.find(".themify-color-picker");0===s.length&&(s=$('<input type="text" class="themify-color-picker" />'),s.appendTo(v).tfminicolors({opacity:!0,changeDelay:10,change(t,e){let o=i.hexToRgb(t);o||(o={r:255,g:255,b:255},e=1),S.css("backgroundColor","rgba("+o.r+","+o.g+","+o.b+","+e+")"),i.Ie()}}),m.find(".tfminicolors").first().addClass("tfminicolors-focus"),x.off("click").on("click",this.removePoint.bind(this)));let n=l.replace(/^rgba?\(|\s+|\)$/g,"").split(","),r=4===n.length?n.pop():1;n=this.Ae(n),s.val(n).attr("data-opacity",r).data("opacity",r).tfminicolors("settings",{value:n})},this.Ie=function(){const t=y[0].tfClass("point");T=[];for(let e=0;e<t.length;++e){let i=f.round(_(t[e].style.left)/this.settings.width*100);T.push([i+"%",t[e].style.backgroundColor])}T.sort(this.Se),this.je(),this.isInit&&this.settings.onChange(this.getString(),this.getCSSvalue())},this.je=function(){const t=C.createLinearGradient(0,0,this.settings.width,0);for(let e=0;e<T.length;++e)t.addColorStop(_(T[e][0])/100,T[e][1]);C.clearRect(0,0,this.settings.width,this.settings.height),C.fillStyle=t,C.fillRect(0,0,this.settings.width,this.settings.height)},this.Ce=t=>{const e=[],i=t.split("|");for(let t=0,o=i.length;t<o;++t){let o,l=i[t],s=l.indexOf("%"),n=l.substr(s-3,s);"100"===n||"100%"===n?o="100%":s>1?(o=_(l.substr(s-2,s)),o+="%"):(o=_(l.substr(s-1,s)),o+="%"),e.push([o,l.replace(o,"")])}return e},this.Ae=t=>{const e=t[1],i=t[2],o=t=>(t=_(t,10),isNaN(t)?"00":(t=f.max(0,f.min(t,255)),"0123456789ABCDEF".charAt((t-t%16)/16)+"0123456789ABCDEF".charAt(t%16)));return"#"+o(t[0])+o(e)+o(i)},this.Se=(t,e)=>(t=_(t[0]))<(e=_(e[0]))?-1:t>e?1:0,this.removePoint=function(t){if(t.preventDefault(),T.length>1){T.splice(S.index(),1);const t=w[0].parentNode;t.style.display="none",n((()=>{t.style.display=""}),50),this.xe()}},this.swatchesHTML=function(){const t=E(),i=A("",{class:"tf_cm_dropdown_icon",tabindex:-1}),o=A("ul","tb_gradient_swatches tf_scrollbar tf_w"),l=themifyColorManager.makeImportExportDropdown(),s=A("button",{class:"tb_gradient_add_swatch tf_plus_icon",type:"button"});return s.tfOn(r,this.saveSwatch.bind(this)).appendChild(A("span","themify_tooltip",g.save_gradient)),l.tfOn(r,(t=>{this.swatchesDropdownClicked(t)})),i.append(A("span","themify_tooltip",g.ie_gradient),e.Helper.getIcon("ti-import"),l),o.tfOn(r,(t=>{this.swatchClicked(t)})),t.append(s,i,o),t},this.swatchesDropdownClicked=t=>{t.preventDefault(),t.stopPropagation();const e=t.target,i=e.classList;i.contains("tb_cm_export")?(e.parentNode.parentNode.parentNode.blur(),themifyColorManager.exportColors("gradients")):i.contains("tb_cm_import")&&(e.parentNode.parentNode.parentNode.blur(),themifyColorManager.importColors("gradients"))},this.saveSwatch=function(){if(""===this.getString()||""===this.getCSSvalue())return!1;const t=o.keys(themifyCM.gradients),e=this.getCSSvalue();for(let i=t.length-1;i>-1;--i)if(themifyCM.gradients[t[i]].css===e)return null;const i=themifyColorManager.UID(),l={id:i,setting:d.parse(d.stringify(this.settings)),gradient:this.getString(),css:e,points:T};themifyCM.gradients[i]=l,this.addSwatch(l),themifyColorManager.updateColorSwatches("gradients")},this.addSwatch=(t,i)=>{const o=A("li",{class:"tb_gradient_swatch","data-id":t.id});if(o.style.background=t.css,o.appendChild(A("span","tf_delete_swatch tf_close")),i){const t=b.parentElement.tfClass("tb_gradient_swatches")[0];t.insertBefore(o,t.firstChild)}else{const t=e.LightBox.el.tfClass("tb_gradient_swatches");for(let e=0;e<t.length;++e)t[e].insertBefore(o.cloneNode(!0),t[e].firstChild)}},this.swatchClicked=function(t){t.preventDefault();const e=t.target,i=e.classList;i.contains("tb_gradient_swatch")?this.selectSwatch(e.dataset.id):i.contains("tf_delete_swatch")&&(this.removeSwatch(e.parentNode.dataset.id),themifyColorManager.updateColorSwatches("gradients"))},this.removeSwatch=t=>{const i=e.LightBox.el.querySelectorAll('.tb_gradient_swatch[data-id="'+t+'"]');for(let t=i.length-1;t>-1;--t)i[t].remove();delete themifyCM.gradients[t]},this.selectSwatch=function(e){const i=themifyCM.gradients[e];this.setAngle(i.setting.angle),this.setRadialCircle(i.setting.circle),this.setType(i.setting.type),this.settings.gradient=i.gradient,this.update();const o=b.parentElement,l=o.tfClass("themify-gradient-type")[0],s=o.querySelector('input[type="checkbox"]'),n=o.tfClass("tb_angle_input")[0];l.value=i.setting.type,t.triggerEvent(l,"change"),s.checked=i.setting.circle,t.triggerEvent(s,"change"),n.value=i.setting.angle,t.triggerEvent(n,"change")},this.initSwatches=function(){const t=o.keys(themifyCM.gradients),e=t.length;themifyCM.gradients=e>0?themifyCM.gradients:{};for(let i=0;i<e;++i)this.addSwatch(themifyCM.gradients[t[i]],!0)},this.we()},$.ThemifyGradient.default="0% rgba(0,0,0, 1)|100% rgba(255,255,255,1)",$.fn.ThemifyGradient=function(t){return this.each((function(){$(this).data("themifyGradient")===y&&$(this).data("themifyGradient",new $.ThemifyGradient(this,t))}))}})(jQuery,tb_app,k,I),((t,e)=>{t.Spinner={el:e.tfClass("tb_loader")[0],showLoader(t="show"){return new r((e=>{const i=this.el,o=i.classList;"spinhide"===t?(o.add("tf_hide"),o.remove("tf_opacity","tb_done","tb_error","tb_show"),e()):o.contains("tb_"+t)?e():(o.remove("tf_hide","tf_opacity","tb_done","tb_error","tb_show"),"show"!==t?("error"!==t&&(t="done"),o.add("tb_"+t),l((()=>{if(o.contains("tb_"+t)){const l=function(){o.remove("tb_"+t,"tf_opacity"),o.add("tf_hide"),this.tfOff("transitioncancel transitionend",l,{passive:!0,once:!0}),e()};i.tfOn("transitionend transitioncancel",l,{passive:!0,once:!0}),o.add("tf_opacity")}}))):(o.add("tb_show"),e()))}))}}})(tb_app,S)})(jQuery,Themify,window,document,Object,requestAnimationFrame,cancelAnimationFrame,setTimeout,clearTimeout,Promise,parseInt,parseFloat,JSON,getComputedStyle,localStorage,Set,Map,Math,themifyBuilder,themifyBuilder.i18n.label);