anzhiyu主题的魔改日记

本篇为博主的部分魔改安知鱼主题的重装日记,以防自己日后因魔改迷失所做记录 📝

  • 大部分方法通过外部引入,无需修改主题源文件
  • 文件路径为了便于管理会以引入文件命名文件夹
  • 部分引用魔改

FPS设置

新建文件source/custoem/fps/fps.css或在已引入的css中新增以下内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* 帧率检测 */
#fps {
position: fixed;
/* 指定位置 */
left: 10px;
bottom: 88px;
z-index: 1919810;
}
[data-theme="light"] #fps {
background-color: rgba(255, 255, 255, 0.85);
backdrop-filter: var(--backdrop-filter);
padding: 4px;
border-radius: 4px;
}
[data-theme="dark"] #fps {
background-color: rgba(0, 0, 0, 0.72);
backdrop-filter: var(--backdrop-filter);
padding: 4px;
border-radius: 4px;
}

在根目录 source 下新建文件source/custoem/fps/fps.js或在已引入的js中新增以下内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
if (window.localStorage.getItem("fpson") == undefined || window.localStorage.getItem("fpson") == "1") {
var rAF = function () {
return (
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
function (callback) {
window.setTimeout(callback, 1000 / 60);
}
);
}();
var frame = 0;
var allFrameCount = 0;
var lastTime = Date.now();
var lastFameTime = Date.now();
var loop = function () {
var now = Date.now();
var fs = (now - lastFameTime);
var fps = Math.round(1000 / fs);

lastFameTime = now;
// 不置 0,在动画的开头及结尾记录此值的差值算出 FPS
allFrameCount++;
frame++;

if (now > 1000 + lastTime) {
var fps = Math.round((frame * 1000) / (now - lastTime));
if (fps <= 5) {
var kd = `<span style="color:#bd0000">卡成ppt🤢</span>`
} else if (fps <= 15) {
var kd = `<span style="color:red">电竞级帧率😖</span>`
} else if (fps <= 25) {
var kd = `<span style="color:orange">有点难受😨</span>`
} else if (fps < 35) {
var kd = `<span style="color:#9338e6">不太流畅🙄</span>`
} else if (fps <= 45) {
var kd = `<span style="color:#08b7e4">还不错哦😁</span>`
} else {
var kd = `<span style="color:#39c5bb">十分流畅🤣</span>`
}
document.getElementById("fps").innerHTML = `FPS:${fps} ${kd}`;
frame = 0;
lastTime = now;
};

rAF(loop);
}

loop();
} else {
document.getElementById("fps").style = "display:none!important"
}

最后在_config.anzhiyu.yml主题配置文件下inject配置项中bottom处进行引用

1
2
3
4
5
6
inject:
bottom:
# FPS显示
- <span id="fps"></span>
- <link rel="stylesheet" href="/custom/fps/fps.css" media="defer" onload="this.media='all'">
- <script src="/custom/fps/fps.js"></script>

文章卡片擦亮效果

该方法由Kouseki提供:原文访问链接

操作步骤

1、新增css内容
- 新建文件source/custoem/home_link/home.css或在已引入的css中新增以下内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#recent-posts > .recent-post-item:not(a)::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 200%;
background: linear-gradient(to right, transparent, white, transparent);
transform: translateX(-200%);
transition: transform 0.5s linear;
z-index: 1;
}
#recent-posts > .recent-post-item:not(a):hover::before {
transform: translateX(100%) skewX(-60deg);
}

2、引入内容
_config.anzhiyu.yml主题配置文件下inject配置项中head
引入home.css文件

1
2
3
4
inject:
head:
# 自定义css
- <link rel="stylesheet" href="/custom/home_link/home.css"> # 首页文章卡片擦亮效果

最后 hexo 三件套即可

主题背景色

新建文件source/custoem/color/color.css或在已引入的css中新增以下内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#footer {
-webkit-backdrop-filter: saturate(100%) blur(5px);
backdrop-filter: saturate(100%) blur(5px);
border-top-left-radius: 20px;
border-top-right-radius: 20px;
color: #000
}

#footer,#footer:before {
background: hsla(0,0%,100%,.15)
}

#footer #footer-wrap,#footer #footer-wrap a {
color: #333;
}
#footer #footer-wrap{
background: transparent!important;
}

#web_bg {
background: linear-gradient(90deg,rgba(247,149,51,.1),rgba(243,112,85,.1) 15%,rgba(239,78,123,.1) 30%,rgba(161,102,171,.1) 44%,rgba(80,115,184,.1) 58%,rgba(16,152,173,.1) 72%,rgba(7,179,155,.1) 86%,rgba(109,186,130,.1))
}

_config.anzhiyu.yml主题配置文件下inject配置项中head
引入color.css文件

1
2
3
inject:
head:
- <link rel="stylesheet" href="/custom/color/color.css"> # 主题背景色

关于页面悬浮小标签

新建文件source/custoem/about-tag/about-tag.css或在已引入的css中新增以下内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
@keyframes floating {
0% {
transform: translate(0, -4px);
}
50% {
transform: translate(0, 4px);
}
100% {
transform: translate(0, -4px);
}
}

#about-page .author-box {
display: flex;
flex-direction: column;
align-items: center;
height: 185px;
}

#about-page .author-tag-left {
display: flex;
flex-direction: column;
align-items: flex-end;
margin-right: 355px; /* 设置标签与头像之间的水平间距 */
position: absolute;
top: 15px;
}

#about-page .author-tag-right {
display: flex;
flex-direction: column;
align-items: flex-start;
margin-left: 355px; /* 设置标签与头像之间的水平间距 */
position: absolute;
top: 15px;
}
/* 移动端隐藏 */
@media screen and (max-width: 768px) {
#about-page .author-tag-left, #about-page .author-tag-right {
display: none;
}
}

#about-page .author-tag-left .author-tag:first-child, #about-page .author-tag-left .author-tag:last-child {
margin-right: -16px;
}

#about-page .author-tag-right .author-tag:first-child, #about-page .author-tag-right .author-tag:last-child {
margin-left: -16px;
}

#about-page .author-tag {
transform: translate(0, -4px);
padding: 1px 8px;
background: #fff;
border: 1px solid #e3e8f7;
border-radius: 40px;
margin-top: 6px;
font-size: 14px;
font-weight: bold;
box-shadow: 0 5px 12px -5px rgba(102, 68, 68, 0.00);
animation: 4s ease-in-out 0s infinite normal none running floating;
}
/* 适配深色模式 */
[data-theme="dark"] #about-page .author-tag {
background: #1e1e1e;
}
#about-page .author-tag:nth-child(1) {
animation-delay: 0s;
}

#about-page .author-tag:nth-child(2) {
animation-delay: 0.6s;
}

#about-page .author-tag:nth-child(3) {
animation-delay: 1.2s;
}

#about-page .author-tag:nth-child(4) {
animation-delay: 1.8s;
}

_config.anzhiyu.yml主题配置文件下inject配置项中head
引入about-tag.css文件

1
2
3
inject:
head:
- <link rel="stylesheet" href="/custom/about-tag/about-tag.css"> # 关于页悬浮小标签

公祭日和节日弹框

新建文件source/custom/dayalert/day.js或在已引入的js中新增以下内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
var d = new Date();
m = d.getMonth() + 1;
dd = d.getDate();
y = d.getFullYear();

// 公祭日
if (m == 9 && dd == 18) {
document.getElementsByTagName("html")[0].setAttribute("style", "filter: grayscale(60%);");
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("今天是九一八事变" + (y - 1931).toString() + "周年纪念日\n🪔勿忘国耻,振兴中华🪔");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if (m == 7 && dd == 7) {
document.getElementsByTagName("html")[0].setAttribute("style", "filter: grayscale(60%);");
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("今天是卢沟桥事变" + (y - 1937).toString() + "周年纪念日\n🪔勿忘国耻,振兴中华🪔");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if (m == 12 && dd == 13) {
document.getElementsByTagName("html")[0].setAttribute("style", "filter: grayscale(60%);");
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("今天是南京大屠杀" + (y - 1937).toString() + "周年纪念日\n🪔勿忘国耻,振兴中华🪔");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if (m == 8 && dd == 14) {
document.getElementsByTagName("html")[0].setAttribute("style", "filter: grayscale(60%);");
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("今天是世界慰安妇纪念日\n🪔勿忘国耻,振兴中华🪔");
sessionStorage.setItem("isPopupWindow", "1");
}
}


// 节假日
if (m == 10 && dd <= 3) {//国庆节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("祝祖国" + (y - 1949).toString() + "岁生日快乐!");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if (m == 8 && dd == 15) {//搞来玩的,小日子投降
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("小日子已经投降" + (y - 1945).toString() + "年了😃");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if (m == 1 && dd == 1) {//元旦节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire(y.toString() + "年元旦快乐!🎉");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if (m == 3 && dd == 8) {//妇女节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("各位女神们,妇女节快乐!👩");
sessionStorage.setItem("isPopupWindow", "1");
}
}
l = ["非常抱歉,因为不可控原因,博客将于明天停止运营!", "好消息,日本没了!", "美国垮了,原因竟然是川普!", "微软垮了!", "你的电脑已经过载,建议立即关机!", "你知道吗?站长很喜欢你哦!", "一分钟有61秒哦", "你喜欢的人跟别人跑了!"]
if (m == 4 && dd == 1) {//愚人节,随机谎话
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire(l[Math.floor(Math.random() * l.length)]);
sessionStorage.setItem("isPopupWindow", "1");
}
}
if (m == 5 && dd == 1) {//劳动节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("劳动节快乐\n为各行各业辛勤工作的人们致敬!");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if (m == 5 && dd == 4) {//青年节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("青年节快乐\n青春不是回忆逝去,而是把握现在!");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if (m == 5 && dd == 20) {//520
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("今年是520情人节\n快和你喜欢的人一起过吧!💑");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if (m == 7 && dd == 1) {//建党节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("祝中国共产党" + (y - 1921).toString() + "岁生日快乐!");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if (m == 9 && dd == 10) {//教师节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("各位老师们教师节快乐!👩‍🏫");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if (m == 12 && dd == 25) {//圣诞节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("圣诞节快乐!🎄");
sessionStorage.setItem("isPopupWindow", "1");
}
}

//传统节日部分

if ((y == 2023 && m == 4 && dd == 5) || (y == 2024 && m == 4 && dd == 4) || (y == 2025 && m == 4 && dd == 4)) {//清明节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("清明时节雨纷纷,一束鲜花祭故人💐");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if ((y == 2023 && m == 12 && dd == 22) || (y == 2024 && m == 12 && dd == 21) || (y == 2025 && m == 12 && dd == 21)) {//冬至
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("冬至快乐\n快吃上一碗热热的汤圆和饺子吧🧆");
sessionStorage.setItem("isPopupWindow", "1");
}
}

var lunar = calendarFormatter.solar2lunar();

//农历采用汉字计算,防止出现闰月导致问题

if ((lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "初六") || (lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "初五") || (lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "初四") || (lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "初三") || (lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "初二") || (lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "初一") || (lunar["IMonthCn"] == "腊月" && lunar["IDayCn"] == "三十") || (lunar["IMonthCn"] == "腊月" && lunar["IDayCn"] == "廿九")) {
//春节,本来只有大年三十到初六,但是有时候除夕是大年二十九,所以也加上了
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire(y.toString() + "年新年快乐\n🎊祝你心想事成,诸事顺利🎊");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if ((lunar["IMonthCn"] == "正月" && lunar["IDayCn"] == "十五")) {
//元宵节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("元宵节快乐\n送你一个大大的灯笼🧅");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if ((lunar["IMonthCn"] == "五月" && lunar["IDayCn"] == "初五")) {
//端午节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("端午节快乐\n请你吃一条粽子🍙");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if ((lunar["IMonthCn"] == "七月" && lunar["IDayCn"] == "初七")) {
//七夕节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("七夕节快乐\n黄昏后,柳梢头,牛郎织女来碰头");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if ((lunar["IMonthCn"] == "八月" && lunar["IDayCn"] == "十五")) {
//中秋节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("中秋节快乐\n请你吃一块月饼🍪");
sessionStorage.setItem("isPopupWindow", "1");
}
}
if ((lunar["IMonthCn"] == "九月" && lunar["IDayCn"] == "初九")) {
//重阳节
if (sessionStorage.getItem("isPopupWindow") != "1") {
Swal.fire("重阳节快乐\n独在异乡为异客,每逢佳节倍思亲");
sessionStorage.setItem("isPopupWindow", "1");
}
}

// 切换主题提醒
// if (y == 2022 && m == 12 && (dd >= 18 && dd <= 20)) {
// if (sessionStorage.getItem("isPopupWindow") != "1") {
// Swal.fire("网站换成冬日限定主题啦⛄");
// sessionStorage.setItem("isPopupWindow", "1");
// }
// }

新建文件source/custom/dayalert/lunar.js或在已引入的js中新增以下内容

1
2
var lunarInfo = [19416, 19168, 42352, 21717, 53856, 55632, 91476, 22176, 39632, 21970, 19168, 42422, 42192, 53840, 119381, 46400, 54944, 44450, 38320, 84343, 18800, 42160, 46261, 27216, 27968, 109396, 11104, 38256, 21234, 18800, 25958, 54432, 59984, 28309, 23248, 11104, 100067, 37600, 116951, 51536, 54432, 120998, 46416, 22176, 107956, 9680, 37584, 53938, 43344, 46423, 27808, 46416, 86869, 19872, 42416, 83315, 21168, 43432, 59728, 27296, 44710, 43856, 19296, 43748, 42352, 21088, 62051, 55632, 23383, 22176, 38608, 19925, 19152, 42192, 54484, 53840, 54616, 46400, 46752, 103846, 38320, 18864, 43380, 42160, 45690, 27216, 27968, 44870, 43872, 38256, 19189, 18800, 25776, 29859, 59984, 27480, 23232, 43872, 38613, 37600, 51552, 55636, 54432, 55888, 30034, 22176, 43959, 9680, 37584, 51893, 43344, 46240, 47780, 44368, 21977, 19360, 42416, 86390, 21168, 43312, 31060, 27296, 44368, 23378, 19296, 42726, 42208, 53856, 60005, 54576, 23200, 30371, 38608, 19195, 19152, 42192, 118966, 53840, 54560, 56645, 46496, 22224, 21938, 18864, 42359, 42160, 43600, 111189, 27936, 44448, 84835, 37744, 18936, 18800, 25776, 92326, 59984, 27424, 108228, 43744, 41696, 53987, 51552, 54615, 54432, 55888, 23893, 22176, 42704, 21972, 21200, 43448, 43344, 46240, 46758, 44368, 21920, 43940, 42416, 21168, 45683, 26928, 29495, 27296, 44368, 84821, 19296, 42352, 21732, 53600, 59752, 54560, 55968, 92838, 22224, 19168, 43476, 41680, 53584, 62034, 54560], solarMonth = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Gan = ["甲", "乙", "丙", "丁", "戊", "己", "庚", "辛", "壬", "癸"], Zhi = ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"], Animals = ["鼠", "牛", "虎", "兔", "龙", "蛇", "马", "羊", "猴", "鸡", "狗", "猪"], solarTerm = ["小寒", "大寒", "立春", "雨水", "惊蛰", "春分", "清明", "谷雨", "立夏", "小满", "芒种", "夏至", "小暑", "大暑", "立秋", "处暑", "白露", "秋分", "寒露", "霜降", "立冬", "小雪", "大雪", "冬至"], sTermInfo = ["9778397bd097c36b0b6fc9274c91aa", "97b6b97bd19801ec9210c965cc920e", "97bcf97c3598082c95f8c965cc920f", "97bd0b06bdb0722c965ce1cfcc920f", "b027097bd097c36b0b6fc9274c91aa", "97b6b97bd19801ec9210c965cc920e", "97bcf97c359801ec95f8c965cc920f", "97bd0b06bdb0722c965ce1cfcc920f", "b027097bd097c36b0b6fc9274c91aa", "97b6b97bd19801ec9210c965cc920e", "97bcf97c359801ec95f8c965cc920f", "97bd0b06bdb0722c965ce1cfcc920f", "b027097bd097c36b0b6fc9274c91aa", "9778397bd19801ec9210c965cc920e", "97b6b97bd19801ec95f8c965cc920f", "97bd09801d98082c95f8e1cfcc920f", "97bd097bd097c36b0b6fc9210c8dc2", "9778397bd197c36c9210c9274c91aa", "97b6b97bd19801ec95f8c965cc920e", "97bd09801d98082c95f8e1cfcc920f", "97bd097bd097c36b0b6fc9210c8dc2", "9778397bd097c36c9210c9274c91aa", "97b6b97bd19801ec95f8c965cc920e", "97bcf97c3598082c95f8e1cfcc920f", "97bd097bd097c36b0b6fc9210c8dc2", "9778397bd097c36c9210c9274c91aa", "97b6b97bd19801ec9210c965cc920e", "97bcf97c3598082c95f8c965cc920f", "97bd097bd097c35b0b6fc920fb0722", "9778397bd097c36b0b6fc9274c91aa", "97b6b97bd19801ec9210c965cc920e", "97bcf97c3598082c95f8c965cc920f", "97bd097bd097c35b0b6fc920fb0722", "9778397bd097c36b0b6fc9274c91aa", "97b6b97bd19801ec9210c965cc920e", "97bcf97c359801ec95f8c965cc920f", "97bd097bd097c35b0b6fc920fb0722", "9778397bd097c36b0b6fc9274c91aa", "97b6b97bd19801ec9210c965cc920e", "97bcf97c359801ec95f8c965cc920f", "97bd097bd097c35b0b6fc920fb0722", "9778397bd097c36b0b6fc9274c91aa", "97b6b97bd19801ec9210c965cc920e", "97bcf97c359801ec95f8c965cc920f", "97bd097bd07f595b0b6fc920fb0722", "9778397bd097c36b0b6fc9210c8dc2", "9778397bd19801ec9210c9274c920e", "97b6b97bd19801ec95f8c965cc920f", "97bd07f5307f595b0b0bc920fb0722", "7f0e397bd097c36b0b6fc9210c8dc2", "9778397bd097c36c9210c9274c920e", "97b6b97bd19801ec95f8c965cc920f", "97bd07f5307f595b0b0bc920fb0722", "7f0e397bd097c36b0b6fc9210c8dc2", "9778397bd097c36c9210c9274c91aa", "97b6b97bd19801ec9210c965cc920e", "97bd07f1487f595b0b0bc920fb0722", "7f0e397bd097c36b0b6fc9210c8dc2", "9778397bd097c36b0b6fc9274c91aa", "97b6b97bd19801ec9210c965cc920e", "97bcf7f1487f595b0b0bb0b6fb0722", "7f0e397bd097c35b0b6fc920fb0722", "9778397bd097c36b0b6fc9274c91aa", "97b6b97bd19801ec9210c965cc920e", "97bcf7f1487f595b0b0bb0b6fb0722", "7f0e397bd097c35b0b6fc920fb0722", "9778397bd097c36b0b6fc9274c91aa", "97b6b97bd19801ec9210c965cc920e", "97bcf7f1487f531b0b0bb0b6fb0722", "7f0e397bd097c35b0b6fc920fb0722", "9778397bd097c36b0b6fc9274c91aa", "97b6b97bd19801ec9210c965cc920e", "97bcf7f1487f531b0b0bb0b6fb0722", "7f0e397bd07f595b0b6fc920fb0722", "9778397bd097c36b0b6fc9274c91aa", "97b6b97bd19801ec9210c9274c920e", "97bcf7f0e47f531b0b0bb0b6fb0722", "7f0e397bd07f595b0b0bc920fb0722", "9778397bd097c36b0b6fc9210c91aa", "97b6b97bd197c36c9210c9274c920e", "97bcf7f0e47f531b0b0bb0b6fb0722", "7f0e397bd07f595b0b0bc920fb0722", "9778397bd097c36b0b6fc9210c8dc2", "9778397bd097c36c9210c9274c920e", "97b6b7f0e47f531b0723b0b6fb0722", "7f0e37f5307f595b0b0bc920fb0722", "7f0e397bd097c36b0b6fc9210c8dc2", "9778397bd097c36b0b70c9274c91aa", "97b6b7f0e47f531b0723b0b6fb0721", "7f0e37f1487f595b0b0bb0b6fb0722", "7f0e397bd097c35b0b6fc9210c8dc2", "9778397bd097c36b0b6fc9274c91aa", "97b6b7f0e47f531b0723b0b6fb0721", "7f0e27f1487f595b0b0bb0b6fb0722", "7f0e397bd097c35b0b6fc920fb0722", "9778397bd097c36b0b6fc9274c91aa", "97b6b7f0e47f531b0723b0b6fb0721", "7f0e27f1487f531b0b0bb0b6fb0722", "7f0e397bd097c35b0b6fc920fb0722", "9778397bd097c36b0b6fc9274c91aa", "97b6b7f0e47f531b0723b0b6fb0721", "7f0e27f1487f531b0b0bb0b6fb0722", "7f0e397bd097c35b0b6fc920fb0722", "9778397bd097c36b0b6fc9274c91aa", "97b6b7f0e47f531b0723b0b6fb0721", "7f0e27f1487f531b0b0bb0b6fb0722", "7f0e397bd07f595b0b0bc920fb0722", "9778397bd097c36b0b6fc9274c91aa", "97b6b7f0e47f531b0723b0787b0721", "7f0e27f0e47f531b0b0bb0b6fb0722", "7f0e397bd07f595b0b0bc920fb0722", "9778397bd097c36b0b6fc9210c91aa", "97b6b7f0e47f149b0723b0787b0721", "7f0e27f0e47f531b0723b0b6fb0722", "7f0e397bd07f595b0b0bc920fb0722", "9778397bd097c36b0b6fc9210c8dc2", "977837f0e37f149b0723b0787b0721", "7f07e7f0e47f531b0723b0b6fb0722", "7f0e37f5307f595b0b0bc920fb0722", "7f0e397bd097c35b0b6fc9210c8dc2", "977837f0e37f14998082b0787b0721", "7f07e7f0e47f531b0723b0b6fb0721", "7f0e37f1487f595b0b0bb0b6fb0722", "7f0e397bd097c35b0b6fc9210c8dc2", "977837f0e37f14998082b0787b06bd", "7f07e7f0e47f531b0723b0b6fb0721", "7f0e27f1487f531b0b0bb0b6fb0722", "7f0e397bd097c35b0b6fc920fb0722", "977837f0e37f14998082b0787b06bd", "7f07e7f0e47f531b0723b0b6fb0721", "7f0e27f1487f531b0b0bb0b6fb0722", "7f0e397bd097c35b0b6fc920fb0722", "977837f0e37f14998082b0787b06bd", "7f07e7f0e47f531b0723b0b6fb0721", "7f0e27f1487f531b0b0bb0b6fb0722", "7f0e397bd07f595b0b0bc920fb0722", "977837f0e37f14998082b0787b06bd", "7f07e7f0e47f531b0723b0b6fb0721", "7f0e27f1487f531b0b0bb0b6fb0722", "7f0e397bd07f595b0b0bc920fb0722", "977837f0e37f14998082b0787b06bd", "7f07e7f0e47f149b0723b0787b0721", "7f0e27f0e47f531b0b0bb0b6fb0722", "7f0e397bd07f595b0b0bc920fb0722", "977837f0e37f14998082b0723b06bd", "7f07e7f0e37f149b0723b0787b0721", "7f0e27f0e47f531b0723b0b6fb0722", "7f0e397bd07f595b0b0bc920fb0722", "977837f0e37f14898082b0723b02d5", "7ec967f0e37f14998082b0787b0721", "7f07e7f0e47f531b0723b0b6fb0722", "7f0e37f1487f595b0b0bb0b6fb0722", "7f0e37f0e37f14898082b0723b02d5", "7ec967f0e37f14998082b0787b0721", "7f07e7f0e47f531b0723b0b6fb0722", "7f0e37f1487f531b0b0bb0b6fb0722", "7f0e37f0e37f14898082b0723b02d5", "7ec967f0e37f14998082b0787b06bd", "7f07e7f0e47f531b0723b0b6fb0721", "7f0e37f1487f531b0b0bb0b6fb0722", "7f0e37f0e37f14898082b072297c35", "7ec967f0e37f14998082b0787b06bd", "7f07e7f0e47f531b0723b0b6fb0721", "7f0e27f1487f531b0b0bb0b6fb0722", "7f0e37f0e37f14898082b072297c35", "7ec967f0e37f14998082b0787b06bd", "7f07e7f0e47f531b0723b0b6fb0721", "7f0e27f1487f531b0b0bb0b6fb0722", "7f0e37f0e366aa89801eb072297c35", "7ec967f0e37f14998082b0787b06bd", "7f07e7f0e47f149b0723b0787b0721", "7f0e27f1487f531b0b0bb0b6fb0722", "7f0e37f0e366aa89801eb072297c35", "7ec967f0e37f14998082b0723b06bd", "7f07e7f0e47f149b0723b0787b0721", "7f0e27f0e47f531b0723b0b6fb0722", "7f0e37f0e366aa89801eb072297c35", "7ec967f0e37f14998082b0723b06bd", "7f07e7f0e37f14998083b0787b0721", "7f0e27f0e47f531b0723b0b6fb0722", "7f0e37f0e366aa89801eb072297c35", "7ec967f0e37f14898082b0723b02d5", "7f07e7f0e37f14998082b0787b0721", "7f07e7f0e47f531b0723b0b6fb0722", "7f0e36665b66aa89801e9808297c35", "665f67f0e37f14898082b0723b02d5", "7ec967f0e37f14998082b0787b0721", "7f07e7f0e47f531b0723b0b6fb0722", "7f0e36665b66a449801e9808297c35", "665f67f0e37f14898082b0723b02d5", "7ec967f0e37f14998082b0787b06bd", "7f07e7f0e47f531b0723b0b6fb0721", "7f0e36665b66a449801e9808297c35", "665f67f0e37f14898082b072297c35", "7ec967f0e37f14998082b0787b06bd", "7f07e7f0e47f531b0723b0b6fb0721", "7f0e26665b66a449801e9808297c35", "665f67f0e37f1489801eb072297c35", "7ec967f0e37f14998082b0787b06bd", "7f07e7f0e47f531b0723b0b6fb0721", "7f0e27f1487f531b0b0bb0b6fb0722"], nStr1 = ["日", "一", "二", "三", "四", "五", "六", "七", "八", "九", "十"], nStr2 = ["初", "十", "廿", "卅"], nStr3 = ["正", "二", "三", "四", "五", "六", "七", "八", "九", "十", "冬", "腊"]; function lYearDays(b) { var f, c = 348; for (f = 32768; f > 8; f >>= 1)c += lunarInfo[b - 1900] & f ? 1 : 0; return c + leapDays(b) } function leapMonth(b) { return 15 & lunarInfo[b - 1900] } function leapDays(b) { return leapMonth(b) ? 65536 & lunarInfo[b - 1900] ? 30 : 29 : 0 } function monthDays(b, f) { return f > 12 || f < 1 ? -1 : lunarInfo[b - 1900] & 65536 >> f ? 30 : 29 } function solarDays(b, f) { if (f > 12 || f < 1) return -1; var c = f - 1; return 1 === c ? b % 4 == 0 && b % 100 != 0 || b % 400 == 0 ? 29 : 28 : solarMonth[c] } function toGanZhiYear(b) { var f = (b - 3) % 10, c = (b - 3) % 12; return 0 === f && (f = 10), 0 === c && (c = 12), Gan[f - 1] + Zhi[c - 1] } function toAstro(b, f) { return "魔羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手魔羯".substr(2 * b - (f < [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22][b - 1] ? 2 : 0), 2) + "座" } function toGanZhi(b) { return Gan[b % 10] + Zhi[b % 12] } function getTerm(b, f) { if (b < 1900 || b > 2100) return -1; if (f < 1 || f > 24) return -1; var c = sTermInfo[b - 1900], e = [parseInt("0x" + c.substr(0, 5)).toString(), parseInt("0x" + c.substr(5, 5)).toString(), parseInt("0x" + c.substr(10, 5)).toString(), parseInt("0x" + c.substr(15, 5)).toString(), parseInt("0x" + c.substr(20, 5)).toString(), parseInt("0x" + c.substr(25, 5)).toString()], a = [e[0].substr(0, 1), e[0].substr(1, 2), e[0].substr(3, 1), e[0].substr(4, 2), e[1].substr(0, 1), e[1].substr(1, 2), e[1].substr(3, 1), e[1].substr(4, 2), e[2].substr(0, 1), e[2].substr(1, 2), e[2].substr(3, 1), e[2].substr(4, 2), e[3].substr(0, 1), e[3].substr(1, 2), e[3].substr(3, 1), e[3].substr(4, 2), e[4].substr(0, 1), e[4].substr(1, 2), e[4].substr(3, 1), e[4].substr(4, 2), e[5].substr(0, 1), e[5].substr(1, 2), e[5].substr(3, 1), e[5].substr(4, 2)]; return parseInt(a[f - 1]) } function toChinaMonth(b) { if (b > 12 || b < 1) return -1; var f = nStr3[b - 1]; return f += "月" } function toChinaDay(b) { var f; switch (b) { case 10: f = "初十"; break; case 20: f = "二十"; break; case 30: f = "三十"; break; default: f = nStr2[Math.floor(b / 10)], f += nStr1[b % 10] }return f } function getAnimal(b) { return Animals[(b - 4) % 12] } function solar2lunar(b, f, c) { if (b < 1900 || b > 2100) return -1; if (1900 === b && 1 === f && c < 31) return -1; var e, a, r = null, t = 0; b = (r = b ? new Date(b, parseInt(f) - 1, c) : new Date).getFullYear(), f = r.getMonth() + 1, c = r.getDate(); var d = (Date.UTC(r.getFullYear(), r.getMonth(), r.getDate()) - Date.UTC(1900, 0, 31)) / 864e5; for (e = 1900; e < 2101 && d > 0; e++)d -= t = lYearDays(e); d < 0 && (d += t, e--); var n = new Date, s = !1; n.getFullYear() === b && n.getMonth() + 1 === f && n.getDate() === c && (s = !0); var u = r.getDay(), o = nStr1[u]; 0 === u && (u = 7); var l = e; a = leapMonth(e); var i = !1; for (e = 1; e < 13 && d > 0; e++)a > 0 && e === a + 1 && !1 === i ? (--e, i = !0, t = leapDays(l)) : t = monthDays(l, e), !0 === i && e === a + 1 && (i = !1), d -= t; 0 === d && a > 0 && e === a + 1 && (i ? i = !1 : (i = !0, --e)), d < 0 && (d += t, --e); var h = e, D = d + 1, g = f - 1, v = toGanZhiYear(l), y = getTerm(b, 2 * f - 1), m = getTerm(b, 2 * f), p = toGanZhi(12 * (b - 1900) + f + 11); c >= y && (p = toGanZhi(12 * (b - 1900) + f + 12)); var M = !1, T = null; y === c && (M = !0, T = solarTerm[2 * f - 2]), m === c && (M = !0, T = solarTerm[2 * f - 1]); var I = toGanZhi(Date.UTC(b, g, 1, 0, 0, 0, 0) / 864e5 + 25567 + 10 + c - 1), C = toAstro(f, c); return { lYear: l, lMonth: h, lDay: D, Animal: getAnimal(l), IMonthCn: (i ? "闰" : "") + toChinaMonth(h), IDayCn: toChinaDay(D), cYear: b, cMonth: f, cDay: c, gzYear: v, gzMonth: p, gzDay: I, isToday: s, isLeap: i, nWeek: u, ncWeek: "星期" + o, isTerm: M, Term: T, astro: C } } var calendarFormatter = { solar2lunar: function (b, f, c) { return solar2lunar(b, f, c) }, lunar2solar: function (b, f, c, e) { if ((e = !!e) && leapMonth !== f) return -1; if (2100 === b && 12 === f && c > 1 || 1900 === b && 1 === f && c < 31) return -1; var a = monthDays(b, f), r = a; if (e && (r = leapDays(b, f)), b < 1900 || b > 2100 || c > r) return -1; for (var t = 0, d = 1900; d < b; d++)t += lYearDays(d); var n = 0, s = !1; for (d = 1; d < f; d++)n = leapMonth(b), s || n <= d && n > 0 && (t += leapDays(b), s = !0), t += monthDays(b, d); e && (t += a); var u = Date.UTC(1900, 1, 30, 0, 0, 0), o = new Date(864e5 * (t + c - 31) + u); return solar2lunar(o.getUTCFullYear(), o.getUTCMonth() + 1, o.getUTCDate()) } };

新建文件source/custom/dayalert/sweetalert2.all.js或在已引入的js中新增以下内容

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
/*!
* sweetalert2 v8.19.0
* Released under the MIT License.
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
(global.Sweetalert2 = factory());
}(this, (function () { 'use strict';

function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}

return _typeof(obj);
}

function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}

function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}

function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}

function _extends() {
_extends = Object.assign || function (target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];

for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}

return target;
};

return _extends.apply(this, arguments);
}

function _inherits(subClass, superClass) {
if (typeof superClass !== "function" && superClass !== null) {
throw new TypeError("Super expression must either be null or a function");
}

subClass.prototype = Object.create(superClass && superClass.prototype, {
constructor: {
value: subClass,
writable: true,
configurable: true
}
});
if (superClass) _setPrototypeOf(subClass, superClass);
}

function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}

function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};

return _setPrototypeOf(o, p);
}

function isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;

try {
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
return true;
} catch (e) {
return false;
}
}

function _construct(Parent, args, Class) {
if (isNativeReflectConstruct()) {
_construct = Reflect.construct;
} else {
_construct = function _construct(Parent, args, Class) {
var a = [null];
a.push.apply(a, args);
var Constructor = Function.bind.apply(Parent, a);
var instance = new Constructor();
if (Class) _setPrototypeOf(instance, Class.prototype);
return instance;
};
}

return _construct.apply(null, arguments);
}

function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}

return self;
}

function _possibleConstructorReturn(self, call) {
if (call && (typeof call === "object" || typeof call === "function")) {
return call;
}

return _assertThisInitialized(self);
}

function _superPropBase(object, property) {
while (!Object.prototype.hasOwnProperty.call(object, property)) {
object = _getPrototypeOf(object);
if (object === null) break;
}

return object;
}

function _get(target, property, receiver) {
if (typeof Reflect !== "undefined" && Reflect.get) {
_get = Reflect.get;
} else {
_get = function _get(target, property, receiver) {
var base = _superPropBase(target, property);

if (!base) return;
var desc = Object.getOwnPropertyDescriptor(base, property);

if (desc.get) {
return desc.get.call(receiver);
}

return desc.value;
};
}

return _get(target, property, receiver || target);
}

var consolePrefix = 'SweetAlert2:';
/**
* Filter the unique values into a new array
* @param arr
*/

var uniqueArray = function uniqueArray(arr) {
var result = [];

for (var i = 0; i < arr.length; i++) {
if (result.indexOf(arr[i]) === -1) {
result.push(arr[i]);
}
}

return result;
};
/**
* Returns the array ob object values (Object.values isn't supported in IE11)
* @param obj
*/

var objectValues = function objectValues(obj) {
return Object.keys(obj).map(function (key) {
return obj[key];
});
};
/**
* Convert NodeList to Array
* @param nodeList
*/

var toArray = function toArray(nodeList) {
return Array.prototype.slice.call(nodeList);
};
/**
* Standardise console warnings
* @param message
*/

var warn = function warn(message) {
console.warn("".concat(consolePrefix, " ").concat(message));
};
/**
* Standardise console errors
* @param message
*/

var error = function error(message) {
console.error("".concat(consolePrefix, " ").concat(message));
};
/**
* Private global state for `warnOnce`
* @type {Array}
* @private
*/

var previousWarnOnceMessages = [];
/**
* Show a console warning, but only if it hasn't already been shown
* @param message
*/

var warnOnce = function warnOnce(message) {
if (!(previousWarnOnceMessages.indexOf(message) !== -1)) {
previousWarnOnceMessages.push(message);
warn(message);
}
};
/**
* Show a one-time console warning about deprecated params/methods
*/

var warnAboutDepreation = function warnAboutDepreation(deprecatedParam, useInstead) {
warnOnce("\"".concat(deprecatedParam, "\" is deprecated and will be removed in the next major release. Please use \"").concat(useInstead, "\" instead."));
};
/**
* If `arg` is a function, call it (with no arguments or context) and return the result.
* Otherwise, just pass the value through
* @param arg
*/

var callIfFunction = function callIfFunction(arg) {
return typeof arg === 'function' ? arg() : arg;
};
var isPromise = function isPromise(arg) {
return arg && Promise.resolve(arg) === arg;
};

var DismissReason = Object.freeze({
cancel: 'cancel',
backdrop: 'backdrop',
close: 'close',
esc: 'esc',
timer: 'timer'
});

var argsToParams = function argsToParams(args) {
var params = {};

switch (_typeof(args[0])) {
case 'object':
_extends(params, args[0]);

break;

default:
['title', 'html', 'type'].forEach(function (name, index) {
switch (_typeof(args[index])) {
case 'string':
params[name] = args[index];
break;

case 'undefined':
break;

default:
error("Unexpected type of ".concat(name, "! Expected \"string\", got ").concat(_typeof(args[index])));
}
});
}

return params;
};

var swalPrefix = 'swal2-';
var prefix = function prefix(items) {
var result = {};

for (var i in items) {
result[items[i]] = swalPrefix + items[i];
}

return result;
};
var swalClasses = prefix(['container', 'shown', 'height-auto', 'iosfix', 'popup', 'modal', 'no-backdrop', 'toast', 'toast-shown', 'toast-column', 'show', 'hide', 'noanimation', 'close', 'title', 'header', 'content', 'actions', 'confirm', 'cancel', 'footer', 'icon', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'label', 'textarea', 'inputerror', 'validation-message', 'progress-steps', 'active-progress-step', 'progress-step', 'progress-step-line', 'loading', 'styled', 'top', 'top-start', 'top-end', 'top-left', 'top-right', 'center', 'center-start', 'center-end', 'center-left', 'center-right', 'bottom', 'bottom-start', 'bottom-end', 'bottom-left', 'bottom-right', 'grow-row', 'grow-column', 'grow-fullscreen', 'rtl']);
var iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']);

var states = {
previousBodyPadding: null
};
var hasClass = function hasClass(elem, className) {
return elem.classList.contains(className);
};

var removeCustomClasses = function removeCustomClasses(elem) {
toArray(elem.classList).forEach(function (className) {
if (!(objectValues(swalClasses).indexOf(className) !== -1) && !(objectValues(iconTypes).indexOf(className) !== -1)) {
elem.classList.remove(className);
}
});
};

var applyCustomClass = function applyCustomClass(elem, customClass, className) {
removeCustomClasses(elem);

if (customClass && customClass[className]) {
if (typeof customClass[className] !== 'string' && !customClass[className].forEach) {
return warn("Invalid type of customClass.".concat(className, "! Expected string or iterable object, got \"").concat(_typeof(customClass[className]), "\""));
}

addClass(elem, customClass[className]);
}
};
function getInput(content, inputType) {
if (!inputType) {
return null;
}

switch (inputType) {
case 'select':
case 'textarea':
case 'file':
return getChildByClass(content, swalClasses[inputType]);

case 'checkbox':
return content.querySelector(".".concat(swalClasses.checkbox, " input"));

case 'radio':
return content.querySelector(".".concat(swalClasses.radio, " input:checked")) || content.querySelector(".".concat(swalClasses.radio, " input:first-child"));

case 'range':
return content.querySelector(".".concat(swalClasses.range, " input"));

default:
return getChildByClass(content, swalClasses.input);
}
}
var focusInput = function focusInput(input) {
input.focus(); // place cursor at end of text in text input

if (input.type !== 'file') {
// http://stackoverflow.com/a/2345915
var val = input.value;
input.value = '';
input.value = val;
}
};
var toggleClass = function toggleClass(target, classList, condition) {
if (!target || !classList) {
return;
}

if (typeof classList === 'string') {
classList = classList.split(/\s+/).filter(Boolean);
}

classList.forEach(function (className) {
if (target.forEach) {
target.forEach(function (elem) {
condition ? elem.classList.add(className) : elem.classList.remove(className);
});
} else {
condition ? target.classList.add(className) : target.classList.remove(className);
}
});
};
var addClass = function addClass(target, classList) {
toggleClass(target, classList, true);
};
var removeClass = function removeClass(target, classList) {
toggleClass(target, classList, false);
};
var getChildByClass = function getChildByClass(elem, className) {
for (var i = 0; i < elem.childNodes.length; i++) {
if (hasClass(elem.childNodes[i], className)) {
return elem.childNodes[i];
}
}
};
var applyNumericalStyle = function applyNumericalStyle(elem, property, value) {
if (value || parseInt(value) === 0) {
elem.style[property] = typeof value === 'number' ? value + 'px' : value;
} else {
elem.style.removeProperty(property);
}
};
var show = function show(elem) {
var display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'flex';
elem.style.opacity = '';
elem.style.display = display;
};
var hide = function hide(elem) {
elem.style.opacity = '';
elem.style.display = 'none';
};
var toggle = function toggle(elem, condition, display) {
condition ? show(elem, display) : hide(elem);
}; // borrowed from jquery $(elem).is(':visible') implementation

var isVisible = function isVisible(elem) {
return !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length));
};
var isScrollable = function isScrollable(elem) {
return !!(elem.scrollHeight > elem.clientHeight);
}; // borrowed from https://stackoverflow.com/a/46352119

var hasCssAnimation = function hasCssAnimation(elem) {
var style = window.getComputedStyle(elem);
var animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0');
var transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0');
return animDuration > 0 || transDuration > 0;
};
var contains = function contains(haystack, needle) {
if (typeof haystack.contains === 'function') {
return haystack.contains(needle);
}
};

var getContainer = function getContainer() {
return document.body.querySelector('.' + swalClasses.container);
};
var elementBySelector = function elementBySelector(selectorString) {
var container = getContainer();
return container ? container.querySelector(selectorString) : null;
};

var elementByClass = function elementByClass(className) {
return elementBySelector('.' + className);
};

var getPopup = function getPopup() {
return elementByClass(swalClasses.popup);
};
var getIcons = function getIcons() {
var popup = getPopup();
return toArray(popup.querySelectorAll('.' + swalClasses.icon));
};
var getIcon = function getIcon() {
var visibleIcon = getIcons().filter(function (icon) {
return isVisible(icon);
});
return visibleIcon.length ? visibleIcon[0] : null;
};
var getTitle = function getTitle() {
return elementByClass(swalClasses.title);
};
var getContent = function getContent() {
return elementByClass(swalClasses.content);
};
var getImage = function getImage() {
return elementByClass(swalClasses.image);
};
var getProgressSteps = function getProgressSteps() {
return elementByClass(swalClasses['progress-steps']);
};
var getValidationMessage = function getValidationMessage() {
return elementByClass(swalClasses['validation-message']);
};
var getConfirmButton = function getConfirmButton() {
return elementBySelector('.' + swalClasses.actions + ' .' + swalClasses.confirm);
};
var getCancelButton = function getCancelButton() {
return elementBySelector('.' + swalClasses.actions + ' .' + swalClasses.cancel);
};
var getActions = function getActions() {
return elementByClass(swalClasses.actions);
};
var getHeader = function getHeader() {
return elementByClass(swalClasses.header);
};
var getFooter = function getFooter() {
return elementByClass(swalClasses.footer);
};
var getCloseButton = function getCloseButton() {
return elementByClass(swalClasses.close);
}; // https://github.com/jkup/focusable/blob/master/index.js

var focusable = "\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex=\"0\"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n";
var getFocusableElements = function getFocusableElements() {
var focusableElementsWithTabindex = toArray(getPopup().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')) // sort according to tabindex
.sort(function (a, b) {
a = parseInt(a.getAttribute('tabindex'));
b = parseInt(b.getAttribute('tabindex'));

if (a > b) {
return 1;
} else if (a < b) {
return -1;
}

return 0;
});
var otherFocusableElements = toArray(getPopup().querySelectorAll(focusable)).filter(function (el) {
return el.getAttribute('tabindex') !== '-1';
});
return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter(function (el) {
return isVisible(el);
});
};
var isModal = function isModal() {
return !isToast() && !document.body.classList.contains(swalClasses['no-backdrop']);
};
var isToast = function isToast() {
return document.body.classList.contains(swalClasses['toast-shown']);
};
var isLoading = function isLoading() {
return getPopup().hasAttribute('data-loading');
};

// Detect Node env
var isNodeEnv = function isNodeEnv() {
return typeof window === 'undefined' || typeof document === 'undefined';
};

var sweetHTML = "\n <div aria-labelledby=\"".concat(swalClasses.title, "\" aria-describedby=\"").concat(swalClasses.content, "\" class=\"").concat(swalClasses.popup, "\" tabindex=\"-1\">\n <div class=\"").concat(swalClasses.header, "\">\n <ul class=\"").concat(swalClasses['progress-steps'], "\"></ul>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.error, "\">\n <span class=\"swal2-x-mark\"><span class=\"swal2-x-mark-line-left\"></span><span class=\"swal2-x-mark-line-right\"></span></span>\n </div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.question, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.warning, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.info, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.success, "\">\n <div class=\"swal2-success-circular-line-left\"></div>\n <span class=\"swal2-success-line-tip\"></span> <span class=\"swal2-success-line-long\"></span>\n <div class=\"swal2-success-ring\"></div> <div class=\"swal2-success-fix\"></div>\n <div class=\"swal2-success-circular-line-right\"></div>\n </div>\n <img class=\"").concat(swalClasses.image, "\" />\n <h2 class=\"").concat(swalClasses.title, "\" id=\"").concat(swalClasses.title, "\"></h2>\n <button type=\"button\" class=\"").concat(swalClasses.close, "\"></button>\n </div>\n <div class=\"").concat(swalClasses.content, "\">\n <div id=\"").concat(swalClasses.content, "\"></div>\n <input class=\"").concat(swalClasses.input, "\" />\n <input type=\"file\" class=\"").concat(swalClasses.file, "\" />\n <div class=\"").concat(swalClasses.range, "\">\n <input type=\"range\" />\n <output></output>\n </div>\n <select class=\"").concat(swalClasses.select, "\"></select>\n <div class=\"").concat(swalClasses.radio, "\"></div>\n <label for=\"").concat(swalClasses.checkbox, "\" class=\"").concat(swalClasses.checkbox, "\">\n <input type=\"checkbox\" />\n <span class=\"").concat(swalClasses.label, "\"></span>\n </label>\n <textarea class=\"").concat(swalClasses.textarea, "\"></textarea>\n <div class=\"").concat(swalClasses['validation-message'], "\" id=\"").concat(swalClasses['validation-message'], "\"></div>\n </div>\n <div class=\"").concat(swalClasses.actions, "\">\n <button type=\"button\" class=\"").concat(swalClasses.confirm, "\">OK</button>\n <button type=\"button\" class=\"").concat(swalClasses.cancel, "\">Cancel</button>\n </div>\n <div class=\"").concat(swalClasses.footer, "\">\n </div>\n </div>\n").replace(/(^|\n)\s*/g, '');

var resetOldContainer = function resetOldContainer() {
var oldContainer = getContainer();

if (!oldContainer) {
return;
}

oldContainer.parentNode.removeChild(oldContainer);
removeClass([document.documentElement, document.body], [swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['has-column']]);
};

var oldInputVal; // IE11 workaround, see #1109 for details

var resetValidationMessage = function resetValidationMessage(e) {
if (Swal.isVisible() && oldInputVal !== e.target.value) {
Swal.resetValidationMessage();
}

oldInputVal = e.target.value;
};

var addInputChangeListeners = function addInputChangeListeners() {
var content = getContent();
var input = getChildByClass(content, swalClasses.input);
var file = getChildByClass(content, swalClasses.file);
var range = content.querySelector(".".concat(swalClasses.range, " input"));
var rangeOutput = content.querySelector(".".concat(swalClasses.range, " output"));
var select = getChildByClass(content, swalClasses.select);
var checkbox = content.querySelector(".".concat(swalClasses.checkbox, " input"));
var textarea = getChildByClass(content, swalClasses.textarea);
input.oninput = resetValidationMessage;
file.onchange = resetValidationMessage;
select.onchange = resetValidationMessage;
checkbox.onchange = resetValidationMessage;
textarea.oninput = resetValidationMessage;

range.oninput = function (e) {
resetValidationMessage(e);
rangeOutput.value = range.value;
};

range.onchange = function (e) {
resetValidationMessage(e);
range.nextSibling.value = range.value;
};
};

var getTarget = function getTarget(target) {
return typeof target === 'string' ? document.querySelector(target) : target;
};

var setupAccessibility = function setupAccessibility(params) {
var popup = getPopup();
popup.setAttribute('role', params.toast ? 'alert' : 'dialog');
popup.setAttribute('aria-live', params.toast ? 'polite' : 'assertive');

if (!params.toast) {
popup.setAttribute('aria-modal', 'true');
}
};

var setupRTL = function setupRTL(targetElement) {
if (window.getComputedStyle(targetElement).direction === 'rtl') {
addClass(getContainer(), swalClasses.rtl);
}
};
/*
* Add modal + backdrop to DOM
*/


var init = function init(params) {
// Clean up the old popup container if it exists
resetOldContainer();
/* istanbul ignore if */

if (isNodeEnv()) {
error('SweetAlert2 requires document to initialize');
return;
}

var container = document.createElement('div');
container.className = swalClasses.container;
container.innerHTML = sweetHTML;
var targetElement = getTarget(params.target);
targetElement.appendChild(container);
setupAccessibility(params);
setupRTL(targetElement);
addInputChangeListeners();
};

var parseHtmlToContainer = function parseHtmlToContainer(param, target) {
// DOM element
if (param instanceof HTMLElement) {
target.appendChild(param); // JQuery element(s)
} else if (_typeof(param) === 'object') {
handleJqueryElem(target, param); // Plain string
} else if (param) {
target.innerHTML = param;
}
};

var handleJqueryElem = function handleJqueryElem(target, elem) {
target.innerHTML = '';

if (0 in elem) {
for (var i = 0; i in elem; i++) {
target.appendChild(elem[i].cloneNode(true));
}
} else {
target.appendChild(elem.cloneNode(true));
}
};

var animationEndEvent = function () {
// Prevent run in Node env

/* istanbul ignore if */
if (isNodeEnv()) {
return false;
}

var testEl = document.createElement('div');
var transEndEventNames = {
WebkitAnimation: 'webkitAnimationEnd',
OAnimation: 'oAnimationEnd oanimationend',
animation: 'animationend'
};

for (var i in transEndEventNames) {
if (Object.prototype.hasOwnProperty.call(transEndEventNames, i) && typeof testEl.style[i] !== 'undefined') {
return transEndEventNames[i];
}
}

return false;
}();

// Measure width of scrollbar
// https://github.com/twbs/bootstrap/blob/master/js/modal.js#L279-L286
var measureScrollbar = function measureScrollbar() {
var supportsTouch = 'ontouchstart' in window || navigator.msMaxTouchPoints;

if (supportsTouch) {
return 0;
}

var scrollDiv = document.createElement('div');
scrollDiv.style.width = '50px';
scrollDiv.style.height = '50px';
scrollDiv.style.overflow = 'scroll';
document.body.appendChild(scrollDiv);
var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth;
document.body.removeChild(scrollDiv);
return scrollbarWidth;
};

var renderActions = function renderActions(instance, params) {
var actions = getActions();
var confirmButton = getConfirmButton();
var cancelButton = getCancelButton(); // Actions (buttons) wrapper

if (!params.showConfirmButton && !params.showCancelButton) {
hide(actions);
} // Custom class


applyCustomClass(actions, params.customClass, 'actions'); // Render confirm button

renderButton(confirmButton, 'confirm', params); // render Cancel Button

renderButton(cancelButton, 'cancel', params);

if (params.buttonsStyling) {
handleButtonsStyling(confirmButton, cancelButton, params);
} else {
removeClass([confirmButton, cancelButton], swalClasses.styled);
confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = '';
cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = '';
}

if (params.reverseButtons) {
confirmButton.parentNode.insertBefore(cancelButton, confirmButton);
}
};

function handleButtonsStyling(confirmButton, cancelButton, params) {
addClass([confirmButton, cancelButton], swalClasses.styled); // Buttons background colors

if (params.confirmButtonColor) {
confirmButton.style.backgroundColor = params.confirmButtonColor;
}

if (params.cancelButtonColor) {
cancelButton.style.backgroundColor = params.cancelButtonColor;
} // Loading state


var confirmButtonBackgroundColor = window.getComputedStyle(confirmButton).getPropertyValue('background-color');
confirmButton.style.borderLeftColor = confirmButtonBackgroundColor;
confirmButton.style.borderRightColor = confirmButtonBackgroundColor;
}

function renderButton(button, buttonType, params) {
toggle(button, params['showC' + buttonType.substring(1) + 'Button'], 'inline-block');
button.innerHTML = params[buttonType + 'ButtonText']; // Set caption text

button.setAttribute('aria-label', params[buttonType + 'ButtonAriaLabel']); // ARIA label
// Add buttons custom classes

button.className = swalClasses[buttonType];
applyCustomClass(button, params.customClass, buttonType + 'Button');
addClass(button, params[buttonType + 'ButtonClass']);
}

function handleBackdropParam(container, backdrop) {
if (typeof backdrop === 'string') {
container.style.background = backdrop;
} else if (!backdrop) {
addClass([document.documentElement, document.body], swalClasses['no-backdrop']);
}
}

function handlePositionParam(container, position) {
if (position in swalClasses) {
addClass(container, swalClasses[position]);
} else {
warn('The "position" parameter is not valid, defaulting to "center"');
addClass(container, swalClasses.center);
}
}

function handleGrowParam(container, grow) {
if (grow && typeof grow === 'string') {
var growClass = 'grow-' + grow;

if (growClass in swalClasses) {
addClass(container, swalClasses[growClass]);
}
}
}

var renderContainer = function renderContainer(instance, params) {
var container = getContainer();

if (!container) {
return;
}

handleBackdropParam(container, params.backdrop);

if (!params.backdrop && params.allowOutsideClick) {
warn('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');
}

handlePositionParam(container, params.position);
handleGrowParam(container, params.grow); // Custom class

applyCustomClass(container, params.customClass, 'container');

if (params.customContainerClass) {
// @deprecated
addClass(container, params.customContainerClass);
}
};

/**
* This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has.
* For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')`
* This is the approach that Babel will probably take to implement private methods/fields
* https://github.com/tc39/proposal-private-methods
* https://github.com/babel/babel/pull/7555
* Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module*
* then we can use that language feature.
*/
var privateProps = {
promise: new WeakMap(),
innerParams: new WeakMap(),
domCache: new WeakMap()
};

var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea'];
var renderInput = function renderInput(instance, params) {
var content = getContent();
var innerParams = privateProps.innerParams.get(instance);
var rerender = !innerParams || params.input !== innerParams.input;
inputTypes.forEach(function (inputType) {
var inputClass = swalClasses[inputType];
var inputContainer = getChildByClass(content, inputClass); // set attributes

setAttributes(inputType, params.inputAttributes); // set class

inputContainer.className = inputClass;

if (rerender) {
hide(inputContainer);
}
});

if (params.input) {
if (rerender) {
showInput(params);
} // set custom class


setCustomClass(params);
}
};

var showInput = function showInput(params) {
if (!renderInputType[params.input]) {
return error("Unexpected type of input! Expected \"text\", \"email\", \"password\", \"number\", \"tel\", \"select\", \"radio\", \"checkbox\", \"textarea\", \"file\" or \"url\", got \"".concat(params.input, "\""));
}

var inputContainer = getInputContainer(params.input);
var input = renderInputType[params.input](inputContainer, params);
show(input); // input autofocus

setTimeout(function () {
focusInput(input);
});
};

var removeAttributes = function removeAttributes(input) {
for (var i = 0; i < input.attributes.length; i++) {
var attrName = input.attributes[i].name;

if (!(['type', 'value', 'style'].indexOf(attrName) !== -1)) {
input.removeAttribute(attrName);
}
}
};

var setAttributes = function setAttributes(inputType, inputAttributes) {
var input = getInput(getContent(), inputType);

if (!input) {
return;
}

removeAttributes(input);

for (var attr in inputAttributes) {
// Do not set a placeholder for <input type="range">
// it'll crash Edge, #1298
if (inputType === 'range' && attr === 'placeholder') {
continue;
}

input.setAttribute(attr, inputAttributes[attr]);
}
};

var setCustomClass = function setCustomClass(params) {
var inputContainer = getInputContainer(params.input);

if (params.inputClass) {
addClass(inputContainer, params.inputClass);
}

if (params.customClass) {
addClass(inputContainer, params.customClass.input);
}
};

var setInputPlaceholder = function setInputPlaceholder(input, params) {
if (!input.placeholder || params.inputPlaceholder) {
input.placeholder = params.inputPlaceholder;
}
};

var getInputContainer = function getInputContainer(inputType) {
var inputClass = swalClasses[inputType] ? swalClasses[inputType] : swalClasses.input;
return getChildByClass(getContent(), inputClass);
};

var renderInputType = {};

renderInputType.text = renderInputType.email = renderInputType.password = renderInputType.number = renderInputType.tel = renderInputType.url = function (input, params) {
if (typeof params.inputValue === 'string' || typeof params.inputValue === 'number') {
input.value = params.inputValue;
} else if (!isPromise(params.inputValue)) {
warn("Unexpected type of inputValue! Expected \"string\", \"number\" or \"Promise\", got \"".concat(_typeof(params.inputValue), "\""));
}

setInputPlaceholder(input, params);
input.type = params.input;
return input;
};

renderInputType.file = function (input, params) {
setInputPlaceholder(input, params);
return input;
};

renderInputType.range = function (range, params) {
var rangeInput = range.querySelector('input');
var rangeOutput = range.querySelector('output');
rangeInput.value = params.inputValue;
rangeInput.type = params.input;
rangeOutput.value = params.inputValue;
return range;
};

renderInputType.select = function (select, params) {
select.innerHTML = '';

if (params.inputPlaceholder) {
var placeholder = document.createElement('option');
placeholder.innerHTML = params.inputPlaceholder;
placeholder.value = '';
placeholder.disabled = true;
placeholder.selected = true;
select.appendChild(placeholder);
}

return select;
};

renderInputType.radio = function (radio) {
radio.innerHTML = '';
return radio;
};

renderInputType.checkbox = function (checkboxContainer, params) {
var checkbox = getInput(getContent(), 'checkbox');
checkbox.value = 1;
checkbox.id = swalClasses.checkbox;
checkbox.checked = Boolean(params.inputValue);
var label = checkboxContainer.querySelector('span');
label.innerHTML = params.inputPlaceholder;
return checkboxContainer;
};

renderInputType.textarea = function (textarea, params) {
textarea.value = params.inputValue;
setInputPlaceholder(textarea, params);

if ('MutationObserver' in window) {
// #1699
var initialPopupWidth = parseInt(window.getComputedStyle(getPopup()).width);
var popupPadding = parseInt(window.getComputedStyle(getPopup()).paddingLeft) + parseInt(window.getComputedStyle(getPopup()).paddingRight);

var outputsize = function outputsize() {
var contentWidth = textarea.offsetWidth + popupPadding;

if (contentWidth > initialPopupWidth) {
getPopup().style.width = contentWidth + 'px';
} else {
getPopup().style.width = null;
}
};

new MutationObserver(outputsize).observe(textarea, {
attributes: true,
attributeFilter: ['style']
});
}

return textarea;
};

var renderContent = function renderContent(instance, params) {
var content = getContent().querySelector('#' + swalClasses.content); // Content as HTML

if (params.html) {
parseHtmlToContainer(params.html, content);
show(content, 'block'); // Content as plain text
} else if (params.text) {
content.textContent = params.text;
show(content, 'block'); // No content
} else {
hide(content);
}

renderInput(instance, params); // Custom class

applyCustomClass(getContent(), params.customClass, 'content');
};

var renderFooter = function renderFooter(instance, params) {
var footer = getFooter();
toggle(footer, params.footer);

if (params.footer) {
parseHtmlToContainer(params.footer, footer);
} // Custom class


applyCustomClass(footer, params.customClass, 'footer');
};

var renderCloseButton = function renderCloseButton(instance, params) {
var closeButton = getCloseButton();
closeButton.innerHTML = params.closeButtonHtml; // Custom class

applyCustomClass(closeButton, params.customClass, 'closeButton');
toggle(closeButton, params.showCloseButton);
closeButton.setAttribute('aria-label', params.closeButtonAriaLabel);
};

var renderIcon = function renderIcon(instance, params) {
var innerParams = privateProps.innerParams.get(instance); // if the icon with the given type already rendered,
// apply the custom class without re-rendering the icon

if (innerParams && params.type === innerParams.type && getIcon()) {
applyCustomClass(getIcon(), params.customClass, 'icon');
return;
}

hideAllIcons();

if (!params.type) {
return;
}

adjustSuccessIconBackgoundColor();

if (Object.keys(iconTypes).indexOf(params.type) !== -1) {
var icon = elementBySelector(".".concat(swalClasses.icon, ".").concat(iconTypes[params.type]));
show(icon); // Custom class

applyCustomClass(icon, params.customClass, 'icon'); // Animate icon

toggleClass(icon, "swal2-animate-".concat(params.type, "-icon"), params.animation);
} else {
error("Unknown type! Expected \"success\", \"error\", \"warning\", \"info\" or \"question\", got \"".concat(params.type, "\""));
}
};

var hideAllIcons = function hideAllIcons() {
var icons = getIcons();

for (var i = 0; i < icons.length; i++) {
hide(icons[i]);
}
}; // Adjust success icon background color to match the popup background color


var adjustSuccessIconBackgoundColor = function adjustSuccessIconBackgoundColor() {
var popup = getPopup();
var popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color');
var successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix');

for (var i = 0; i < successIconParts.length; i++) {
successIconParts[i].style.backgroundColor = popupBackgroundColor;
}
};

var renderImage = function renderImage(instance, params) {
var image = getImage();

if (!params.imageUrl) {
return hide(image);
}

show(image); // Src, alt

image.setAttribute('src', params.imageUrl);
image.setAttribute('alt', params.imageAlt); // Width, height

applyNumericalStyle(image, 'width', params.imageWidth);
applyNumericalStyle(image, 'height', params.imageHeight); // Class

image.className = swalClasses.image;
applyCustomClass(image, params.customClass, 'image');

if (params.imageClass) {
addClass(image, params.imageClass);
}
};

var createStepElement = function createStepElement(step) {
var stepEl = document.createElement('li');
addClass(stepEl, swalClasses['progress-step']);
stepEl.innerHTML = step;
return stepEl;
};

var createLineElement = function createLineElement(params) {
var lineEl = document.createElement('li');
addClass(lineEl, swalClasses['progress-step-line']);

if (params.progressStepsDistance) {
lineEl.style.width = params.progressStepsDistance;
}

return lineEl;
};

var renderProgressSteps = function renderProgressSteps(instance, params) {
var progressStepsContainer = getProgressSteps();

if (!params.progressSteps || params.progressSteps.length === 0) {
return hide(progressStepsContainer);
}

show(progressStepsContainer);
progressStepsContainer.innerHTML = '';
var currentProgressStep = parseInt(params.currentProgressStep === null ? Swal.getQueueStep() : params.currentProgressStep);

if (currentProgressStep >= params.progressSteps.length) {
warn('Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)');
}

params.progressSteps.forEach(function (step, index) {
var stepEl = createStepElement(step);
progressStepsContainer.appendChild(stepEl);

if (index === currentProgressStep) {
addClass(stepEl, swalClasses['active-progress-step']);
}

if (index !== params.progressSteps.length - 1) {
var lineEl = createLineElement(step);
progressStepsContainer.appendChild(lineEl);
}
});
};

var renderTitle = function renderTitle(instance, params) {
var title = getTitle();
toggle(title, params.title || params.titleText);

if (params.title) {
parseHtmlToContainer(params.title, title);
}

if (params.titleText) {
title.innerText = params.titleText;
} // Custom class


applyCustomClass(title, params.customClass, 'title');
};

var renderHeader = function renderHeader(instance, params) {
var header = getHeader(); // Custom class

applyCustomClass(header, params.customClass, 'header'); // Progress steps

renderProgressSteps(instance, params); // Icon

renderIcon(instance, params); // Image

renderImage(instance, params); // Title

renderTitle(instance, params); // Close button

renderCloseButton(instance, params);
};

var renderPopup = function renderPopup(instance, params) {
var popup = getPopup(); // Width

applyNumericalStyle(popup, 'width', params.width); // Padding

applyNumericalStyle(popup, 'padding', params.padding); // Background

if (params.background) {
popup.style.background = params.background;
} // Default Class


popup.className = swalClasses.popup;

if (params.toast) {
addClass([document.documentElement, document.body], swalClasses['toast-shown']);
addClass(popup, swalClasses.toast);
} else {
addClass(popup, swalClasses.modal);
} // Custom class


applyCustomClass(popup, params.customClass, 'popup');

if (typeof params.customClass === 'string') {
addClass(popup, params.customClass);
} // CSS animation


toggleClass(popup, swalClasses.noanimation, !params.animation);
};

var render = function render(instance, params) {
renderPopup(instance, params);
renderContainer(instance, params);
renderHeader(instance, params);
renderContent(instance, params);
renderActions(instance, params);
renderFooter(instance, params);

if (typeof params.onRender === 'function') {
params.onRender(getPopup());
}
};

/*
* Global function to determine if SweetAlert2 popup is shown
*/

var isVisible$1 = function isVisible$$1() {
return isVisible(getPopup());
};
/*
* Global function to click 'Confirm' button
*/

var clickConfirm = function clickConfirm() {
return getConfirmButton() && getConfirmButton().click();
};
/*
* Global function to click 'Cancel' button
*/

var clickCancel = function clickCancel() {
return getCancelButton() && getCancelButton().click();
};

function fire() {
var Swal = this;

for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}

return _construct(Swal, args);
}

/**
* Returns an extended version of `Swal` containing `params` as defaults.
* Useful for reusing Swal configuration.
*
* For example:
*
* Before:
* const textPromptOptions = { input: 'text', showCancelButton: true }
* const {value: firstName} = await Swal.fire({ ...textPromptOptions, title: 'What is your first name?' })
* const {value: lastName} = await Swal.fire({ ...textPromptOptions, title: 'What is your last name?' })
*
* After:
* const TextPrompt = Swal.mixin({ input: 'text', showCancelButton: true })
* const {value: firstName} = await TextPrompt('What is your first name?')
* const {value: lastName} = await TextPrompt('What is your last name?')
*
* @param mixinParams
*/
function mixin(mixinParams) {
var MixinSwal =
/*#__PURE__*/
function (_this) {
_inherits(MixinSwal, _this);

function MixinSwal() {
_classCallCheck(this, MixinSwal);

return _possibleConstructorReturn(this, _getPrototypeOf(MixinSwal).apply(this, arguments));
}

_createClass(MixinSwal, [{
key: "_main",
value: function _main(params) {
return _get(_getPrototypeOf(MixinSwal.prototype), "_main", this).call(this, _extends({}, mixinParams, params));
}
}]);

return MixinSwal;
}(this);

return MixinSwal;
}

// private global state for the queue feature
var currentSteps = [];
/*
* Global function for chaining sweetAlert popups
*/

var queue = function queue(steps) {
var Swal = this;
currentSteps = steps;

var resetAndResolve = function resetAndResolve(resolve, value) {
currentSteps = [];
document.body.removeAttribute('data-swal2-queue-step');
resolve(value);
};

var queueResult = [];
return new Promise(function (resolve) {
(function step(i, callback) {
if (i < currentSteps.length) {
document.body.setAttribute('data-swal2-queue-step', i);
Swal.fire(currentSteps[i]).then(function (result) {
if (typeof result.value !== 'undefined') {
queueResult.push(result.value);
step(i + 1, callback);
} else {
resetAndResolve(resolve, {
dismiss: result.dismiss
});
}
});
} else {
resetAndResolve(resolve, {
value: queueResult
});
}
})(0);
});
};
/*
* Global function for getting the index of current popup in queue
*/

var getQueueStep = function getQueueStep() {
return document.body.getAttribute('data-swal2-queue-step');
};
/*
* Global function for inserting a popup to the queue
*/

var insertQueueStep = function insertQueueStep(step, index) {
if (index && index < currentSteps.length) {
return currentSteps.splice(index, 0, step);
}

return currentSteps.push(step);
};
/*
* Global function for deleting a popup from the queue
*/

var deleteQueueStep = function deleteQueueStep(index) {
if (typeof currentSteps[index] !== 'undefined') {
currentSteps.splice(index, 1);
}
};

/**
* Show spinner instead of Confirm button and disable Cancel button
*/

var showLoading = function showLoading() {
var popup = getPopup();

if (!popup) {
Swal.fire('');
}

popup = getPopup();
var actions = getActions();
var confirmButton = getConfirmButton();
var cancelButton = getCancelButton();
show(actions);
show(confirmButton);
addClass([popup, actions], swalClasses.loading);
confirmButton.disabled = true;
cancelButton.disabled = true;
popup.setAttribute('data-loading', true);
popup.setAttribute('aria-busy', true);
popup.focus();
};

var RESTORE_FOCUS_TIMEOUT = 100;

var globalState = {};
var focusPreviousActiveElement = function focusPreviousActiveElement() {
if (globalState.previousActiveElement && globalState.previousActiveElement.focus) {
globalState.previousActiveElement.focus();
globalState.previousActiveElement = null;
} else if (document.body) {
document.body.focus();
}
}; // Restore previous active (focused) element


var restoreActiveElement = function restoreActiveElement() {
return new Promise(function (resolve) {
var x = window.scrollX;
var y = window.scrollY;
globalState.restoreFocusTimeout = setTimeout(function () {
focusPreviousActiveElement();
resolve();
}, RESTORE_FOCUS_TIMEOUT); // issues/900

if (typeof x !== 'undefined' && typeof y !== 'undefined') {
// IE doesn't have scrollX/scrollY support
window.scrollTo(x, y);
}
});
};

/**
* If `timer` parameter is set, returns number of milliseconds of timer remained.
* Otherwise, returns undefined.
*/

var getTimerLeft = function getTimerLeft() {
return globalState.timeout && globalState.timeout.getTimerLeft();
};
/**
* Stop timer. Returns number of milliseconds of timer remained.
* If `timer` parameter isn't set, returns undefined.
*/

var stopTimer = function stopTimer() {
return globalState.timeout && globalState.timeout.stop();
};
/**
* Resume timer. Returns number of milliseconds of timer remained.
* If `timer` parameter isn't set, returns undefined.
*/

var resumeTimer = function resumeTimer() {
return globalState.timeout && globalState.timeout.start();
};
/**
* Resume timer. Returns number of milliseconds of timer remained.
* If `timer` parameter isn't set, returns undefined.
*/

var toggleTimer = function toggleTimer() {
var timer = globalState.timeout;
return timer && (timer.running ? timer.stop() : timer.start());
};
/**
* Increase timer. Returns number of milliseconds of an updated timer.
* If `timer` parameter isn't set, returns undefined.
*/

var increaseTimer = function increaseTimer(n) {
return globalState.timeout && globalState.timeout.increase(n);
};
/**
* Check if timer is running. Returns true if timer is running
* or false if timer is paused or stopped.
* If `timer` parameter isn't set, returns undefined
*/

var isTimerRunning = function isTimerRunning() {
return globalState.timeout && globalState.timeout.isRunning();
};

var defaultParams = {
title: '',
titleText: '',
text: '',
html: '',
footer: '',
type: null,
toast: false,
customClass: '',
customContainerClass: '',
target: 'body',
backdrop: true,
animation: true,
heightAuto: true,
allowOutsideClick: true,
allowEscapeKey: true,
allowEnterKey: true,
stopKeydownPropagation: true,
keydownListenerCapture: false,
showConfirmButton: true,
showCancelButton: false,
preConfirm: null,
confirmButtonText: 'OK',
confirmButtonAriaLabel: '',
confirmButtonColor: null,
confirmButtonClass: '',
cancelButtonText: 'Cancel',
cancelButtonAriaLabel: '',
cancelButtonColor: null,
cancelButtonClass: '',
buttonsStyling: true,
reverseButtons: false,
focusConfirm: true,
focusCancel: false,
showCloseButton: false,
closeButtonHtml: '&times;',
closeButtonAriaLabel: 'Close this dialog',
showLoaderOnConfirm: false,
imageUrl: null,
imageWidth: null,
imageHeight: null,
imageAlt: '',
imageClass: '',
timer: null,
width: null,
padding: null,
background: null,
input: null,
inputPlaceholder: '',
inputValue: '',
inputOptions: {},
inputAutoTrim: true,
inputClass: '',
inputAttributes: {},
inputValidator: null,
validationMessage: null,
grow: false,
position: 'center',
progressSteps: [],
currentProgressStep: null,
progressStepsDistance: null,
onBeforeOpen: null,
onOpen: null,
onRender: null,
onClose: null,
onAfterClose: null,
scrollbarPadding: true
};
var updatableParams = ['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'];
var deprecatedParams = {
customContainerClass: 'customClass',
confirmButtonClass: 'customClass',
cancelButtonClass: 'customClass',
imageClass: 'customClass',
inputClass: 'customClass'
};
var toastIncompatibleParams = ['allowOutsideClick', 'allowEnterKey', 'backdrop', 'focusConfirm', 'focusCancel', 'heightAuto', 'keydownListenerCapture'];
/**
* Is valid parameter
* @param {String} paramName
*/

var isValidParameter = function isValidParameter(paramName) {
return Object.prototype.hasOwnProperty.call(defaultParams, paramName);
};
/**
* Is valid parameter for Swal.update() method
* @param {String} paramName
*/

var isUpdatableParameter = function isUpdatableParameter(paramName) {
return updatableParams.indexOf(paramName) !== -1;
};
/**
* Is deprecated parameter
* @param {String} paramName
*/

var isDeprecatedParameter = function isDeprecatedParameter(paramName) {
return deprecatedParams[paramName];
};

var checkIfParamIsValid = function checkIfParamIsValid(param) {
if (!isValidParameter(param)) {
warn("Unknown parameter \"".concat(param, "\""));
}
};

var checkIfToastParamIsValid = function checkIfToastParamIsValid(param) {
if (toastIncompatibleParams.indexOf(param) !== -1) {
warn("The parameter \"".concat(param, "\" is incompatible with toasts"));
}
};

var checkIfParamIsDeprecated = function checkIfParamIsDeprecated(param) {
if (isDeprecatedParameter(param)) {
warnAboutDepreation(param, isDeprecatedParameter(param));
}
};
/**
* Show relevant warnings for given params
*
* @param params
*/


var showWarningsForParams = function showWarningsForParams(params) {
for (var param in params) {
checkIfParamIsValid(param);

if (params.toast) {
checkIfToastParamIsValid(param);
}

checkIfParamIsDeprecated();
}
};



var staticMethods = Object.freeze({
isValidParameter: isValidParameter,
isUpdatableParameter: isUpdatableParameter,
isDeprecatedParameter: isDeprecatedParameter,
argsToParams: argsToParams,
isVisible: isVisible$1,
clickConfirm: clickConfirm,
clickCancel: clickCancel,
getContainer: getContainer,
getPopup: getPopup,
getTitle: getTitle,
getContent: getContent,
getImage: getImage,
getIcon: getIcon,
getIcons: getIcons,
getCloseButton: getCloseButton,
getActions: getActions,
getConfirmButton: getConfirmButton,
getCancelButton: getCancelButton,
getHeader: getHeader,
getFooter: getFooter,
getFocusableElements: getFocusableElements,
getValidationMessage: getValidationMessage,
isLoading: isLoading,
fire: fire,
mixin: mixin,
queue: queue,
getQueueStep: getQueueStep,
insertQueueStep: insertQueueStep,
deleteQueueStep: deleteQueueStep,
showLoading: showLoading,
enableLoading: showLoading,
getTimerLeft: getTimerLeft,
stopTimer: stopTimer,
resumeTimer: resumeTimer,
toggleTimer: toggleTimer,
increaseTimer: increaseTimer,
isTimerRunning: isTimerRunning
});

/**
* Enables buttons and hide loader.
*/

function hideLoading() {
var innerParams = privateProps.innerParams.get(this);
var domCache = privateProps.domCache.get(this);

if (!innerParams.showConfirmButton) {
hide(domCache.confirmButton);

if (!innerParams.showCancelButton) {
hide(domCache.actions);
}
}

removeClass([domCache.popup, domCache.actions], swalClasses.loading);
domCache.popup.removeAttribute('aria-busy');
domCache.popup.removeAttribute('data-loading');
domCache.confirmButton.disabled = false;
domCache.cancelButton.disabled = false;
}

function getInput$1(instance) {
var innerParams = privateProps.innerParams.get(instance || this);
var domCache = privateProps.domCache.get(instance || this);

if (!domCache) {
return null;
}

return getInput(domCache.content, innerParams.input);
}

var fixScrollbar = function fixScrollbar() {
// for queues, do not do this more than once
if (states.previousBodyPadding !== null) {
return;
} // if the body has overflow


if (document.body.scrollHeight > window.innerHeight) {
// add padding so the content doesn't shift after removal of scrollbar
states.previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right'));
document.body.style.paddingRight = states.previousBodyPadding + measureScrollbar() + 'px';
}
};
var undoScrollbar = function undoScrollbar() {
if (states.previousBodyPadding !== null) {
document.body.style.paddingRight = states.previousBodyPadding + 'px';
states.previousBodyPadding = null;
}
};

/* istanbul ignore next */

var iOSfix = function iOSfix() {
var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream || navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1;

if (iOS && !hasClass(document.body, swalClasses.iosfix)) {
var offset = document.body.scrollTop;
document.body.style.top = offset * -1 + 'px';
addClass(document.body, swalClasses.iosfix);
lockBodyScroll();
}
};

var lockBodyScroll = function lockBodyScroll() {
// #1246
var container = getContainer();
var preventTouchMove;

container.ontouchstart = function (e) {
preventTouchMove = e.target === container || !isScrollable(container) && e.target.tagName !== 'INPUT' // #1603
;
};

container.ontouchmove = function (e) {
if (preventTouchMove) {
e.preventDefault();
e.stopPropagation();
}
};
};
/* istanbul ignore next */


var undoIOSfix = function undoIOSfix() {
if (hasClass(document.body, swalClasses.iosfix)) {
var offset = parseInt(document.body.style.top, 10);
removeClass(document.body, swalClasses.iosfix);
document.body.style.top = '';
document.body.scrollTop = offset * -1;
}
};

var isIE11 = function isIE11() {
return !!window.MSInputMethodContext && !!document.documentMode;
}; // Fix IE11 centering sweetalert2/issues/933

/* istanbul ignore next */


var fixVerticalPositionIE = function fixVerticalPositionIE() {
var container = getContainer();
var popup = getPopup();
container.style.removeProperty('align-items');

if (popup.offsetTop < 0) {
container.style.alignItems = 'flex-start';
}
};
/* istanbul ignore next */


var IEfix = function IEfix() {
if (typeof window !== 'undefined' && isIE11()) {
fixVerticalPositionIE();
window.addEventListener('resize', fixVerticalPositionIE);
}
};
/* istanbul ignore next */

var undoIEfix = function undoIEfix() {
if (typeof window !== 'undefined' && isIE11()) {
window.removeEventListener('resize', fixVerticalPositionIE);
}
};

// Adding aria-hidden="true" to elements outside of the active modal dialog ensures that
// elements not within the active modal dialog will not be surfaced if a user opens a screen
// reader’s list of elements (headings, form controls, landmarks, etc.) in the document.

var setAriaHidden = function setAriaHidden() {
var bodyChildren = toArray(document.body.children);
bodyChildren.forEach(function (el) {
if (el === getContainer() || contains(el, getContainer())) {
return;
}

if (el.hasAttribute('aria-hidden')) {
el.setAttribute('data-previous-aria-hidden', el.getAttribute('aria-hidden'));
}

el.setAttribute('aria-hidden', 'true');
});
};
var unsetAriaHidden = function unsetAriaHidden() {
var bodyChildren = toArray(document.body.children);
bodyChildren.forEach(function (el) {
if (el.hasAttribute('data-previous-aria-hidden')) {
el.setAttribute('aria-hidden', el.getAttribute('data-previous-aria-hidden'));
el.removeAttribute('data-previous-aria-hidden');
} else {
el.removeAttribute('aria-hidden');
}
});
};

/**
* This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has.
* For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')`
* This is the approach that Babel will probably take to implement private methods/fields
* https://github.com/tc39/proposal-private-methods
* https://github.com/babel/babel/pull/7555
* Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module*
* then we can use that language feature.
*/
var privateMethods = {
swalPromiseResolve: new WeakMap()
};

/*
* Instance method to close sweetAlert
*/

function removePopupAndResetState(instance, container, isToast, onAfterClose) {
if (isToast) {
triggerOnAfterCloseAndDispose(instance, onAfterClose);
} else {
restoreActiveElement().then(function () {
return triggerOnAfterCloseAndDispose(instance, onAfterClose);
});
globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, {
capture: globalState.keydownListenerCapture
});
globalState.keydownHandlerAdded = false;
}

if (container.parentNode) {
container.parentNode.removeChild(container);
}

if (isModal()) {
undoScrollbar();
undoIOSfix();
undoIEfix();
unsetAriaHidden();
}

removeBodyClasses();
}

function removeBodyClasses() {
removeClass([document.documentElement, document.body], [swalClasses.shown, swalClasses['height-auto'], swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['toast-column']]);
}

function disposeSwal(instance) {
// Unset this.params so GC will dispose it (#1569)
delete instance.params; // Unset globalState props so GC will dispose globalState (#1569)

delete globalState.keydownHandler;
delete globalState.keydownTarget; // Unset WeakMaps so GC will be able to dispose them (#1569)

unsetWeakMaps(privateProps);
unsetWeakMaps(privateMethods);
}

function close(resolveValue) {
var popup = getPopup();

if (!popup || hasClass(popup, swalClasses.hide)) {
return;
}

var innerParams = privateProps.innerParams.get(this);

if (!innerParams) {
return;
}

var swalPromiseResolve = privateMethods.swalPromiseResolve.get(this);
removeClass(popup, swalClasses.show);
addClass(popup, swalClasses.hide);
handlePopupAnimation(this, popup, innerParams); // Resolve Swal promise

swalPromiseResolve(resolveValue || {});
}

var handlePopupAnimation = function handlePopupAnimation(instance, popup, innerParams) {
var container = getContainer(); // If animation is supported, animate

var animationIsSupported = animationEndEvent && hasCssAnimation(popup);
var onClose = innerParams.onClose,
onAfterClose = innerParams.onAfterClose;

if (onClose !== null && typeof onClose === 'function') {
onClose(popup);
}

if (animationIsSupported) {
animatePopup(instance, popup, container, onAfterClose);
} else {
// Otherwise, remove immediately
removePopupAndResetState(instance, container, isToast(), onAfterClose);
}
};

var animatePopup = function animatePopup(instance, popup, container, onAfterClose) {
globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind(null, instance, container, isToast(), onAfterClose);
popup.addEventListener(animationEndEvent, function (e) {
if (e.target === popup) {
globalState.swalCloseEventFinishedCallback();
delete globalState.swalCloseEventFinishedCallback;
}
});
};

var unsetWeakMaps = function unsetWeakMaps(obj) {
for (var i in obj) {
obj[i] = new WeakMap();
}
};

var triggerOnAfterCloseAndDispose = function triggerOnAfterCloseAndDispose(instance, onAfterClose) {
setTimeout(function () {
if (onAfterClose !== null && typeof onAfterClose === 'function') {
onAfterClose();
}

if (!getPopup()) {
disposeSwal(instance);
}
});
};

function setButtonsDisabled(instance, buttons, disabled) {
var domCache = privateProps.domCache.get(instance);
buttons.forEach(function (button) {
domCache[button].disabled = disabled;
});
}

function setInputDisabled(input, disabled) {
if (!input) {
return false;
}

if (input.type === 'radio') {
var radiosContainer = input.parentNode.parentNode;
var radios = radiosContainer.querySelectorAll('input');

for (var i = 0; i < radios.length; i++) {
radios[i].disabled = disabled;
}
} else {
input.disabled = disabled;
}
}

function enableButtons() {
setButtonsDisabled(this, ['confirmButton', 'cancelButton'], false);
}
function disableButtons() {
setButtonsDisabled(this, ['confirmButton', 'cancelButton'], true);
} // @deprecated

function enableConfirmButton() {
warnAboutDepreation('Swal.enableConfirmButton()', "Swal.getConfirmButton().removeAttribute('disabled')");
setButtonsDisabled(this, ['confirmButton'], false);
} // @deprecated

function disableConfirmButton() {
warnAboutDepreation('Swal.disableConfirmButton()', "Swal.getConfirmButton().setAttribute('disabled', '')");
setButtonsDisabled(this, ['confirmButton'], true);
}
function enableInput() {
return setInputDisabled(this.getInput(), false);
}
function disableInput() {
return setInputDisabled(this.getInput(), true);
}

function showValidationMessage(error) {
var domCache = privateProps.domCache.get(this);
domCache.validationMessage.innerHTML = error;
var popupComputedStyle = window.getComputedStyle(domCache.popup);
domCache.validationMessage.style.marginLeft = "-".concat(popupComputedStyle.getPropertyValue('padding-left'));
domCache.validationMessage.style.marginRight = "-".concat(popupComputedStyle.getPropertyValue('padding-right'));
show(domCache.validationMessage);
var input = this.getInput();

if (input) {
input.setAttribute('aria-invalid', true);
input.setAttribute('aria-describedBy', swalClasses['validation-message']);
focusInput(input);
addClass(input, swalClasses.inputerror);
}
} // Hide block with validation message

function resetValidationMessage$1() {
var domCache = privateProps.domCache.get(this);

if (domCache.validationMessage) {
hide(domCache.validationMessage);
}

var input = this.getInput();

if (input) {
input.removeAttribute('aria-invalid');
input.removeAttribute('aria-describedBy');
removeClass(input, swalClasses.inputerror);
}
}

function getProgressSteps$1() {
warnAboutDepreation('Swal.getProgressSteps()', "const swalInstance = Swal.fire({progressSteps: ['1', '2', '3']}); const progressSteps = swalInstance.params.progressSteps");
var innerParams = privateProps.innerParams.get(this);
return innerParams.progressSteps;
}
function setProgressSteps(progressSteps) {
warnAboutDepreation('Swal.setProgressSteps()', 'Swal.update()');
var innerParams = privateProps.innerParams.get(this);

var updatedParams = _extends({}, innerParams, {
progressSteps: progressSteps
});

renderProgressSteps(this, updatedParams);
privateProps.innerParams.set(this, updatedParams);
}
function showProgressSteps() {
var domCache = privateProps.domCache.get(this);
show(domCache.progressSteps);
}
function hideProgressSteps() {
var domCache = privateProps.domCache.get(this);
hide(domCache.progressSteps);
}

var Timer =
/*#__PURE__*/
function () {
function Timer(callback, delay) {
_classCallCheck(this, Timer);

this.callback = callback;
this.remaining = delay;
this.running = false;
this.start();
}

_createClass(Timer, [{
key: "start",
value: function start() {
if (!this.running) {
this.running = true;
this.started = new Date();
this.id = setTimeout(this.callback, this.remaining);
}

return this.remaining;
}
}, {
key: "stop",
value: function stop() {
if (this.running) {
this.running = false;
clearTimeout(this.id);
this.remaining -= new Date() - this.started;
}

return this.remaining;
}
}, {
key: "increase",
value: function increase(n) {
var running = this.running;

if (running) {
this.stop();
}

this.remaining += n;

if (running) {
this.start();
}

return this.remaining;
}
}, {
key: "getTimerLeft",
value: function getTimerLeft() {
if (this.running) {
this.stop();
this.start();
}

return this.remaining;
}
}, {
key: "isRunning",
value: function isRunning() {
return this.running;
}
}]);

return Timer;
}();

var defaultInputValidators = {
email: function email(string, validationMessage) {
return /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid email address');
},
url: function url(string, validationMessage) {
// taken from https://stackoverflow.com/a/3809435 with a small change from #1306
return /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid URL');
}
};

function setDefaultInputValidators(params) {
// Use default `inputValidator` for supported input types if not provided
if (!params.inputValidator) {
Object.keys(defaultInputValidators).forEach(function (key) {
if (params.input === key) {
params.inputValidator = defaultInputValidators[key];
}
});
}
}

function validateCustomTargetElement(params) {
// Determine if the custom target element is valid
if (!params.target || typeof params.target === 'string' && !document.querySelector(params.target) || typeof params.target !== 'string' && !params.target.appendChild) {
warn('Target parameter is not valid, defaulting to "body"');
params.target = 'body';
}
}
/**
* Set type, text and actions on popup
*
* @param params
* @returns {boolean}
*/


function setParameters(params) {
setDefaultInputValidators(params); // showLoaderOnConfirm && preConfirm

if (params.showLoaderOnConfirm && !params.preConfirm) {
warn('showLoaderOnConfirm is set to true, but preConfirm is not defined.\n' + 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' + 'https://sweetalert2.github.io/#ajax-request');
} // params.animation will be actually used in renderPopup.js
// but in case when params.animation is a function, we need to call that function
// before popup (re)initialization, so it'll be possible to check Swal.isVisible()
// inside the params.animation function


params.animation = callIfFunction(params.animation);
validateCustomTargetElement(params); // Replace newlines with <br> in title

if (typeof params.title === 'string') {
params.title = params.title.split('\n').join('<br />');
}

init(params);
}

function swalOpenAnimationFinished(popup, container) {
popup.removeEventListener(animationEndEvent, swalOpenAnimationFinished);
container.style.overflowY = 'auto';
}
/**
* Open popup, add necessary classes and styles, fix scrollbar
*
* @param {Array} params
*/


var openPopup = function openPopup(params) {
var container = getContainer();
var popup = getPopup();

if (typeof params.onBeforeOpen === 'function') {
params.onBeforeOpen(popup);
}

addClasses(container, popup, params); // scrolling is 'hidden' until animation is done, after that 'auto'

setScrollingVisibility(container, popup);

if (isModal()) {
fixScrollContainer(container, params.scrollbarPadding);
}

if (!isToast() && !globalState.previousActiveElement) {
globalState.previousActiveElement = document.activeElement;
}

if (typeof params.onOpen === 'function') {
setTimeout(function () {
return params.onOpen(popup);
});
}
};

var setScrollingVisibility = function setScrollingVisibility(container, popup) {
if (animationEndEvent && hasCssAnimation(popup)) {
container.style.overflowY = 'hidden';
popup.addEventListener(animationEndEvent, swalOpenAnimationFinished.bind(null, popup, container));
} else {
container.style.overflowY = 'auto';
}
};

var fixScrollContainer = function fixScrollContainer(container, scrollbarPadding) {
iOSfix();
IEfix();
setAriaHidden();

if (scrollbarPadding) {
fixScrollbar();
} // sweetalert2/issues/1247


setTimeout(function () {
container.scrollTop = 0;
});
};

var addClasses = function addClasses(container, popup, params) {
if (params.animation) {
addClass(popup, swalClasses.show);
}

show(popup);
addClass([document.documentElement, document.body, container], swalClasses.shown);

if (params.heightAuto && params.backdrop && !params.toast) {
addClass([document.documentElement, document.body], swalClasses['height-auto']);
}
};

var handleInputOptionsAndValue = function handleInputOptionsAndValue(instance, params) {
if (params.input === 'select' || params.input === 'radio') {
handleInputOptions(instance, params);
} else if (['text', 'email', 'number', 'tel', 'textarea'].indexOf(params.input) !== -1 && isPromise(params.inputValue)) {
handleInputValue(instance, params);
}
};
var getInputValue = function getInputValue(instance, innerParams) {
var input = instance.getInput();

if (!input) {
return null;
}

switch (innerParams.input) {
case 'checkbox':
return getCheckboxValue(input);

case 'radio':
return getRadioValue(input);

case 'file':
return getFileValue(input);

default:
return innerParams.inputAutoTrim ? input.value.trim() : input.value;
}
};

var getCheckboxValue = function getCheckboxValue(input) {
return input.checked ? 1 : 0;
};

var getRadioValue = function getRadioValue(input) {
return input.checked ? input.value : null;
};

var getFileValue = function getFileValue(input) {
return input.files.length ? input.getAttribute('multiple') !== null ? input.files : input.files[0] : null;
};

var handleInputOptions = function handleInputOptions(instance, params) {
var content = getContent();

var processInputOptions = function processInputOptions(inputOptions) {
return populateInputOptions[params.input](content, formatInputOptions(inputOptions), params);
};

if (isPromise(params.inputOptions)) {
showLoading();
params.inputOptions.then(function (inputOptions) {
instance.hideLoading();
processInputOptions(inputOptions);
});
} else if (_typeof(params.inputOptions) === 'object') {
processInputOptions(params.inputOptions);
} else {
error("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(_typeof(params.inputOptions)));
}
};

var handleInputValue = function handleInputValue(instance, params) {
var input = instance.getInput();
hide(input);
params.inputValue.then(function (inputValue) {
input.value = params.input === 'number' ? parseFloat(inputValue) || 0 : inputValue + '';
show(input);
input.focus();
instance.hideLoading();
})["catch"](function (err) {
error('Error in inputValue promise: ' + err);
input.value = '';
show(input);
input.focus();
instance.hideLoading();
});
};

var populateInputOptions = {
select: function select(content, inputOptions, params) {
var select = getChildByClass(content, swalClasses.select);
inputOptions.forEach(function (inputOption) {
var optionValue = inputOption[0];
var optionLabel = inputOption[1];
var option = document.createElement('option');
option.value = optionValue;
option.innerHTML = optionLabel;

if (params.inputValue.toString() === optionValue.toString()) {
option.selected = true;
}

select.appendChild(option);
});
select.focus();
},
radio: function radio(content, inputOptions, params) {
var radio = getChildByClass(content, swalClasses.radio);
inputOptions.forEach(function (inputOption) {
var radioValue = inputOption[0];
var radioLabel = inputOption[1];
var radioInput = document.createElement('input');
var radioLabelElement = document.createElement('label');
radioInput.type = 'radio';
radioInput.name = swalClasses.radio;
radioInput.value = radioValue;

if (params.inputValue.toString() === radioValue.toString()) {
radioInput.checked = true;
}

var label = document.createElement('span');
label.innerHTML = radioLabel;
label.className = swalClasses.label;
radioLabelElement.appendChild(radioInput);
radioLabelElement.appendChild(label);
radio.appendChild(radioLabelElement);
});
var radios = radio.querySelectorAll('input');

if (radios.length) {
radios[0].focus();
}
}
};
/**
* Converts `inputOptions` into an array of `[value, label]`s
* @param inputOptions
*/

var formatInputOptions = function formatInputOptions(inputOptions) {
var result = [];

if (typeof Map !== 'undefined' && inputOptions instanceof Map) {
inputOptions.forEach(function (value, key) {
result.push([key, value]);
});
} else {
Object.keys(inputOptions).forEach(function (key) {
result.push([key, inputOptions[key]]);
});
}

return result;
};

var handleConfirmButtonClick = function handleConfirmButtonClick(instance, innerParams) {
instance.disableButtons();

if (innerParams.input) {
handleConfirmWithInput(instance, innerParams);
} else {
confirm(instance, innerParams, true);
}
};
var handleCancelButtonClick = function handleCancelButtonClick(instance, dismissWith) {
instance.disableButtons();
dismissWith(DismissReason.cancel);
};

var handleConfirmWithInput = function handleConfirmWithInput(instance, innerParams) {
var inputValue = getInputValue(instance, innerParams);

if (innerParams.inputValidator) {
instance.disableInput();
var validationPromise = Promise.resolve().then(function () {
return innerParams.inputValidator(inputValue, innerParams.validationMessage);
});
validationPromise.then(function (validationMessage) {
instance.enableButtons();
instance.enableInput();

if (validationMessage) {
instance.showValidationMessage(validationMessage);
} else {
confirm(instance, innerParams, inputValue);
}
});
} else if (!instance.getInput().checkValidity()) {
instance.enableButtons();
instance.showValidationMessage(innerParams.validationMessage);
} else {
confirm(instance, innerParams, inputValue);
}
};

var succeedWith = function succeedWith(instance, value) {
instance.closePopup({
value: value
});
};

var confirm = function confirm(instance, innerParams, value) {
if (innerParams.showLoaderOnConfirm) {
showLoading(); // TODO: make showLoading an *instance* method
}

if (innerParams.preConfirm) {
instance.resetValidationMessage();
var preConfirmPromise = Promise.resolve().then(function () {
return innerParams.preConfirm(value, innerParams.validationMessage);
});
preConfirmPromise.then(function (preConfirmValue) {
if (isVisible(getValidationMessage()) || preConfirmValue === false) {
instance.hideLoading();
} else {
succeedWith(instance, typeof preConfirmValue === 'undefined' ? value : preConfirmValue);
}
});
} else {
succeedWith(instance, value);
}
};

var addKeydownHandler = function addKeydownHandler(instance, globalState, innerParams, dismissWith) {
if (globalState.keydownTarget && globalState.keydownHandlerAdded) {
globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, {
capture: globalState.keydownListenerCapture
});
globalState.keydownHandlerAdded = false;
}

if (!innerParams.toast) {
globalState.keydownHandler = function (e) {
return keydownHandler(instance, e, innerParams, dismissWith);
};

globalState.keydownTarget = innerParams.keydownListenerCapture ? window : getPopup();
globalState.keydownListenerCapture = innerParams.keydownListenerCapture;
globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, {
capture: globalState.keydownListenerCapture
});
globalState.keydownHandlerAdded = true;
}
}; // Focus handling

var setFocus = function setFocus(innerParams, index, increment) {
var focusableElements = getFocusableElements(); // search for visible elements and select the next possible match

for (var i = 0; i < focusableElements.length; i++) {
index = index + increment; // rollover to first item

if (index === focusableElements.length) {
index = 0; // go to last item
} else if (index === -1) {
index = focusableElements.length - 1;
}

return focusableElements[index].focus();
} // no visible focusable elements, focus the popup


getPopup().focus();
};
var arrowKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Left', 'Right', 'Up', 'Down' // IE11
];
var escKeys = ['Escape', 'Esc' // IE11
];

var keydownHandler = function keydownHandler(instance, e, innerParams, dismissWith) {
if (innerParams.stopKeydownPropagation) {
e.stopPropagation();
} // ENTER


if (e.key === 'Enter') {
handleEnter(instance, e, innerParams); // TAB
} else if (e.key === 'Tab') {
handleTab(e, innerParams); // ARROWS - switch focus between buttons
} else if (arrowKeys.indexOf(e.key) !== -1) {
handleArrows(); // ESC
} else if (escKeys.indexOf(e.key) !== -1) {
handleEsc(e, innerParams, dismissWith);
}
};

var handleEnter = function handleEnter(instance, e, innerParams) {
// #720 #721
if (e.isComposing) {
return;
}

if (e.target && instance.getInput() && e.target.outerHTML === instance.getInput().outerHTML) {
if (['textarea', 'file'].indexOf(innerParams.input) !== -1) {
return; // do not submit
}

clickConfirm();
e.preventDefault();
}
};

var handleTab = function handleTab(e, innerParams) {
var targetElement = e.target;
var focusableElements = getFocusableElements();
var btnIndex = -1;

for (var i = 0; i < focusableElements.length; i++) {
if (targetElement === focusableElements[i]) {
btnIndex = i;
break;
}
}

if (!e.shiftKey) {
// Cycle to the next button
setFocus(innerParams, btnIndex, 1);
} else {
// Cycle to the prev button
setFocus(innerParams, btnIndex, -1);
}

e.stopPropagation();
e.preventDefault();
};

var handleArrows = function handleArrows() {
var confirmButton = getConfirmButton();
var cancelButton = getCancelButton(); // focus Cancel button if Confirm button is currently focused

if (document.activeElement === confirmButton && isVisible(cancelButton)) {
cancelButton.focus(); // and vice versa
} else if (document.activeElement === cancelButton && isVisible(confirmButton)) {
confirmButton.focus();
}
};

var handleEsc = function handleEsc(e, innerParams, dismissWith) {
if (callIfFunction(innerParams.allowEscapeKey)) {
e.preventDefault();
dismissWith(DismissReason.esc);
}
};

var handlePopupClick = function handlePopupClick(domCache, innerParams, dismissWith) {
if (innerParams.toast) {
handleToastClick(domCache, innerParams, dismissWith);
} else {
// Ignore click events that had mousedown on the popup but mouseup on the container
// This can happen when the user drags a slider
handleModalMousedown(domCache); // Ignore click events that had mousedown on the container but mouseup on the popup

handleContainerMousedown(domCache);
handleModalClick(domCache, innerParams, dismissWith);
}
};

var handleToastClick = function handleToastClick(domCache, innerParams, dismissWith) {
// Closing toast by internal click
domCache.popup.onclick = function () {
if (innerParams.showConfirmButton || innerParams.showCancelButton || innerParams.showCloseButton || innerParams.input) {
return;
}

dismissWith(DismissReason.close);
};
};

var ignoreOutsideClick = false;

var handleModalMousedown = function handleModalMousedown(domCache) {
domCache.popup.onmousedown = function () {
domCache.container.onmouseup = function (e) {
domCache.container.onmouseup = undefined; // We only check if the mouseup target is the container because usually it doesn't
// have any other direct children aside of the popup

if (e.target === domCache.container) {
ignoreOutsideClick = true;
}
};
};
};

var handleContainerMousedown = function handleContainerMousedown(domCache) {
domCache.container.onmousedown = function () {
domCache.popup.onmouseup = function (e) {
domCache.popup.onmouseup = undefined; // We also need to check if the mouseup target is a child of the popup

if (e.target === domCache.popup || domCache.popup.contains(e.target)) {
ignoreOutsideClick = true;
}
};
};
};

var handleModalClick = function handleModalClick(domCache, innerParams, dismissWith) {
domCache.container.onclick = function (e) {
if (ignoreOutsideClick) {
ignoreOutsideClick = false;
return;
}

if (e.target === domCache.container && callIfFunction(innerParams.allowOutsideClick)) {
dismissWith(DismissReason.backdrop);
}
};
};

function _main(userParams) {
showWarningsForParams(userParams); // Check if there is another Swal closing

if (getPopup() && globalState.swalCloseEventFinishedCallback) {
globalState.swalCloseEventFinishedCallback();
delete globalState.swalCloseEventFinishedCallback;
} // Check if there is a swal disposal defer timer


if (globalState.deferDisposalTimer) {
clearTimeout(globalState.deferDisposalTimer);
delete globalState.deferDisposalTimer;
}

var innerParams = _extends({}, defaultParams, userParams);

setParameters(innerParams);
Object.freeze(innerParams); // clear the previous timer

if (globalState.timeout) {
globalState.timeout.stop();
delete globalState.timeout;
} // clear the restore focus timeout


clearTimeout(globalState.restoreFocusTimeout);
var domCache = populateDomCache(this);
render(this, innerParams);
privateProps.innerParams.set(this, innerParams);
return swalPromise(this, domCache, innerParams);
}

var swalPromise = function swalPromise(instance, domCache, innerParams) {
return new Promise(function (resolve) {
// functions to handle all closings/dismissals
var dismissWith = function dismissWith(dismiss) {
instance.closePopup({
dismiss: dismiss
});
};

privateMethods.swalPromiseResolve.set(instance, resolve);
setupTimer(globalState, innerParams, dismissWith);

domCache.confirmButton.onclick = function () {
return handleConfirmButtonClick(instance, innerParams);
};

domCache.cancelButton.onclick = function () {
return handleCancelButtonClick(instance, dismissWith);
};

domCache.closeButton.onclick = function () {
return dismissWith(DismissReason.close);
};

handlePopupClick(domCache, innerParams, dismissWith);
addKeydownHandler(instance, globalState, innerParams, dismissWith);

if (innerParams.toast && (innerParams.input || innerParams.footer || innerParams.showCloseButton)) {
addClass(document.body, swalClasses['toast-column']);
} else {
removeClass(document.body, swalClasses['toast-column']);
}

handleInputOptionsAndValue(instance, innerParams);
openPopup(innerParams);
initFocus(domCache, innerParams); // Scroll container to top on open (#1247)

domCache.container.scrollTop = 0;
});
};

var populateDomCache = function populateDomCache(instance) {
var domCache = {
popup: getPopup(),
container: getContainer(),
content: getContent(),
actions: getActions(),
confirmButton: getConfirmButton(),
cancelButton: getCancelButton(),
closeButton: getCloseButton(),
validationMessage: getValidationMessage(),
progressSteps: getProgressSteps()
};
privateProps.domCache.set(instance, domCache);
return domCache;
};

var setupTimer = function setupTimer(globalState$$1, innerParams, dismissWith) {
if (innerParams.timer) {
globalState$$1.timeout = new Timer(function () {
dismissWith('timer');
delete globalState$$1.timeout;
}, innerParams.timer);
}
};

var initFocus = function initFocus(domCache, innerParams) {
if (innerParams.toast) {
return;
}

if (!callIfFunction(innerParams.allowEnterKey)) {
return blurActiveElement();
}

if (innerParams.focusCancel && isVisible(domCache.cancelButton)) {
return domCache.cancelButton.focus();
}

if (innerParams.focusConfirm && isVisible(domCache.confirmButton)) {
return domCache.confirmButton.focus();
}

setFocus(innerParams, -1, 1);
};

var blurActiveElement = function blurActiveElement() {
if (document.activeElement && typeof document.activeElement.blur === 'function') {
document.activeElement.blur();
}
};

/**
* Updates popup parameters.
*/

function update(params) {
var popup = getPopup();

if (!popup || hasClass(popup, swalClasses.hide)) {
return warn("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");
}

var validUpdatableParams = {}; // assign valid params from `params` to `defaults`

Object.keys(params).forEach(function (param) {
if (Swal.isUpdatableParameter(param)) {
validUpdatableParams[param] = params[param];
} else {
warn("Invalid parameter to update: \"".concat(param, "\". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js"));
}
});
var innerParams = privateProps.innerParams.get(this);

var updatedParams = _extends({}, innerParams, validUpdatableParams);

render(this, updatedParams);
privateProps.innerParams.set(this, updatedParams);
Object.defineProperties(this, {
params: {
value: _extends({}, this.params, params),
writable: false,
enumerable: true
}
});
}



var instanceMethods = Object.freeze({
hideLoading: hideLoading,
disableLoading: hideLoading,
getInput: getInput$1,
close: close,
closePopup: close,
closeModal: close,
closeToast: close,
enableButtons: enableButtons,
disableButtons: disableButtons,
enableConfirmButton: enableConfirmButton,
disableConfirmButton: disableConfirmButton,
enableInput: enableInput,
disableInput: disableInput,
showValidationMessage: showValidationMessage,
resetValidationMessage: resetValidationMessage$1,
getProgressSteps: getProgressSteps$1,
setProgressSteps: setProgressSteps,
showProgressSteps: showProgressSteps,
hideProgressSteps: hideProgressSteps,
_main: _main,
update: update
});

var currentInstance; // SweetAlert constructor

function SweetAlert() {
// Prevent run in Node env

/* istanbul ignore if */
if (typeof window === 'undefined') {
return;
} // Check for the existence of Promise

/* istanbul ignore if */


if (typeof Promise === 'undefined') {
error('This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)');
}

currentInstance = this;

for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}

var outerParams = Object.freeze(this.constructor.argsToParams(args));
Object.defineProperties(this, {
params: {
value: outerParams,
writable: false,
enumerable: true,
configurable: true
}
});

var promise = this._main(this.params);

privateProps.promise.set(this, promise);
} // `catch` cannot be the name of a module export, so we define our thenable methods here instead


SweetAlert.prototype.then = function (onFulfilled) {
var promise = privateProps.promise.get(this);
return promise.then(onFulfilled);
};

SweetAlert.prototype["finally"] = function (onFinally) {
var promise = privateProps.promise.get(this);
return promise["finally"](onFinally);
}; // Assign instance methods from src/instanceMethods/*.js to prototype


_extends(SweetAlert.prototype, instanceMethods); // Assign static methods from src/staticMethods/*.js to constructor


_extends(SweetAlert, staticMethods); // Proxy to instance methods to constructor, for now, for backwards compatibility


Object.keys(instanceMethods).forEach(function (key) {
SweetAlert[key] = function () {
if (currentInstance) {
var _currentInstance;

return (_currentInstance = currentInstance)[key].apply(_currentInstance, arguments);
}
};
});
SweetAlert.DismissReason = DismissReason;
SweetAlert.version = '8.19.0';

var Swal = SweetAlert;
Swal["default"] = Swal;

return Swal;

})));
if (typeof this !== 'undefined' && this.Sweetalert2){ this.swal = this.sweetAlert = this.Swal = this.SweetAlert = this.Sweetalert2}

"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,"@charset \"UTF-8\";.swal2-popup.swal2-toast{flex-direction:row;align-items:center;width:auto;padding:.625em;overflow-y:hidden;box-shadow:0 0 .625em #d9d9d9}.swal2-popup.swal2-toast .swal2-header{flex-direction:row}.swal2-popup.swal2-toast .swal2-title{flex-grow:1;justify-content:flex-start;margin:0 .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{position:static;width:.8em;height:.8em;line-height:.8}.swal2-popup.swal2-toast .swal2-content{justify-content:flex-start;font-size:1em}.swal2-popup.swal2-toast .swal2-icon{width:2em;min-width:2em;height:2em;margin:0}.swal2-popup.swal2-toast .swal2-icon::before{display:flex;align-items:center;font-size:2em;font-weight:700}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-popup.swal2-toast .swal2-icon::before{font-size:.25em}}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{flex-basis:auto!important;width:auto;height:auto;margin:0 .3125em}.swal2-popup.swal2-toast .swal2-styled{margin:0 .3125em;padding:.3125em .625em;font-size:1em}.swal2-popup.swal2-toast .swal2-styled:focus{box-shadow:0 0 0 .0625em #fff,0 0 0 .125em rgba(50,100,150,.4)}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-popup.swal2-toast .swal2-animate-success-icon .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-animate-success-icon .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-container{display:flex;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;flex-direction:row;align-items:center;justify-content:center;padding:.625em;overflow-x:hidden;transition:background-color .1s;background-color:transparent;-webkit-overflow-scrolling:touch}.swal2-container.swal2-top{align-items:flex-start}.swal2-container.swal2-top-left,.swal2-container.swal2-top-start{align-items:flex-start;justify-content:flex-start}.swal2-container.swal2-top-end,.swal2-container.swal2-top-right{align-items:flex-start;justify-content:flex-end}.swal2-container.swal2-center{align-items:center}.swal2-container.swal2-center-left,.swal2-container.swal2-center-start{align-items:center;justify-content:flex-start}.swal2-container.swal2-center-end,.swal2-container.swal2-center-right{align-items:center;justify-content:flex-end}.swal2-container.swal2-bottom{align-items:flex-end}.swal2-container.swal2-bottom-left,.swal2-container.swal2-bottom-start{align-items:flex-end;justify-content:flex-start}.swal2-container.swal2-bottom-end,.swal2-container.swal2-bottom-right{align-items:flex-end;justify-content:flex-end}.swal2-container.swal2-bottom-end>:first-child,.swal2-container.swal2-bottom-left>:first-child,.swal2-container.swal2-bottom-right>:first-child,.swal2-container.swal2-bottom-start>:first-child,.swal2-container.swal2-bottom>:first-child{margin-top:auto}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-container.swal2-shown{background-color:rgba(0,0,0,.4)}.swal2-popup{display:none;position:relative;box-sizing:border-box;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border:none;border-radius:.3125em;background:#fff;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-header{display:flex;flex-direction:column;align-items:center}.swal2-title{position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;flex-wrap:wrap;align-items:center;justify-content:center;width:100%;margin:1.25em auto 0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-actions.swal2-loading .swal2-styled.swal2-confirm{box-sizing:border-box;width:2.5em;height:2.5em;margin:.46875em;padding:0;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:.25em solid transparent;border-radius:100%;border-color:transparent;background-color:transparent!important;color:transparent;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-actions.swal2-loading .swal2-styled.swal2-cancel{margin-right:30px;margin-left:30px}.swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after{content:\"\";display:inline-block;width:15px;height:15px;margin-left:5px;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:3px solid #999;border-radius:50%;border-right-color:transparent;box-shadow:1px 1px 1px #fff}.swal2-styled{margin:.3125em;padding:.625em 2em;box-shadow:none;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#3085d6;color:#fff;font-size:1.0625em}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#aaa;color:#fff;font-size:1.0625em}.swal2-styled:focus{outline:0;box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(50,100,150,.4)}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1.25em 0 0;padding:1em 0 0;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-image{max-width:100%;margin:1.25em auto}.swal2-close{position:absolute;z-index:2;top:0;right:0;justify-content:center;width:1.2em;height:1.2em;padding:0;overflow:hidden;transition:color .1s ease-out;border:none;border-radius:0;outline:initial;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-content{z-index:1;justify-content:center;margin:0;padding:0;color:#545454;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em auto}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 3px #c4e6f5}.swal2-file::-webkit-input-placeholder,.swal2-input::-webkit-input-placeholder,.swal2-textarea::-webkit-input-placeholder{color:#ccc}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::-ms-input-placeholder,.swal2-input::-ms-input-placeholder,.swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em auto;background:inherit}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-input[type=number]{max-width:10em}.swal2-file{background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:inherit;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{margin:0 .4em}.swal2-validation-message{display:none;align-items:center;justify-content:center;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:\"!\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;border:.25em solid transparent;border-radius:50%;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon::before{display:flex;align-items:center;height:92%;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-warning::before{content:\"!\"}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-info::before{content:\"i\"}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-question::before{content:\"?\"}.swal2-icon.swal2-question.swal2-arabic-question-mark::before{content:\"؟\"}.swal2-icon.swal2-success{border-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.875em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-progress-steps{align-items:center;margin:0 0 1.25em;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;width:2em;height:2em;border-radius:2em;background:#3085d6;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#3085d6}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;width:2.5em;height:.4em;margin:0 -1px;background:#3085d6}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-show.swal2-noanimation{-webkit-animation:none;animation:none}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-hide.swal2-noanimation{-webkit-animation:none;animation:none}.swal2-rtl .swal2-close{right:auto;left:0}.swal2-animate-success-icon .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-animate-success-icon .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-animate-success-icon .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-animate-error-icon{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-animate-error-icon .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-moz-document url-prefix(){.swal2-close:focus{outline:2px solid rgba(50,100,150,.4)}}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.875em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.875em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-shown{top:auto;right:auto;bottom:auto;left:auto;max-width:calc(100% - .625em * 2);background-color:transparent}body.swal2-no-backdrop .swal2-shown>.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-shown.swal2-top{top:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-top-left,body.swal2-no-backdrop .swal2-shown.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-shown.swal2-top-end,body.swal2-no-backdrop .swal2-shown.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-shown.swal2-center{top:50%;left:50%;transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-shown.swal2-center-left,body.swal2-no-backdrop .swal2-shown.swal2-center-start{top:50%;left:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-center-end,body.swal2-no-backdrop .swal2-shown.swal2-center-right{top:50%;right:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-bottom{bottom:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-shown.swal2-bottom-left,body.swal2-no-backdrop .swal2-shown.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-shown.swal2-bottom-end,body.swal2-no-backdrop .swal2-shown.swal2-bottom-right{right:0;bottom:0}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-shown{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}body.swal2-toast-column .swal2-toast{flex-direction:column;align-items:stretch}body.swal2-toast-column .swal2-toast .swal2-actions{flex:1;align-self:stretch;height:2.2em;margin-top:.3125em}body.swal2-toast-column .swal2-toast .swal2-loading{justify-content:center}body.swal2-toast-column .swal2-toast .swal2-input{height:2em;margin:.3125em auto;font-size:1em}body.swal2-toast-column .swal2-toast .swal2-validation-message{font-size:1em}");

_config.anzhiyu.yml主题配置文件下inject配置项中bottom
引入上面的三个js文件

1
2
3
4
5
6
7
inject:
bottom:
# 公祭日和节日弹框
- <script defer type="text/javascript" src="/custom/dayalert/sweetalert2.all.js"></script> # 节日弹窗依赖
- <script defer src="/custom/dayalert/lunar.js"></script> # 农历计算
- <script defer src="/custom/dayalert/day.js"></script> # 节日弹窗