import{t as A,y as d,D as v,J as i,z as M,K as N,L as _,M as m,G as y,N as p,O as w,P as C,Q as O,R,S as g,T as H}from"./BfUaJvxP.js";function b(h,E,u=!1,f=!1,t=!1,L=!1){var n=h,a="";if(u){var l=h;d&&(n=v(i(l)))}A(()=>{var s=N;if(a===(a=E()??"")){d&&M();return}if(u&&!d){s.nodes=null,l.innerHTML=a,a!==""&&_(i(l),l.lastChild);return}if(s.nodes!==null&&(m(s.nodes.start,s.nodes.end),s.nodes=null),a!==""){if(d){y.data;for(var e=M(),c=e;e!==null&&(e.nodeType!==p||e.data!=="");)c=e,e=w(e);if(e===null)throw C(),O;_(y,c),n=v(e);return}var T=f?g:t?H:void 0,o=R(f?"svg":t?"math":"template",T);o.innerHTML=a;var r=f||t?o:o.content;if(_(i(r),r.lastChild),f||t)for(;i(r);)n.before(i(r));else n.before(r)}})}export{b as h};
