https://www.etro.com/on/demandware.static/Sites-ETRO_US-Site/-/en_…/component-tabsComponent.chunk.js
1"use strict";(self.webpackChunkapp_project=self.webpackChunkapp_project||[]).push([[6669],{88118:(e,t,s)=>{s.d(t,{Z:()=>h});var a=s(8651),i=s(82053),r=s(88247),n=s(99224),o=s(27363);var l=s(52087),c=s.n(l);class h extends class{constructor(){i.default.set("log",!0),this._grabMessages()}get CUSTOM_MESSAGES(){return n.Z}get Messages(){return{}}_checkMessages(){for(const e in this.Messages)if(window.eventQueue.get(e)){const t=this.Messages[e].bind(this);window.eventQueue.get(e).map((e=>{t(e)})),window.eventQueue.delete(e)}}_grabMessages(){this._messages={};for(const e in this.Messages)if(this.Messages[e]){const t=this.Messages[e].bind(this);this._messages[e]=t,this.GRAB(e,t)}}_ungrabMessages(){for(const e in this._messages)this.UNGRAB(e,this._messages[e])}objectIsEmpty(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}EMIT(e,t){return r.Z.emit(e,t)}GRAB(e,t){t&&r.Z.on(e,t)}UNGRAB(e,t){t&&r.Z.off(e,t)}getFirstFocusable(e){return(0,o.f)(e)}getFocusableElements(e){return(0,o._)(e)}_destroy(){this._ungrabMessages()}}{constructor(e){super(),this.observer=new IntersectionObserver((e=>{if(e[0].isIntersecting){[...e[0].target.querySelectorAll('[data-animated="false"]')].forEach(((e,t)=>{setTimeout((()=>{e.setAttribute("data-animated","true")}),300*t)})),this.observer.unobserve(e[0].target)}}),{threshold:.5}),this._componentElement=e,this._componentElement.setAttribute("data-component-init","true"),this.observer.observe(this._componentElement)}get $el(){return this._componentElement}get $options(){const e={},t=Object.assign({},this.$el.dataset);return Object.keys(t).filter((e=>e.includes("option"))).forEach((s=>{const a=h.cleanOptionKey(s);let i;i=t[s].includes("{")&&t[s].includes("}")?JSON.parse(t[s].replace(/'/g,'"')):h.convertType(t[s]),e[a]=i})),(0,a.Z)(e)}get COMPONENT_NAME(){return this.__proto__.constructor.name}static convertType(e){let t;switch(e){case"false":t=!1;break;case"true":t=!0;break;case"null":t=null;break;default:t=e}return t}static cleanOptionKey(e){const t=e.replace("option","");return`${t.charAt(0).toLocaleLowerCase()}${t.slice(1)}`}$on(e,t,s=this.$el,a=null){s&&e&&t&&(a?c().on(s,e,a,(e=>{e&&e.stopPropagation(),t(e)})):c().on(s,e,(e=>{e&&e.stopPropagation(),t(e)})))}$one(e,t,s=this.$el){c().one(s,e,t)}$off(e,t=this.$el){c().off(t,e)}$fire(e,t=this.$el){c().fire(t,e)}loading(e,t=""){this.EMIT(this.CUSTOM_MESSAGES.LOADER_EVENTS.show,{container:e||this.$el,message:t})}endLoading(e,t,s,a=!1,i){this.EMIT(this.CUSTOM_MESSAGES.LOADER_EVENTS.hide,{container:e||this.$el,message:t,icon:s,error:a,time:i})}}},89780:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i});var a=s(88118);class i extends a.Z{constructor(e){super(e),this.tabpanels=[];let t=this.$el.querySelector('[role="tablist"]');this.tabs=Array.from(t.querySelectorAll("[role=tab]"));for(let e=0;e<this.tabs.length;e+=1){let t=this.tabs[e],s=document.getElementById(t.getAttribute("aria-controls"));t.tabIndex=-1,t.setAttribute("aria-selected","false"),this.tabpanels.push(s),t.addEventListener("keydown",(e=>{this.onKeydown(e)})),t.addEventListener("click",(e=>{this.setSelectedTab(e.currentTarget,!0)})),this.firstTab||(this.firstTab=t),this.lastTab=t}this.setSelectedTab(this.firstTab,!1)}setSelectedTab(e,t){"boolean"!=typeof t&&(t=!0);for(let s=0;s<this.tabs.length;s+=1){let a=this.tabs[s];e===a?(a.setAttribute("aria-selected","true"),a.removeAttribute("tabindex"),this.tabpanels[s].classList.remove("ishidden"),t&&a.focus()):(a.setAttribute("aria-selected","false"),a.tabIndex=-1,this.tabpanels[s].classList.add("ishidden"))}}setSelectedToPreviousTab(e){let t;e===this.firstTab?this.setSelectedTab(this.lastTab,!0):(t=this.tabs.indexOf(e),this.setSelectedTab(this.tabs[t-1],!0))}setSelectedToNextTab(e){let t;e===this.lastTab?this.setSelectedTab(this.firstTab,!0):(t=this.tabs.indexOf(e),this.setSelectedTab(this.tabs[t+1],!0))}onKeydown(e){let t=e.currentTarget,s=!1;switch(e.key){case"ArrowLeft":this.setSelectedToPreviousTab(t),s=!0;break;case"ArrowRight":this.setSelectedToNextTab(t),s=!0;break;case"Home":this.setSelectedTab(this.firstTab,!0),s=!0;break;case"End":this.setSelectedTab(this.lastTab,!0),s=!0}s&&(e.stopPropagation(),e.preventDefault())}}},27363:(e,t,s)=>{s.d(t,{_:()=>r,f:()=>i});const a='button, [href]:not([aria-hidden="true"]), input, select, textarea, [tabindex]:not
1([tabindex="-1"]), [role="button"]',i=e=>e.querySelector(a),r=e=>e.querySelectorAll(a)}}]); 2//# sourceMappingURL=component-tabsComponent.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.