class LiquidEffectsSlideToggleBehavior extends LiquidBehavior{static behaviorName="liquidEffectsSlideToggle";defaultActiveDisplay=":flex";options(){return{duration:.7,changePropPrefix:null,keepHiddenClassname:!0}}get viewEvents(){const i=this.getChangeProp(),t=this.getChangeProp("closedItems");return{[`change:${i}`]:"onOpenedElements",[`change:${t}`]:"onClosedElements"}}onOpenedElements({targets:i}){i?.length&&i.forEach(t=>{if((getComputedStyle(t).display!=="none"||t.offsetHeight>0)&&!gsap.isTweening(t))return;gsap.killTweensOf(t),this.setInitialState(t);const s=this.getActiveDisplay(t);gsap.set(t,{display:s}),t.classList.remove("hidden"),gsap.from(t,{duration:this.getOption("duration"),ease:"power4.out",height:0,paddingTop:0,paddingBottom:0,onComplete:()=>{gsap.set(t,{height:"",overflow:"",paddingTop:"",paddingBottom:""})}})})}onClosedElements({targets:i}){if(!i?.length)return;const t=this.getOption("keepHiddenClassname");gsap.killTweensOf(i),i.forEach(e=>{this.setInitialState(e,!1),gsap.to(e,{duration:this.getOption("duration"),ease:"power4.out",height:0,paddingTop:0,paddingBottom:0,onComplete:()=>{t&&e.classList.add("hidden"),gsap.set(e,{display:"",height:"",overflow:"",paddingTop:"",paddingBottom:""})}})})}getActiveDisplay(i){const t=this.view.model.get("lastActiveDisplay");if(t)return t;const a=(i.className.split(" ").find(o=>o.startsWith("[&.lqd-is-active"))||this.defaultActiveDisplay).split(":")[1].replace("]","");return this.view.model.set({lastActiveDisplay:a}),a}setInitialState(i,t=!0){const e={overflow:"hidden"};t&&(e.height="auto"),gsap.set(i,e)}}typeof window<"u"&&(window.liquid?.app?window.liquid?.app?.model?.set("loadedBehaviors",[...window.liquid.app.model.get("loadedBehaviors"),LiquidEffectsSlideToggleBehavior]):window.liquid?.loadedBehaviors?.push(LiquidEffectsSlideToggleBehavior));
