(($,e,t,n)=>{"use strict";const r=new Set;let i=null;const s=new IntersectionObserver((e=>{let t=!1;e.forEach((e=>{const n=e.target;e.isIntersecting?r.has(n)||(r.add(n),a(n),t=!0):r.delete(n)})),t&&l()}),{threshold:0}),o=()=>{0!==r.size?(r.forEach(a),i=requestAnimationFrame(o)):i=null},a=t=>{if(!t.t)return;const{effect:n,startPercent:r,position:i,range:s,cornerRadius:o,minSize:a,maxSize:l,dir:u}=t.t,c=(t=>{const n=t.getBoundingClientRect(),r=e.h;return(r-n.top)/r*100})(t);let d=(c-r)/s;d=Math.max(a/100,Math.min(l/100,d));let f="",p=100*d;if("sw"===n)f="r"===u?`inset(0 0 0 ${100-p}% round ${o})`:"t"===u?`inset(0 0 ${100-p}% 0 round ${o})`:"b"===u?`inset(${100-p}% 0 0 0 round ${o})`:`inset(0 ${100-p}% 0 0 round ${o})`;else if("sp"===n){let e;void 0===u?(e=50-50*d,f=`inset(0 ${e}% 0 ${e}% round ${o})`):"hc"===u?(e=50*d,f=`inset(0 ${e}% 0 ${e}% round ${o})`):"vo"===u?(e=50-50*d,f=`inset(${e}% 0 ${e}% 0 round ${o})`):"vc"===u&&(e=50*d,f=`inset(${e}% 0 ${e}% 0 round ${o})`)}else if("c"===n){const e=t.getBoundingClientRect(),n=Math.max(e.width,e.height);f=`circle(${"o"===u?Math.max(0,(1-d)*n):d*n}px at ${i})`}else if("r"===n){const e="o"===u?100*(1-d):100*d,[t,n]=i.split(" ").map((e=>parseFloat(e)));f=`inset(${n-e}% ${100-(t+e)}% ${100-(n+e)}% ${t-e}% round ${o})`}t.style.clipPath!==f&&(t.style.clipPath=f)},l=()=>{!i&&r.size>0&&(i=requestAnimationFrame(o))},u=e=>{const t=(e=>{const t=e.dataset.tb_clip;if(!t)return null;const n=t.split(",").map((e=>e.trim()));if(n.length<3)return null;const[r,i,s,o,a]=n,l=parseFloat(i),u=parseFloat(s),c=e.dataset.tb_dir;return isNaN(l)||isNaN(u)||l>=u?null:{effect:r,startPercent:l,position:(e.dataset.tb_clip_pos||"50% 50%").split(",").map((e=>e.trim()+"%")).join(" "),range:u-l,cornerRadius:e.dataset.tb_clip_br,minSize:o,maxSize:a,dir:c}})(e);t&&(e.t=t,e.style.willChange="clip-path",s.observe(e))};e.on("builder_load_module_partial",((t,n)=>{if(!0===n&&!t.dataset.tb_clip)return;const r=e.selectWithParent("[data-tb_clip]",t);if(r){for(let e=r.length-1;e>-1;--e)u(r[e]);l()}}))})(jQuery,Themify,window);