"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("../tslib.es6-C4EgNkz1.js"),t=require("react"),g=require("classnames"),h=c=>typeof c<"u",p=c=>{var{id:i,value:o,name:r,className:d,checked:e,defaultChecked:u=!1,onChange:k=()=>{}}=c,m=b.__rest(c,["id","value","name","className","checked","defaultChecked","onChange"]);const[a,s]=t.useState(u);t.useEffect(()=>{s(!!e)},[e]);const C=n=>{const{value:f="",checked:l=!1}=n.target||{};k(n,{value:f,checked:l}),s(l)};return t.createElement("span",{className:"switch"},t.createElement("input",Object.assign({},m,{className:g("switch__control",d),id:i,role:"switch",type:"checkbox",value:o,"aria-checked":h(e)?e:a,checked:h(e)?e:a,name:r,onChange:C})),t.createElement("span",{className:"switch__button"}))};exports.EbaySwitch=p;
