/*!
 * Custom elements for Nanopore-Digital Web applications
 */
import{r as t,c as o,g as e}from"./index-BM3Om9WE.js";import{t as n,h as i}from"./renderer-DpNDfhNy.js";import{g as r}from"./dom-dlicJTEJ.js";const a=class{constructor(e){t(this,e),this.nanoToggle=o(this,"nanoToggle",7)}indexOpened;elementOpened;get el(){return e(this)}alwaysOpen=!1;nanoToggle;onToggleHandler(t){"NANO-DETAILS"===t.target?.tagName&&(t.stopPropagation(),r(this.el,n("nano-details")).forEach(((o,e)=>{o!==t.target?o.open=!1:o===t.target&&(this.indexOpened=e)})),this.nanoToggle.emit({element:t.target,index:this.indexOpened}))}onClosedHandler(t){if(t.stopPropagation(),this.alwaysOpen){let o;if(r(this.el,n("nano-details")).forEach((e=>{e!==t.target&&e.open&&(o=!0)})),!o)return void t.preventDefault()}this.elementOpened===t.target&&(this.elementOpened=null,this.indexOpened=null,this.nanoToggle.emit())}render(){return i("slot",{key:"a16b340b9312672847ee022b2beb6767fc0dfb86"})}};a.style=":host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host,*,*::before,*::after{box-sizing:border-box}[hidden]{display:none !important}@media (prefers-reduced-motion: reduce){:host,*,*::before,*::after{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important}}:host{display:contents}";export{a as nano_accordion}