text: import{r as registerInstance,e as createEvent,h,H as Host,i as getElement}from"./index-70672e81.js";import{g as generateMedColor}from"./med-theme-83c28ab9.js";var medAccordionItemCss=":host{--background-header:linear-gradient(to right, hsl(var(--med-color-brand-1)), hsl(var(--med-color-neutral-2)), hsl(var(--med-color-neutral-2)));--background-content:hsl(var(--med-color-neutral-2));--icon-color:hsl(var(--med-color-neutral-10));--border-radius:var(--med-border-radius-sm);--padding:var(--med-spacing-inset-sm);--icon-font-size:24px}:host(.med-accordion-item){display:block;border-radius:var(--border-radius)}:host(.med-accordion-item) .med-accordion-item__header-container{width:100%;cursor:pointer;z-index:1;display:-ms-flexbox;display:flex}:host(.med-accordion-item) .med-accordion-item__header{-webkit-box-sizing:border-box;box-sizing:border-box;padding:var(--padding);background:var(--background-header);border-radius:var(--border-radius);position:relative;width:100%;-webkit-transition:background 0.5s linear;transition:background 0.5s linear;background-size:200% 100%;background-position:100% 0}:host(.med-accordion-item) .med-accordion-item__heading{width:100%}:host(.med-accordion-item) .med-accordion-item__icon-container{display:-ms-flexbox;display:flex}:host(.med-accordion-item) .med-accordion-item__icon-container--left{padding-right:var(--med-spacing-inline-xxxs)}:host(.med-accordion-item) .med-accordion-item__icon-container--right{padding-left:var(--med-spacing-inline-xxxs);margin-left:auto}:host(.med-accordion-item) .med-accordion-item__content{display:none;overflow:auto;background:var(--background-content);border-bottom-left-radius:var(--border-radius);border-bottom-right-radius:var(--border-radius);z-index:0}:host(.med-accordion-item) .header-container__end{margin-left:auto}:host(.med-accordion-item--no-border){--border-radius:0}:host(.med-accordion-item--keep-border) .med-accordion-item__header{border-bottom-left-radius:var(--med-border-radius-sm) !important;border-bottom-right-radius:var(--med-border-radius-sm) !important}::slotted(ion-progress-bar){position:absolute;left:0;bottom:0;border-bottom-left-radius:4px;border-bottom-right-radius:4px}:host(.med-accordion-item--open.med-accordion-item--background) .med-accordion-item__header{background-position:0 0}:host(.med-accordion-item--open) ::slotted(ion-progress-bar){border-bottom-left-radius:0;border-bottom-right-radius:0}:host(.med-color.med-accordion-item--background){--background-header:linear-gradient(to right, hsl(var(--med-color-1)), hsl(var(--med-color-neutral-2)), hsl(var(--med-color-neutral-2)))}";var MedAccordionItem=function(){function e(e){var o=this;registerInstance(this,e);this.toggle=createEvent(this,"toggle",7);this.opened=createEvent(this,"opened",7);this.medClick=createEvent(this,"medClick",7);this.noBorder=false;this.background=false;this.canCollapse=true;this.isOpened=false;this.slotsToggle=[];this.isOpen=false;this.isTransitioning=false;this.onClick=function(e){if(!o.canCollapse){return}if(!o.slotsToggle.length||o.slotsToggle.indexOf(e)>=0){o.toggleOpen()}}}e.prototype.watchPropHandler=function(e){this.toggleOpen()};e.prototype.componentDidLoad=function(){if(this.isOpened){this.toggleOpen()}};e.prototype.toggleOpen=function(){var e=this;if(this.isTransitioning){return}this.isOpen=!this.isOpen;this.opened.emit(this.isOpen);this.isTransitioning=true;this.toggle.emit({element:this.hostElement,content:this.content,header:this.header,shouldOpen:this.isOpen,startTransition:function(){e.isTransitioning=true},endTransition:function(){e.isTransitioning=false},setClosed:function(){e.isOpen=false;e.opened.emit(e.isOpen)}})};e.prototype.onHeaderClick=function(){this.medClick.emit()};e.prototype.render=function(){var e=this;var o=this,r=o.dsColor,t=o.noBorder,i=o.isOpen,n=o.background;return h(Host,{"from-stencil":true,class:generateMedColor(r,{"med-accordion-item":true,"med-accordion-item--no-border":t,"med-accordion-item--open":i,"med-accordion-item--background":n})},h("div",{class:"med-accordion-item__header",onClick:function(){return e.onHeaderClick()},ref:function(o){return e.header=o}},h("div",{class:"med-accordion-item__header-container"},h("div",{class:"header-container__start",onClick:function(){return e.onClick("start")}},h("slot",{name:"start"})),h("div",{class:"header-container__middle",onClick:function(){return e.onClick("middle")}},h("slot",{name:"middle"})),h("div",{class:"header-container__end",onClick:function(){return e.onClick("end")}},h("slot",{name:"end"}))),h("div",null,h("slot",{name:"auxiliar"}))),h("div",{class:"med-accordion-item__content",ref:function(o){return e.content=o}},h("slot",{name:"content"})))};Object.defineProperty(e.prototype,"hostElement",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{isOpened:["watchPropHandler"]}},enumerable:false,configurable:true});return e}();MedAccordionItem.style=medAccordionItemCss;export{MedAccordionItem as med_accordion_item};