import{h}from"@stencil/core";import{isRtl}from"../../../functions/page-align";export class ScStackedListRow{constructor(){this.href=void 0,this.target="_self",this.mobileSize=600,this.width=void 0,this.hasPrefix=!1,this.hasSuffix=!1}componentDidLoad(){"ResizeObserver"in window&&new window.ResizeObserver((e=>{e.forEach((e=>{this.width=e.contentRect.width}))})).observe(this.el)}handleSlotChange(){this.hasPrefix=!!Array.from(this.el.children).some((e=>"prefix"===e.slot)),this.hasSuffix=!!Array.from(this.el.children).some((e=>"suffix"===e.slot))}render(){const e=this.href?"a":"div";return h(e,{key:"36b3942fe6fe111e4e5676ceb438de6b870b70d6",href:this.href,target:this.target,part:"base",class:{"list-row":!0,"list-row--has-prefix":this.hasPrefix,"list-row--has-suffix":this.hasSuffix,"breakpoint-lg":this.width>=this.mobileSize,"list-row--is-rtl":isRtl()}},h("span",{key:"02c1e7661da40dff022f1b0fbd08d5c95ab8e9aa",class:"list-row__prefix"},h("slot",{key:"33dacca64320faec5cc53f4cc3daa14473accf55",name:"prefix",onSlotchange:()=>this.handleSlotChange()})),h("slot",{key:"7b6f270d842a5ffd1b5c14aaf1701d06479ee81d",onSlotchange:()=>this.handleSlotChange()}),h("span",{key:"6aef5e7e15ababfaada19cbdfa05f24bd1e7fbd7",class:"list-row__suffix"},h("slot",{key:"617dd44d4e340f1dc1b6254fb621c4dc91e65e6a",name:"suffix",onSlotchange:()=>this.handleSlotChange()})))}static get is(){return"sc-stacked-list-row"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-stacked-list-row.scss"]}}static get styleUrls(){return{$:["sc-stacked-list-row.css"]}}static get properties(){return{href:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"href",reflect:!1},target:{type:"string",mutable:!1,complexType:{original:"string",resolved:"string",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"target",reflect:!1,defaultValue:"'_self'"},mobileSize:{type:"number",mutable:!1,complexType:{original:"number",resolved:"number",references:{}},required:!1,optional:!1,docs:{tags:[],text:""},attribute:"mobile-size",reflect:!1,defaultValue:"600"}}}static get states(){return{width:{},hasPrefix:{},hasSuffix:{}}}static get elementRef(){return"el"}}