1import{d as e}from"./defineElement-Bh-rOTph.js";import"./GlobalStylesStore--z5tmrDj.js";import{T as t}from"./TemplateElement-u6hNeGmQ.js";import{L as s}from"./LazySrcEvents-e2_UAEhY.js";import{h as r}from"./html-BmWsKWcd.js";import"./StyledElement-Dmi2NcTH.js";class i extends t{resizeObserver=null;RESIZABLE_ELEMENTS=["list-filter"];constructor(){super({shadowRender:!0,styles:[":host[cloak='true'] svg{display:none}.content-wrapper{overflow:hidden;transition:height 0.3s ease-out;height:auto}"]})}connected(){this.open||this.collapse(),this.hasAttribute("cloak")&&this.removeAttribute("cloak"),this.reEvaluateHeight=this.reEvaluateHeight||this.RESIZABLE_ELEMENTS.some((e=>this.querySelector(e))),this.reEvaluateHeight&&(this.resizeObserver=new ResizeObserver((e=>{const t=this.$refs.resizableContent.scrollHeight;this.$refs.content.style.height=t+"px"}))),this.querySelectorAll("[cloak='display-none']").forEach((e=>e.removeAttribute("cloak")))}properties(){return{open:!1,reEvaluateHeight:!1}}watch(){return{open:e=>{!0===e?this.expand():this.collapse(),this.setAttribute("open",`${e}`)}}}events(){return{this:{[s.IMG_LOAD]:()=>{this.open&&this.expand()}},"[data-toggle]":{click:()=>{this.toggle()}}}}toggle(){this.open=!this.open}collapse(){const e=this.$refs.content.scrollHeight,t=this.$refs.content.style.transition;this.$refs.content.style.transition="",requestAnimationFrame((()=>{this.$refs.content&&(this.$refs.content.style.height=e+"px",this.$refs.content.style.transition=t,requestAnimationFrame((()=>{this.$refs.content&&(this.$refs.content.style.height="0px")})))})),this.$refs.content.setAttribute("data-collapsed","true"),this.reEvaluateHeight&&this.resizeObserver?.unobserve(this.$refs.resizableContent)}expand(){const e=this.$refs.content.scrollHeight;this.$refs.content.style.height=e+"px",this.$refs.content.setAttribute("data-collapsed","false"),this.reEvaluateHeight&&this.resizeObserver?.observe(this.$refs.resizableContent)}template(){return r` 2 <div class="title-wrapper flex items-center justify-between hover:cursor-pointer" ref="header" data-toggle> 3 <slot name="header"></slot> 4 </div> 5 <div class="content-wrapper" ref="content"> 6 <div ref="resizableContent"> 7 <slot name="content"></slot> 8 </div> 9 </div> 10 `}}e("accordion-element",i);export{i as default}; 11//# sourceMappingURL=accordion-element-wgM5oLfX.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.