!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.Sweetalert2=e()}(this,function(){"use strict";function w(t){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){for(var n=0;n\n
\n \n
\n \n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n \n

\n \n
\n
\n
\n \n \n
\n \n \n
\n \n
\n \n \n
\n
\n
\n \n \n
\n
\n
\n \n').replace(/(^|\n)\s*/g,""),at=function(t){Jt.isVisible()&&P!==t.target.value&&Jt.resetValidationMessage(),P=t.target.value},st=function(t){var e;if((e=R())&&(e.parentNode.removeChild(e),T([document.documentElement,document.body],[x["no-backdrop"],x["toast-shown"],x["has-column"]])),it())k("SweetAlert2 requires document to initialize");else{var n=document.createElement("div");n.className=x.container,n.innerHTML=rt;var o,i,r,a,s,c,u,l,d,p,f,m,g="string"==typeof(o=t.target)?document.querySelector(o):o;g.appendChild(n),i=t,(r=U()).setAttribute("role",i.toast?"alert":"dialog"),r.setAttribute("aria-live",i.toast?"polite":"assertive"),i.toast||r.setAttribute("aria-modal","true"),a=g,"rtl"===window.getComputedStyle(a).direction&&O(R(),x.rtl),s=K(),c=M(s,x.input),u=M(s,x.file),l=s.querySelector(".".concat(x.range," input")),d=s.querySelector(".".concat(x.range," output")),p=M(s,x.select),f=s.querySelector(".".concat(x.checkbox," input")),m=M(s,x.textarea),c.oninput=at,u.onchange=at,p.onchange=at,f.onchange=at,m.oninput=at,l.oninput=function(t){at(t),d.value=l.value},l.onchange=function(t){at(t),l.nextSibling.value=l.value}}},ct=function(t,e){t instanceof HTMLElement?e.appendChild(t):"object"===w(t)?ut(e,t):t&&(e.innerHTML=t)},ut=function(t,e){if(t.innerHTML="",0 in e)for(var n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},lt=function(){if(it())return!1;var t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(var n in e)if(e.hasOwnProperty(n)&&void 0!==t.style[n])return e[n];return!1}(),dt=function(t){var e=K().querySelector("#"+x.content);t.html?(ct(t.html,e),j(e,"block")):t.text?(e.textContent=t.text,j(e,"block")):q(e),function(e){for(var t,n=K(),o=["input","file","range","select","radio","checkbox","textarea"],i=function(t){t.placeholder&&!e.inputPlaceholder||(t.placeholder=e.inputPlaceholder)},r=0;r=c.progressSteps.length&&C("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),c.progressSteps.forEach(function(t,e){var n,o,i,r,a=(n=t,o=document.createElement("li"),O(o,x["progress-step"]),o.innerHTML=n,o);if(u.appendChild(a),e===l&&O(a,x["active-progress-step"]),e!==c.progressSteps.length-1){var s=(i=t,r=document.createElement("li"),O(r,x["progress-step-line"]),i.progressStepsDistance&&(r.style.width=i.progressStepsDistance),r);u.appendChild(s)}})},gt=function(t){var e,n,o,i,r=X();S(r,t.customClass,"header"),mt(t),function(t){var e=z();if(e&&e.classList.contains(g[t.type]))S(e,t.customClass,"icon");else if(pt(),t.type)if(ft(),-1!==Object.keys(g).indexOf(t.type)){var n=N(".".concat(x.icon,".").concat(g[t.type]));j(n),S(n,t.customClass,"icon"),E(n,"swal2-animate-".concat(t.type,"-icon"),t.animation)}else k('Unknown type! Expected "success", "error", "warning", "info" or "question", got "'.concat(t.type,'"'))}(t),function(t){var e=F();if(!t.imageUrl)return q(e);j(e),e.setAttribute("src",t.imageUrl),e.setAttribute("alt",t.imageAlt),V(e,"width",t.imageWidth),V(e,"height",t.imageHeight),e.className=x.image,S(e,t.customClass,"image"),t.imageClass&&O(e,t.imageClass)}(t),e=t,n=W(),H(n,e.title||e.titleText),e.title&&ct(e.title,n),e.titleText&&(n.innerText=e.titleText),S(n,e.customClass,"title"),o=t,i=tt(),S(i,o.customClass,"closeButton"),H(i,o.showCloseButton),i.setAttribute("aria-label",o.closeButtonAriaLabel)},ht=function(t){var e,n,o,i;e=t,n=U(),V(n,"width",e.width),V(n,"padding",e.padding),e.background&&(n.style.background=e.background),n.className=x.popup,e.toast?(O([document.documentElement,document.body],x["toast-shown"]),O(n,x.toast)):O(n,x.modal),S(n,e.customClass,"popup"),"string"==typeof e.customClass&&O(n,e.customClass),E(n,x.noanimation,!e.animation),function(t){var e=R();if(e){if("string"==typeof t.backdrop?e.style.background=t.backdrop:t.backdrop||O([document.documentElement,document.body],x["no-backdrop"]),!t.backdrop&&t.allowOutsideClick&&C('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),t.position in x?O(e,x[t.position]):(C('The "position" parameter is not valid, defaulting to "center"'),O(e,x.center)),t.grow&&"string"==typeof t.grow){var n="grow-"+t.grow;n in x&&O(e,x[n])}S(e,t.customClass,"container"),t.customContainerClass&&O(e,t.customContainerClass)}}(t),gt(t),dt(t),function(t){var e=J(),n=Y(),o=$();if(t.showConfirmButton||t.showCancelButton?j(e):q(e),S(e,t.customClass,"actions"),H(n,t.showConfirmButton,"inline-block"),H(o,t.showCancelButton,"inline-block"),n.innerHTML=t.confirmButtonText,o.innerHTML=t.cancelButtonText,n.setAttribute("aria-label",t.confirmButtonAriaLabel),o.setAttribute("aria-label",t.cancelButtonAriaLabel),n.className=x.confirm,S(n,t.customClass,"confirmButton"),O(n,t.confirmButtonClass),o.className=x.cancel,S(o,t.customClass,"cancelButton"),O(o,t.cancelButtonClass),t.buttonsStyling){O([n,o],x.styled),t.confirmButtonColor&&(n.style.backgroundColor=t.confirmButtonColor),t.cancelButtonColor&&(o.style.backgroundColor=t.cancelButtonColor);var i=window.getComputedStyle(n).getPropertyValue("background-color");n.style.borderLeftColor=i,n.style.borderRightColor=i}else T([n,o],x.styled),n.style.backgroundColor=n.style.borderLeftColor=n.style.borderRightColor="",o.style.backgroundColor=o.style.borderLeftColor=o.style.borderRightColor=""}(t),o=t,i=G(),H(i,o.footer),o.footer&&ct(o.footer,i),S(i,o.customClass,"footer")};var vt=[],bt=function(){var t=U();t||Jt.fire(""),t=U();var e=J(),n=Y(),o=$();j(e),j(n),O([t,e],x.loading),n.disabled=!0,o.disabled=!0,t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},yt={},wt=function(){return new Promise(function(t){var e=window.scrollX,n=window.scrollY;yt.restoreFocusTimeout=setTimeout(function(){yt.previousActiveElement&&yt.previousActiveElement.focus?(yt.previousActiveElement.focus(),yt.previousActiveElement=null):document.body&&document.body.focus(),t()},100),void 0!==e&&void 0!==n&&window.scrollTo(e,n)})},Ct={title:"",titleText:"",text:"",html:"",footer:"",type:null,toast:!1,customClass:"",customContainerClass:"",target:"body",backdrop:!0,animation:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showCancelButton:!1,preConfirm:null,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:null,confirmButtonClass:"",cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:null,cancelButtonClass:"",buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusCancel:!1,showCloseButton:!1,closeButtonAriaLabel:"Close this dialog",showLoaderOnConfirm:!1,imageUrl:null,imageWidth:null,imageHeight:null,imageAlt:"",imageClass:"",timer:null,width:null,padding:null,background:null,input:null,inputPlaceholder:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputClass:"",inputAttributes:{},inputValidator:null,validationMessage:null,grow:!1,position:"center",progressSteps:[],currentProgressStep:null,progressStepsDistance:null,onBeforeOpen:null,onAfterClose:null,onOpen:null,onClose:null,scrollbarPadding:!0},kt=["title","titleText","text","html","type","customClass","showConfirmButton","showCancelButton","confirmButtonText","confirmButtonAriaLabel","confirmButtonColor","confirmButtonClass","cancelButtonText","cancelButtonAriaLabel","cancelButtonColor","cancelButtonClass","buttonsStyling","reverseButtons","imageUrl","imageWidth","imageHeigth","imageAlt","imageClass","progressSteps","currentProgressStep"],Bt={customContainerClass:"customClass",confirmButtonClass:"customClass",cancelButtonClass:"customClass",imageClass:"customClass",inputClass:"customClass"},xt=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusCancel","heightAuto","keydownListenerCapture"],St=function(t){return Ct.hasOwnProperty(t)},At=function(t){return Bt[t]},Pt=Object.freeze({isValidParameter:St,isUpdatableParameter:function(t){return-1!==kt.indexOf(t)},isDeprecatedParameter:At,argsToParams:function(n){var o={};switch(w(n[0])){case"object":a(o,n[0]);break;default:["title","html","type"].forEach(function(t,e){switch(w(n[e])){case"string":o[t]=n[e];break;case"undefined":break;default:k("Unexpected type of ".concat(t,'! Expected "string", got ').concat(w(n[e])))}})}return o},isVisible:function(){return I(U())},clickConfirm:function(){return Y()&&Y().click()},clickCancel:function(){return $()&&$().click()},getContainer:R,getPopup:U,getTitle:W,getContent:K,getImage:F,getIcon:z,getIcons:_,getCloseButton:tt,getActions:J,getConfirmButton:Y,getCancelButton:$,getHeader:X,getFooter:G,getFocusableElements:et,getValidationMessage:Q,isLoading:function(){return U().hasAttribute("data-loading")},fire:function(){for(var t=arguments.length,e=new Array(t),n=0;nwindow.innerHeight&&(b.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=b.previousBodyPadding+function(){if("ontouchstart"in window||navigator.msMaxTouchPoints)return 0;var t=document.createElement("div");t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t);var e=t.offsetWidth-t.clientWidth;return document.body.removeChild(t),e}()+"px")},Tt=function(){null!==b.previousBodyPadding&&(document.body.style.paddingRight=b.previousBodyPadding+"px",b.previousBodyPadding=null)},Mt=function(){if(y(document.body,x.iosfix)){var t=parseInt(document.body.style.top,10);T(document.body,x.iosfix),document.body.style.top="",document.body.scrollTop=-1*t}},Vt=function(){return!!window.MSInputMethodContext&&!!document.documentMode},jt=function(){var t=R(),e=U();t.style.removeProperty("align-items"),e.offsetTop<0&&(t.style.alignItems="flex-start")},qt=function(){"undefined"!=typeof window&&Vt()&&window.removeEventListener("resize",jt)},Ht=function(){f(document.body.children).forEach(function(t){t.hasAttribute("data-previous-aria-hidden")?(t.setAttribute("aria-hidden",t.getAttribute("data-previous-aria-hidden")),t.removeAttribute("data-previous-aria-hidden")):t.removeAttribute("aria-hidden")})},It={swalPromiseResolve:new WeakMap};function Rt(t,e){ot()?Ut(e):(wt().then(function(){return Ut(e)}),yt.keydownTarget.removeEventListener("keydown",yt.keydownHandler,{capture:yt.keydownListenerCapture}),yt.keydownHandlerAdded=!1),t.parentNode&&t.parentNode.removeChild(t),T([document.documentElement,document.body],[x.shown,x["height-auto"],x["no-backdrop"],x["toast-shown"],x["toast-column"]]),nt()&&(Tt(),Mt(),qt(),Ht())}function Nt(t,e,n){t.removeEventListener(lt,Nt),y(t,x.hide)&&Rt(e,n)}function Dt(t){var e=R(),n=U(),o=Lt.innerParams.get(this),i=It.swalPromiseResolve.get(this),r=o.onClose,a=o.onAfterClose;n&&(null!==r&&"function"==typeof r&&r(n),T(n,x.show),O(n,x.hide),lt&&!y(n,x.noanimation)?n.addEventListener(lt,Nt.bind(null,n,e,a)):Rt(e,a),i(t||{}))}var Ut=function(t){null!==t&&"function"==typeof t&&setTimeout(function(){t()})};function _t(t,e,n){var o=Lt.domCache.get(t);e.forEach(function(t){o[t].disabled=n})}function zt(t,e){if(!t)return!1;if("radio"===t.type)for(var n=t.parentNode.parentNode.querySelectorAll("input"),o=0;o"));var t=U(),n="string"==typeof e.target?document.querySelector(e.target):e.target;(!t||t&&n&&t.parentNode!==n.parentNode)&&st(e)}(f),Object.freeze(f),Lt.innerParams.set(this,f),yt.timeout&&(yt.timeout.stop(),delete yt.timeout),clearTimeout(yt.restoreFocusTimeout);var m={popup:U(),container:R(),content:K(),actions:J(),confirmButton:Y(),cancelButton:$(),closeButton:tt(),validationMessage:Q(),progressSteps:Z()};Lt.domCache.set(this,m),ht(f);var g=this.constructor;return new Promise(function(t){var n=function(t){p.closePopup({value:t})},s=function(t){p.closePopup({dismiss:t})};It.swalPromiseResolve.set(p,t),f.timer&&(yt.timeout=new Wt(function(){s("timer"),delete yt.timeout},f.timer)),f.input&&setTimeout(function(){var t=p.getInput();t&&L(t)},0);for(var c=function(e){f.showLoaderOnConfirm&&g.showLoading(),f.preConfirm?(p.resetValidationMessage(),Promise.resolve().then(function(){return f.preConfirm(e,f.validationMessage)}).then(function(t){I(m.validationMessage)||!1===t?p.hideLoading():n(void 0===t?e:t)})):n(e)},e=function(t){var e=t.target,n=m.confirmButton,o=m.cancelButton,i=n&&(n===e||n.contains(e)),r=o&&(o===e||o.contains(e));switch(t.type){case"click":if(i)if(p.disableButtons(),f.input){var a=function(){var t=p.getInput();if(!t)return null;switch(f.input){case"checkbox":return t.checked?1:0;case"radio":return t.checked?t.value:null;case"file":return t.files.length?t.files[0]:null;default:return f.inputAutoTrim?t.value.trim():t.value}}();f.inputValidator?(p.disableInput(),Promise.resolve().then(function(){return f.inputValidator(a,f.validationMessage)}).then(function(t){p.enableButtons(),p.enableInput(),t?p.showValidationMessage(t):c(a)})):p.getInput().checkValidity()?c(a):(p.enableButtons(),p.showValidationMessage(f.validationMessage))}else c(!0);else r&&(p.disableButtons(),s(g.DismissReason.cancel))}},o=m.popup.querySelectorAll("button"),i=0;i