(()=>{"use strict";var t={5338:(t,e,r)=>{var o=r(5795);e.H=o.createRoot,o.hydrateRoot},5795:t=>{t.exports=window.ReactDOM}},e={};const r=window.React;var o=function r(o){var a=e[o];if(void 0!==a)return a.exports;var n=e[o]={exports:{}};return t[o](n,n.exports,r),n.exports}(5338);const a=({attributes:t})=>{const{emoji:e,height:o,align:a,emojiSize:n,density:i,animationStyle:s}=t,c=(0,r.useRef)(null);(0,r.useEffect)((()=>{if(c.current){const t=setTimeout((()=>{l(c.current,e,o,n,i)}),50);return()=>clearTimeout(t)}}),[e,o,a,n,i]);const l=(t,e,r,o,a)=>{t.innerHTML="";const n=(t=>{const e={small:{fontSize:2.5,overlap:-1},medium:{fontSize:3.75,overlap:-1.4},large:{fontSize:5,overlap:-1.8},xlarge:{fontSize:6.5,overlap:-2.3}};return e[t]||e.medium})(o),i=(t=>{const e={sparse:{overlapFactor:.5,rowMargin:-2,emojisExtra:2},normal:{overlapFactor:.65,rowMargin:-3,emojisExtra:4},dense:{overlapFactor:.75,rowMargin:-3.5,emojisExtra:6}};return e[t]||e.normal})(a),s=t.offsetWidth,c=Math.ceil(s/(60*i.overlapFactor))+i.emojisExtra;for(let r=0;r<4;r++){const o=document.createElement("div");o.className="b-blocks-emoji-stack-iemoji-row",r>0&&(o.style.marginTop=`${i.rowMargin}rem`);for(let t=0;t<c;t++){const r=document.createElement("span");r.textContent=e,r.className="b-blocks-emoji-stack-item";const a=60*Math.random()-30,i=20*Math.random()-10;r.style.fontSize=`${n.fontSize}rem`,r.style.marginRight=`${n.overlap}rem`,r.style.setProperty("--b-blocks-emoji-stack-separator-rotation",`${a}deg`),r.style.setProperty("--b-blocks-emoji-stack-separator-index",t),r.style.transform=`rotate(${a}deg) translateY(${i}px)`,o.appendChild(r)}t.appendChild(o)}};return(0,r.createElement)("div",{className:"b-blocks-emoji-stack-separator-container "+(s?`b-blocks-emoji-stack-separator-animation-${s}`:"")},(0,r.createElement)("div",{ref:c,className:"b-blocks-emoji-stack-container"}))},n="linear-gradient(135deg, #0040E3, #18D4FD)",i=(t,e,r=!1)=>{return null==(o=e)||""===o||Array.isArray(o)&&0===o.length||"object"==typeof o&&0===Object.keys(o).length||"string"==typeof o&&""===o.trim()||"number"==typeof o&&0===o?"":`${t}: ${e}${r?" !important":""};`;var o},s=(t,e=!0,r=!0,o=!0)=>{const{type:a="solid",color:s="",gradient:c=n,image:l={},position:m="center center",attachment:d="",repeat:p="no-repeat",size:u="",overlayColor:b=""}=t||{};return"gradient"===a&&r?i("background",c):"image"===a&&o?`background: url(${l?.url});\n\t\t\t\t${i("background-color",b)}\n\t\t\t\t${i("background-position",m)}\n\t\t\t\t${i("background-size",u)}\n\t\t\t\t${i("background-repeat",p)}\n\t\t\t\t${i("background-attachment",d)}\n\t\t\t\t${i("background-repeat",p)}\n\t\t\t\tbackground-blend-mode: overlay;`:e&&i("background",s)},c=t=>{if(!t)return"";const e=t=>{const{color:e="#000000",style:r="solid",width:o="0px"}=t;return`${o} ${r} ${e}`};return"object"!=typeof t||Array.isArray(t)?"":t.hasOwnProperty("top")||t.hasOwnProperty("right")||t.hasOwnProperty("bottom")||t.hasOwnProperty("left")?["top","right","bottom","left"].map((r=>t[r]?`border-${r}: ${e(t[r])};`:"")).join(" ").trim():i("border",e(t))},l=t=>{if(!t)return"";if("string"==typeof t)return t;if("object"==typeof t&&!Array.isArray(t)){const e=["top","right","bottom","left"];return e.map((e=>t[e]||"")).every((t=>!t))?"":e.map((e=>t[e]||"0")).join(" ")}return""},m=({attributes:t,id:e})=>{const{background:o,height:a,padding:n,margin:m,border:d,borderRadius:p}=t,u=`#${e} .b-blocks-emoji-stack-separator-container`;return(0,r.createElement)("style",{dangerouslySetInnerHTML:{__html:`\n            ${u}{\n                ${s(o)}\n                ${i("height",a)}\n                ${i("padding",l(n))}\n                ${i("margin",l(m))}\n                ${c(d)}\n                ${i("border-radius",l(p))}\n            }\n        `}})};document.addEventListener("DOMContentLoaded",(()=>{document.querySelectorAll(".wp-block-b-blocks-emoji-stack-separator").forEach((t=>{let e={};try{const r=t.dataset.attributes;r&&"undefined"!==r&&""!==r&&(e=JSON.parse(r))}catch(t){console.warn("Emoji Stack Separator: Invalid attributes JSON",t)}(0,o.H)(t).render((0,r.createElement)(r.Fragment,null,(0,r.createElement)(m,{attributes:e,id:t.id}),(0,r.createElement)(a,{attributes:e}))),t?.removeAttribute("data-attributes")}))}))})();