"use strict";(self.webpackChunk_surecart_blocks_next=self.webpackChunk_surecart_blocks_next||[]).push([[4977],{8603:function(a,t,e){function s(){return"rtl"===document.dir}e.d(t,{i:function(){return s}})},4977:function(a,t,e){e.r(t),e.d(t,{sc_tab:function(){return c}});var s=e(6892),i=e(8603);let r=0;const c=class{constructor(a){(0,s.r)(this,a),this.scClose=(0,s.c)(this,"scClose",7),this.componentId="tab-"+ ++r,this.panel="",this.href=void 0,this.active=!1,this.disabled=!1,this.count=void 0,this.hasPrefix=!1,this.hasSuffix=!1}async triggerFocus(a){this.tab.focus(a)}async triggerBlur(){this.tab.blur()}handleSlotChange(){this.hasPrefix=!!this.el.querySelector('[slot="prefix"]'),this.hasSuffix=!!this.el.querySelector('[slot="suffix"]')}render(){this.el.id=this.el.id||this.componentId;const a=this.href?"a":"div";return(0,s.h)(a,{key:"dc0a1ee900194643f3409e70246c33bf28311527",part:"base "+(this.active?"active":""),href:this.href,class:{tab:!0,"tab--active":this.active,"tab--disabled":this.disabled,"tab--has-prefix":this.hasPrefix,"tab--has-suffix":this.hasSuffix,"tab--is-rtl":(0,i.i)()},ref:a=>this.tab=a,role:"tab","aria-disabled":this.disabled?"true":"false","aria-selected":this.active?"true":"false",tabindex:this.disabled?"-1":"0"},(0,s.h)("span",{key:"ec966161d42efc0272f9fd92bd45594a088e0eb4",part:"prefix",class:"tab__prefix"},(0,s.h)("slot",{key:"6c86cf09cc99826234b7b8d3ff5836778e1bddf7",onSlotchange:()=>this.handleSlotChange(),name:"prefix"})),(0,s.h)("div",{key:"e845ea35b518e04d21db1c02d4cfa3c862ec6288",class:"tab__content",part:"content"},(0,s.h)("slot",{key:"de121939c91b93f0015d28e8c1d00539e681a915"})),(0,s.h)("span",{key:"1423fd72991feb4543fa571fd2d987a8e2c3fc1b",part:"suffix",class:"tab__suffix"},(0,s.h)("slot",{key:"085b1aaa5f1fcf2b327d6972d89444a3dced7831",onSlotchange:()=>this.handleSlotChange(),name:"suffix"})),(0,s.h)("slot",{key:"5a0b434ed46afdaeeecc2407ba311b18779de5a7",name:"suffix"},!!this.count&&(0,s.h)("div",{key:"93a4772746ede6e0567cc1c9b0b1851d0b5e9044",class:"tab__counter",part:"counter"},this.count)))}get el(){return(0,s.a)(this)}};c.style=":host{display:block}.tab{font-family:var(--sc-font-sans);color:var(--sc-color-gray-600);display:flex;align-items:center;justify-content:flex-start;line-height:1;padding:var(--sc-spacing-small) var(--sc-spacing-small);font-size:var(--sc-font-size-medium);font-weight:var(--sc-font-weight-semibold);border-radius:var(--sc-border-radius-small);cursor:pointer;transition:color 0.35s ease, background-color 0.35s ease;user-select:none;text-decoration:none}.tab.tab--active,.tab:hover{color:var(--sc-tab-active-color, var(--sc-color-gray-900));background-color:var(--sc-tab-active-background, var(--sc-color-gray-100))}.tab.tab--disabled{cursor:not-allowed;color:var(--sc-color-gray-400)}.tab__content{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:var(--sc-line-height-dense)}.tab__prefix,.tab__suffix{flex:0 0 auto;display:flex;align-items:center}.tab__suffix{margin-left:auto}.tab__counter{background:var(--sc-color-gray-200);display:inline-block;padding:var(--sc-spacing-xx-small) var(--sc-spacing-small);border-radius:var(--sc-border-radius-pill);font-size:var(--sc-font-size-small);text-align:center;line-height:1;transition:color 0.35s ease, background-color 0.35s ease}.tab.tab--active .tab__counter,.tab:hover .tab__counter{background:var(--sc-color-white)}.tab--has-prefix{padding-left:var(--sc-spacing-small)}.tab--has-prefix .tab__content{padding-left:var(--sc-spacing-small)}.tab--has-suffix{padding-right:var(--sc-spacing-small)}.tab--has-suffix .tab__label{padding-right:var(--sc-spacing-small)}.tab--is-rtl.tab--has-prefix .tab__content{padding-left:0;padding-right:var(--sc-spacing-small)}"}}]);