import{h}from"@stencil/core";import{state as checkoutState}from"../../../../store/checkout/index";import{__}from"@wordpress/i18n";export class ScCartHeader{getItemsCount(){var e,t;const a=(null===(t=null===(e=checkoutState.checkout)||void 0===e?void 0:e.line_items)||void 0===t?void 0:t.data)||[];let c=0;return a.forEach((e=>{c+=null==e?void 0:e.quantity})),c}render(){var e;return h("div",{key:"a98d0178e7cee53855de66b2b8a482a7b3979b4f",class:"cart-header"},h("sc-icon",{key:"6d033a04e5bf15426db6bf0209adb82fc24f3518",class:"cart__close",name:"arrow-right",onClick:()=>this.scCloseCart.emit(),onKeyDown:e=>{"Enter"!==(null==e?void 0:e.code)&&"Space"!==(null==e?void 0:e.code)||this.scCloseCart.emit()},tabIndex:0,role:"button","aria-label":__("Close Cart","surecart")}),h("div",{key:"2fc4b580ae472ff20329a16a76a5d35090891c6e",class:"cart-title"},h("slot",{key:"f24d357acfa1ac9c5fa5c6382790c1c74f31d3d9"})),h("sc-tag",{key:"13ae05191d43b57a126fe93df4b520cd6c34f082",size:"small"},(null===(e=null==this?void 0:this.getItemsCount)||void 0===e?void 0:e.call(this))||0))}static get is(){return"sc-cart-header"}static get encapsulation(){return"shadow"}static get originalStyleUrls(){return{$:["sc-cart-header.scss"]}}static get styleUrls(){return{$:["sc-cart-header.css"]}}static get events(){return[{method:"scCloseCart",name:"scCloseCart",bubbles:!0,cancelable:!0,composed:!0,docs:{tags:[],text:""},complexType:{original:"void",resolved:"void",references:{}}}]}}