"use strict";const p=require("./tslib.es6-C4EgNkz1.js"),e=require("react"),y=require("classnames"),E=require("./icon-I30uh1Ov.js"),N=a=>{var{pressed:o=!1,children:s,className:i,title:g,subtitle:r,layoutType:n="minimal",icon:l,img:t,onToggle:c}=a,m=p.__rest(a,["pressed","children","className","title","subtitle","layoutType","icon","img","onToggle"]);const u=d=>{c&&c(d,{pressed:!o})},b=()=>s||e.createElement(e.Fragment,null,e.createElement("p",{className:"toggle-button__title"},g),r&&e.createElement("p",{className:"toggle-button__subtitle"},r)),_=()=>{if(l)return e.createElement("div",{className:"toggle-button__icon"},typeof l=="string"?e.createElement(E.EbayIcon,{name:l}):l);if(t)return e.createElement("span",{className:"toggle-button__image-container"},t.fillPlacement?e.createElement("span",{role:"img","aria-label":t.alt,className:"toggle-button__image",style:{backgroundImage:`url(${t.src})`,backgroundPosition:t.fillPlacement||"center",backgroundSize:"cover",backgroundRepeat:"no-repeat"}}):e.createElement("span",{className:"toggle-button__image"},e.createElement("img",{src:t.src,alt:t.alt})))};return e.createElement("button",Object.assign({onClick:u,className:y("toggle-button",i,{"toggle-button--minimal-layout":n==="minimal","toggle-button--list-layout":n==="list","toggle-button--gallery-layout":n==="gallery"}),"aria-pressed":o},m),_(),e.createElement("div",{className:"toggle-button__content"},b()))};exports.ToggleButton=N;
