(()=>{function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}document.addEventListener("DOMContentLoaded",(function(t){var r=document.querySelectorAll(".eb-toggle-wrapper");if(r){var n,o=function(t,r){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,r){if(t){if("string"==typeof t)return e(t,r);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}(t))||r&&t&&"number"==typeof t.length){n&&(t=n);var o=0,l=function(){};return{s:l,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,c=!0,i=!1;return{s:function(){n=n.call(t)},n:function(){var e=n.next();return c=e.done,e},e:function(e){i=!0,a=e},f:function(){try{c||null==n.return||n.return()}finally{if(i)throw a}}}}(r);try{var l=function(){var e=n.value,t=e.querySelector(".eb-toggle-switch > input"),r=e.querySelector(".eb-toggle-primary-label"),o=e.querySelector(".eb-toggle-secondary-label"),l=e.querySelector(".eb-toggle-primary-label-text"),a=e.querySelector(".eb-toggle-secondary-label-text"),c=e.querySelector(".eb-toggle-slider"),i=e.querySelector(".eb-toggle-controller"),u=e.querySelector(".eb-toggle-content"),s=e.querySelector(".eb-toggle-seperator"),d=e.getAttribute("data-init-content"),y=e.getAttribute("data-size"),g=e.getAttribute("data-switch-style"),b=e.getAttribute("data-primary-color"),f=e.getAttribute("data-secondary-color"),p=e.getAttribute("data-active-color"),h=e.getAttribute("data-bg-color"),m=e.getAttribute("data-active-bg"),v="inherit",x="inherit",S=window.getComputedStyle(u.children[0]).display,A=window.getComputedStyle(u.children[1]).display,w=function(){switch(y){case"s":return"translateX(22px)";case"m":return"translateX(26px)";case"l":return"translateX(36px)";case"xl":return"translateX(42px)"}},k=e.querySelector(".eb-text-switch-label").getAttribute("for"),q=e.querySelector("#".concat(k));function E(){"toggle"!==g&&(r.style.background=m||x,o.style.background=h||v),X()}function L(){"toggle"!==g&&(o.style.background=m||x,r.style.background=h||v),C()}function X(){t.checked=!1,u.children[0].style.display=S,u.children[1].style.display="none",o.style.color=f,r.style.color=p||b,"toggle"===g&&(a.style.color=f,l.style.color=p||b),"text"!==g&&(i.style.transform="translateX(0px)")}function C(){t.checked=!0,u.children[1].style.display=A,u.children[0].style.display="none",r.style.color=b,o.style.color=p,"toggle"===g&&(l.style.color=b,a.style.color=p||f),"text"!==g&&(i.style.transform=w())}"primary"===d?X():(q.checked=!0,C()),q.addEventListener("change",(function(){this.checked?C():X()})),"text"===g&&(r.style.background=h||v,o.style.background=h||v,s.style.background=h||v),r.addEventListener("click",E),o.addEventListener("click",L),"text"===g&&("primary"===d?E():L()),"rounded"==g&&(c.style.borderRadius="21px",i.style.borderRadius=function(){switch(y){case"s":return"10px";case"m":return"13px";case"l":return"18px";case"xl":return"21px"}}()),"primary"===d?X():C(),t.addEventListener("change",(function(){this.checked?C():X()}))};for(o.s();!(n=o.n()).done;)l()}catch(e){o.e(e)}finally{o.f()}}}))})();