layui.define([],function(l){var m={},PLUGIN_NAME='iziToast',BODY=document.querySelector('body'),ISMOBILE=(/Mobi/.test(navigator.userAgent))?true:false,ISCHROME=/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor),ISFIREFOX=typeof InstallTrigger!=='undefined',ACCEPTSTOUCH='ontouchstart'in document.documentElement,POSITIONS=['bottomRight','bottomLeft','bottomCenter','topRight','topLeft','topCenter','center'],THEMES={info:{color:'blue',icon:'ico-info'},success:{color:'green',icon:'ico-success'},warning:{color:'orange',icon:'ico-warning'},error:{color:'red',icon:'ico-error'},question:{color:'yellow',icon:'ico-question'}},MOBILEWIDTH=568,CONFIG={};m.children={};var n={id:null,class:'',title:'',titleColor:'',titleSize:'',titleLineHeight:'',message:'',messageColor:'',messageSize:'',messageLineHeight:'',backgroundColor:'',theme:'dark',color:'',icon:'',iconText:'',iconColor:'',iconUrl:null,image:'',imageWidth:50,maxWidth:null,zindex:null,layout:1,balloon:false,close:true,closeOnEscape:false,closeOnClick:false,displayMode:0,position:'topRight',target:'',targetFirst:true,timeout:5000,rtl:false,animateInside:true,drag:true,pauseOnHover:true,resetOnHover:false,progressBar:true,progressBarColor:'',progressBarEasing:'linear',overlay:false,overlayClose:false,overlayColor:'rgba(0, 0, 0, 0.6)',transitionIn:'fadeInUp',transitionOut:'fadeOut',transitionInMobile:'fadeInUp',transitionOutMobile:'fadeOutDown',buttons:{},inputs:{},onOpening:function(){},onOpened:function(){},onClosing:function(){},onClosed:function(){}};if(!('remove'in Element.prototype)){Element.prototype.remove=function(){if(this.parentNode){this.parentNode.removeChild(this)}}}if(typeof window.CustomEvent!=='function'){var o=function(a,b){b=b||{bubbles:false,cancelable:false,detail:undefined};var c=document.createEvent('CustomEvent');c.initCustomEvent(a,b.bubbles,b.cancelable,b.detail);return c};o.prototype=window.Event.prototype;window.CustomEvent=o}var p=function(a,b,c){if(Object.prototype.toString.call(a)==='[object Object]'){for(var d in a){if(Object.prototype.hasOwnProperty.call(a,d)){b.call(c,a[d],d,a)}}}else{if(a){for(var i=0,len=a.length;i0){e=(distance-d)/distance;if(eMOBILEWIDTH){e.parentNode.style.transitionDelay='0.2s'}try{var h=new CustomEvent(PLUGIN_NAME+'-closing',{detail:settings,bubbles:true,cancelable:true});document.dispatchEvent(h)}catch(ex){console.warn(ex)}setTimeout(function(){e.parentNode.style.height='0px';e.parentNode.style.overflow='';setTimeout(function(){delete g.children[settings.ref];e.parentNode.remove();try{var a=new CustomEvent(PLUGIN_NAME+'-closed',{detail:settings,bubbles:true,cancelable:true});document.dispatchEvent(a)}catch(ex){console.warn(ex)}if(typeof settings.onClosed!=='undefined'){settings.onClosed.apply(null,[settings,e,f])}},1000)},200);if(typeof settings.onClosing!=='undefined'){settings.onClosing.apply(null,[settings,e,f])}};m.show=function(f){var g=this;var h=q(CONFIG,f||{});h=q(n,h);h.time={};if(h.id===null){h.id=s(h.title+h.message+h.color)}if(h.displayMode===1||h.displayMode=='once'){try{if(document.querySelectorAll('.'+PLUGIN_NAME+'#'+h.id).length>0){return false}}catch(exc){console.warn('['+PLUGIN_NAME+'] Could not find an element with this selector: '+'#'+h.id+'. Try to set an valid id.')}}if(h.displayMode===2||h.displayMode=='replace'){try{p(document.querySelectorAll('.'+PLUGIN_NAME+'#'+h.id),function(a,b){g.hide(h,a,'replaced')})}catch(exc){console.warn('['+PLUGIN_NAME+'] Could not find an element with this selector: '+'#'+h.id+'. Try to set an valid id.')}}h.ref=new Date().getTime()+Math.floor((Math.random()*10000000)+1);m.children[h.ref]=h;var i={body:document.querySelector('body'),overlay:document.createElement('div'),toast:document.createElement('div'),toastBody:document.createElement('div'),toastTexts:document.createElement('div'),toastCapsule:document.createElement('div'),cover:document.createElement('div'),buttons:document.createElement('div'),inputs:document.createElement('div'),icon:!h.iconUrl?document.createElement('i'):document.createElement('img'),wrapper:null};i.toast.setAttribute('data-iziToast-ref',h.ref);i.toast.appendChild(i.toastBody);i.toastCapsule.appendChild(i.toast);(function(){i.toast.classList.add(PLUGIN_NAME);i.toast.classList.add(PLUGIN_NAME+'-opening');i.toastCapsule.classList.add(PLUGIN_NAME+'-capsule');i.toastBody.classList.add(PLUGIN_NAME+'-body');i.toastTexts.classList.add(PLUGIN_NAME+'-texts');if(ISMOBILE||window.innerWidth<=MOBILEWIDTH){if(h.transitionInMobile)i.toast.classList.add(h.transitionInMobile)}else{if(h.transitionIn)i.toast.classList.add(h.transitionIn)}if(h.class){var c=h.class.split(' ');p(c,function(a,b){i.toast.classList.add(a)})}if(h.id){i.toast.id=h.id}if(h.rtl){i.toast.classList.add(PLUGIN_NAME+'-rtl');i.toast.setAttribute('dir','rtl')}if(h.layout>1){i.toast.classList.add(PLUGIN_NAME+'-layout'+h.layout)}if(h.balloon){i.toast.classList.add(PLUGIN_NAME+'-balloon')}if(h.maxWidth){if(!isNaN(h.maxWidth)){i.toast.style.maxWidth=h.maxWidth+'px'}else{i.toast.style.maxWidth=h.maxWidth}}if(h.theme!==''||h.theme!=='light'){i.toast.classList.add(PLUGIN_NAME+'-theme-'+h.theme)}if(h.color){if(t(h.color)){i.toast.style.background=h.color}else{i.toast.classList.add(PLUGIN_NAME+'-color-'+h.color)}}if(h.backgroundColor){i.toast.style.background=h.backgroundColor;if(h.balloon){i.toast.style.borderColor=h.backgroundColor}}})();(function(){if(h.image){i.cover.classList.add(PLUGIN_NAME+'-cover');i.cover.style.width=h.imageWidth+'px';if(u(h.image.replace(/ /g,''))){i.cover.style.backgroundImage='url(data:image/png;base64,'+h.image.replace(/ /g,'')+')'}else{i.cover.style.backgroundImage='url('+h.image+')'}if(h.rtl){i.toastBody.style.marginRight=(h.imageWidth+10)+'px'}else{i.toastBody.style.marginLeft=(h.imageWidth+10)+'px'}i.toast.appendChild(i.cover)}})();(function(){if(h.close){i.buttonClose=document.createElement('button');i.buttonClose.type='button';i.buttonClose.classList.add(PLUGIN_NAME+'-close');i.buttonClose.addEventListener('click',function(e){var a=e.target;g.hide(h,i.toast,'button')});i.toast.appendChild(i.buttonClose)}else{if(h.rtl){i.toast.style.paddingLeft='18px'}else{i.toast.style.paddingRight='18px'}}})();(function(){if(h.progressBar){i.progressBar=document.createElement('div');i.progressBarDiv=document.createElement('div');i.progressBar.classList.add(PLUGIN_NAME+'-progressbar');i.progressBarDiv.style.background=h.progressBarColor;i.progressBar.appendChild(i.progressBarDiv);i.toast.appendChild(i.progressBar)}if(h.timeout){if(h.pauseOnHover&&!h.resetOnHover){i.toast.addEventListener('mouseenter',function(e){g.progress(h,i.toast).pause()});i.toast.addEventListener('mouseleave',function(e){g.progress(h,i.toast).resume()})}if(h.resetOnHover){i.toast.addEventListener('mouseenter',function(e){g.progress(h,i.toast).reset()});i.toast.addEventListener('mouseleave',function(e){g.progress(h,i.toast).start()})}}})();(function(){if(h.iconUrl){i.icon.setAttribute('class',PLUGIN_NAME+'-icon');i.icon.setAttribute('src',h.iconUrl)}else if(h.icon){i.icon.setAttribute('class',PLUGIN_NAME+'-icon '+h.icon);if(h.iconText){i.icon.appendChild(document.createTextNode(h.iconText))}if(h.iconColor){i.icon.style.color=h.iconColor}}if(h.icon||h.iconUrl){if(h.rtl){i.toastBody.style.paddingRight='33px'}else{i.toastBody.style.paddingLeft='33px'}i.toastBody.appendChild(i.icon)}})();(function(){if(h.title.length>0){i.strong=document.createElement('strong');i.strong.classList.add(PLUGIN_NAME+'-title');i.strong.appendChild(r(h.title));i.toastTexts.appendChild(i.strong);if(h.titleColor){i.strong.style.color=h.titleColor}if(h.titleSize){if(!isNaN(h.titleSize)){i.strong.style.fontSize=h.titleSize+'px'}else{i.strong.style.fontSize=h.titleSize}}if(h.titleLineHeight){if(!isNaN(h.titleSize)){i.strong.style.lineHeight=h.titleLineHeight+'px'}else{i.strong.style.lineHeight=h.titleLineHeight}}}if(h.message.length>0){i.p=document.createElement('p');i.p.classList.add(PLUGIN_NAME+'-message');i.p.appendChild(r(h.message));i.toastTexts.appendChild(i.p);if(h.messageColor){i.p.style.color=h.messageColor}if(h.messageSize){if(!isNaN(h.titleSize)){i.p.style.fontSize=h.messageSize+'px'}else{i.p.style.fontSize=h.messageSize}}if(h.messageLineHeight){if(!isNaN(h.titleSize)){i.p.style.lineHeight=h.messageLineHeight+'px'}else{i.p.style.lineHeight=h.messageLineHeight}}}if(h.title.length>0&&h.message.length>0){if(h.rtl){i.strong.style.marginLeft='10px'}else if(h.layout!==2&&!h.rtl){i.strong.style.marginRight='10px'}}})();i.toastBody.appendChild(i.toastTexts);var j;(function(){if(h.inputs.length>0){i.inputs.classList.add(PLUGIN_NAME+'-inputs');p(h.inputs,function(b,c){i.inputs.appendChild(r(b[0]));j=i.inputs.childNodes;j[c].classList.add(PLUGIN_NAME+'-inputs-child');if(b[3]){setTimeout(function(){j[c].focus()},300)}j[c].addEventListener(b[1],function(e){var a=b[2];return a(g,i.toast,this,e)})});i.toastBody.appendChild(i.inputs)}})();(function(){if(h.buttons.length>0){i.buttons.classList.add(PLUGIN_NAME+'-buttons');p(h.buttons,function(b,c){i.buttons.appendChild(r(b[0]));var d=i.buttons.childNodes;d[c].classList.add(PLUGIN_NAME+'-buttons-child');if(b[2]){setTimeout(function(){d[c].focus()},300)}d[c].addEventListener('click',function(e){e.preventDefault();var a=b[1];return a(g,i.toast,this,e,j)})})}i.toastBody.appendChild(i.buttons)})();if(h.message.length>0&&(h.inputs.length>0||h.buttons.length>0)){i.p.style.marginBottom='0'}if(h.inputs.length>0||h.buttons.length>0){if(h.rtl){i.toastTexts.style.marginLeft='10px'}else{i.toastTexts.style.marginRight='10px'}if(h.inputs.length>0&&h.buttons.length>0){if(h.rtl){i.inputs.style.marginLeft='8px'}else{i.inputs.style.marginRight='8px'}}}(function(){i.toastCapsule.style.visibility='hidden';setTimeout(function(){var H=i.toast.offsetHeight;var a=i.toast.currentStyle||window.getComputedStyle(i.toast);var b=a.marginTop;b=b.split('px');b=parseInt(b[0]);var c=a.marginBottom;c=c.split('px');c=parseInt(c[0]);i.toastCapsule.style.visibility='';i.toastCapsule.style.height=(H+c+b)+'px';setTimeout(function(){i.toastCapsule.style.height='auto';if(h.target){i.toastCapsule.style.overflow='visible'}},500);if(h.timeout){g.progress(h,i.toast).start()}},100)})();(function(){var a=h.position;if(h.target){i.wrapper=document.querySelector(h.target);i.wrapper.classList.add(PLUGIN_NAME+'-target');if(h.targetFirst){i.wrapper.insertBefore(i.toastCapsule,i.wrapper.firstChild)}else{i.wrapper.appendChild(i.toastCapsule)}}else{if(POSITIONS.indexOf(h.position)==-1){console.warn('['+PLUGIN_NAME+'] Incorrect position.\nIt can be › '+POSITIONS);return}if(ISMOBILE||window.innerWidth<=MOBILEWIDTH){if(h.position=='bottomLeft'||h.position=='bottomRight'||h.position=='bottomCenter'){a=PLUGIN_NAME+'-wrapper-bottomCenter'}else if(h.position=='topLeft'||h.position=='topRight'||h.position=='topCenter'){a=PLUGIN_NAME+'-wrapper-topCenter'}else{a=PLUGIN_NAME+'-wrapper-center'}}else{a=PLUGIN_NAME+'-wrapper-'+a}i.wrapper=document.querySelector('.'+PLUGIN_NAME+'-wrapper.'+a);if(!i.wrapper){i.wrapper=document.createElement('div');i.wrapper.classList.add(PLUGIN_NAME+'-wrapper');i.wrapper.classList.add(a);document.body.appendChild(i.wrapper)}if(h.position=='topLeft'||h.position=='topCenter'||h.position=='topRight'){i.wrapper.insertBefore(i.toastCapsule,i.wrapper.firstChild)}else{i.wrapper.appendChild(i.toastCapsule)}}if(!isNaN(h.zindex)){i.wrapper.style.zIndex=h.zindex}else{console.warn('['+PLUGIN_NAME+'] Invalid zIndex.')}})();(function(){if(h.overlay){if(document.querySelector('.'+PLUGIN_NAME+'-overlay.fadeIn')!==null){i.overlay=document.querySelector('.'+PLUGIN_NAME+'-overlay');i.overlay.setAttribute('data-iziToast-ref',i.overlay.getAttribute('data-iziToast-ref')+','+h.ref);if(!isNaN(h.zindex)&&h.zindex!==null){i.overlay.style.zIndex=h.zindex-1}}else{i.overlay.classList.add(PLUGIN_NAME+'-overlay');i.overlay.classList.add('fadeIn');i.overlay.style.background=h.overlayColor;i.overlay.setAttribute('data-iziToast-ref',h.ref);if(!isNaN(h.zindex)&&h.zindex!==null){i.overlay.style.zIndex=h.zindex-1}document.querySelector('body').appendChild(i.overlay)}if(h.overlayClose){i.overlay.removeEventListener('click',{});i.overlay.addEventListener('click',function(e){g.hide(h,i.toast,'overlay')})}else{i.overlay.removeEventListener('click',{})}}})();(function(){if(h.animateInside){i.toast.classList.add(PLUGIN_NAME+'-animateInside');var c=[200,100,300];if(h.transitionIn=='bounceInLeft'||h.transitionIn=='bounceInRight'){c=[400,200,400]}if(h.title.length>0){setTimeout(function(){i.strong.classList.add('slideIn')},c[0])}if(h.message.length>0){setTimeout(function(){i.p.classList.add('slideIn')},c[1])}if(h.icon||h.iconUrl){setTimeout(function(){i.icon.classList.add('revealIn')},c[2])}var d=150;if(h.buttons.length>0&&i.buttons){setTimeout(function(){p(i.buttons.childNodes,function(a,b){setTimeout(function(){a.classList.add('revealIn')},d);d=d+150})},h.inputs.length>0?150:0)}if(h.inputs.length>0&&i.inputs){d=150;p(i.inputs.childNodes,function(a,b){setTimeout(function(){a.classList.add('revealIn')},d);d=d+150})}}})();h.onOpening.apply(null,[h,i.toast]);try{var k=new CustomEvent(PLUGIN_NAME+'-opening',{detail:h,bubbles:true,cancelable:true});document.dispatchEvent(k)}catch(ex){console.warn(ex)}setTimeout(function(){i.toast.classList.remove(PLUGIN_NAME+'-opening');i.toast.classList.add(PLUGIN_NAME+'-opened');try{var a=new CustomEvent(PLUGIN_NAME+'-opened',{detail:h,bubbles:true,cancelable:true});document.dispatchEvent(a)}catch(ex){console.warn(ex)}h.onOpened.apply(null,[h,i.toast])},1000);if(h.drag){if(ACCEPTSTOUCH){i.toast.addEventListener('touchstart',function(e){v.startMoving(this,g,h,e)},false);i.toast.addEventListener('touchend',function(e){v.stopMoving(this,e)},false)}else{i.toast.addEventListener('mousedown',function(e){e.preventDefault();v.startMoving(this,g,h,e)},false);i.toast.addEventListener('mouseup',function(e){e.preventDefault();v.stopMoving(this,e)},false)}}if(h.closeOnEscape){document.addEventListener('keyup',function(a){a=a||window.event;if(a.keyCode==27){g.hide(h,i.toast,'esc')}})}if(h.closeOnClick){i.toast.addEventListener('click',function(a){g.hide(h,i.toast,'toast')})}g.toast=i.toast};layui.link(layui.cache.base+'notice/notice.css');window.notice=m;l('notice',m)});