function g(e){e.directive("intersect",e.skipDuringClone((n,{value:t,expression:r,modifiers:i},{evaluateLater:u,cleanup:l})=>{let c=u(r),a={rootMargin:p(i),threshold:x(i)},h=new IntersectionObserver(s=>{s.forEach(o=>{o.isIntersecting!==(t==="leave")&&(c(),i.includes("once")&&h.disconnect())})},a);h.observe(n),l(()=>{h.disconnect()})}))}function x(e){if(e.includes("full"))return .99;if(e.includes("half"))return .5;if(!e.includes("threshold"))return 0;let n=e[e.indexOf("threshold")+1];return n==="100"?1:n==="0"?0:+`.${n}`}function _(e){let n=e.match(/^(-?[0-9]+)(px|%)?$/);return n?n[1]+(n[2]||"px"):void 0}function p(e){const n="margin",t="0px 0px 0px 0px",r=e.indexOf(n);if(r===-1)return t;let i=[];for(let u=1;u<5;u++)i.push(_(e[r+u]||""));return i=i.filter(u=>u!==void 0),i.length?i.join(" ").trim():t}var y=g;function v(e){e.directive("collapse",n),n.inline=(t,{modifiers:r})=>{r.includes("min")&&(t._x_doShow=()=>{},t._x_doHide=()=>{})};function n(t,{modifiers:r}){let i=f(r,"duration",250)/1e3,u=f(r,"min",0),l=!r.includes("min");t._x_isShown||(t.style.height=`${u}px`),!t._x_isShown&&l&&(t.hidden=!0),t._x_isShown||(t.style.overflow="hidden");let c=(h,s)=>{let o=e.setStyles(h,s);return s.height?()=>{}:o},a={transitionProperty:"height",transitionDuration:`${i}s`,transitionTimingFunction:"cubic-bezier(0.4, 0.0, 0.2, 1)"};t._x_transition={in(h=()=>{},s=()=>{}){l&&(t.hidden=!1),l&&(t.style.display=null);let o=t.getBoundingClientRect().height;t.style.height="auto";let d=t.getBoundingClientRect().height;o===d&&(o=u),e.transition(t,e.setStyles,{during:a,start:{height:o+"px"},end:{height:d+"px"}},()=>t._x_isShown=!0,()=>{Math.abs(t.getBoundingClientRect().height-d)<1&&(t.style.overflow=null)})},out(h=()=>{},s=()=>{}){let o=t.getBoundingClientRect().height;e.transition(t,c,{during:a,start:{height:o+"px"},end:{height:u+"px"}},()=>t.style.overflow="hidden",()=>{t._x_isShown=!1,t.style.height==`${u}px`&&l&&(t.style.display="none",t.hidden=!0)})}}}}function f(e,n,t){if(e.indexOf(n)===-1)return t;const r=e[e.indexOf(n)+1];if(!r)return t;if(n==="duration"){let i=r.match(/([0-9]+)ms/);if(i)return i[1]}if(n==="min"){let i=r.match(/([0-9]+)px/);if(i)return i[1]}return r}var w=v;export{w as a,y as m};
