var AWN = (function (t) {
var e = {};
function n(o) {
if (e[o]) return e[o].exports;
var i = (e[o] = { i: o, l: !1, exports: {} });
return t[o].call(i.exports, i, i.exports, n), (i.l = !0), i.exports;
}
return (
(n.m = t),
(n.c = e),
(n.d = function (t, e, o) {
n.o(t, e) || Object.defineProperty(t, e, { enumerable: !0, get: o });
}),
(n.r = function (t) {
"undefined" != typeof Symbol &&
Symbol.toStringTag &&
Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }),
Object.defineProperty(t, "__esModule", { value: !0 });
}),
(n.t = function (t, e) {
if ((1 & e && (t = n(t)), 8 & e)) return t;
if (4 & e && "object" == typeof t && t && t.__esModule) return t;
var o = Object.create(null);
if (
(n.r(o),
Object.defineProperty(o, "default", { enumerable: !0, value: t }),
2 & e && "string" != typeof t)
)
for (var i in t)
n.d(
o,
i,
function (e) {
return t[e];
}.bind(null, i)
);
return o;
}),
(n.n = function (t) {
var e =
t && t.__esModule
? function () {
return t.default;
}
: function () {
return t;
};
return n.d(e, "a", e), e;
}),
(n.o = function (t, e) {
return Object.prototype.hasOwnProperty.call(t, e);
}),
(n.p = ""),
n((n.s = 0))
);
})([
function (t, e, n) {
t.exports = n(1).default;
},
function (t, e, n) {
"use strict";
function o(t) {
return (o =
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
? function (t) {
return typeof t;
}
: function (t) {
return t &&
"function" == typeof Symbol &&
t.constructor === Symbol &&
t !== Symbol.prototype
? "symbol"
: typeof t;
})(t);
}
function i(t, e) {
for (var n = 0; n < e.length; n++) {
var o = e[n];
(o.enumerable = o.enumerable || !1),
(o.configurable = !0),
"value" in o && (o.writable = !0),
Object.defineProperty(t, o.key, o);
}
}
n.r(e);
var r = {
maxNotifications: 10,
animationDuration: 300,
position: "bottom-right",
labels: {
tip: "Tip",
info: "Info",
success: "Success",
warning: "Attention",
alert: "Error",
async: "Loading",
confirm: "Confirmation required",
confirmOk: "OK",
confirmCancel: "Cancel",
},
icons: {
tip: "question-circle",
info: "info-circle",
success: "check-circle",
warning: "exclamation-circle",
alert: "exclamation-triangle",
async: "cog fa-spin",
confirm: "exclamation-triangle",
prefix: "",
enabled: !0,
},
replacements: {
tip: null,
info: null,
success: null,
warning: null,
alert: null,
async: null,
"async-block": null,
modal: null,
confirm: null,
general: { "": "" },
},
messages: {
tip: "",
info: "",
success: "Action has been succeeded",
warning: "",
alert: "Action has been failed",
confirm: "This action can't be undone. Continue?",
async: "Please, wait...",
"async-block": "Loading",
},
formatError: function (t) {
if (t.response) {
if (!t.response.data) return "500 API Server Error";
if (t.response.data.errors)
return t.response.data.errors
.map(function (t) {
return t.detail;
})
.join("
");
if (t.response.statusText)
return ""
.concat(t.response.status, " ")
.concat(t.response.statusText, ": ")
.concat(t.response.data);
}
return t.message ? t.message : t;
},
durations: {
global: 5e3,
success: null,
info: null,
tip: null,
warning: null,
alert: null,
},
minDurations: { async: 1e3, "async-block": 1e3 },
},
a = (function () {
function t() {
var e =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: {},
n =
arguments.length > 1 && void 0 !== arguments[1]
? arguments[1]
: r;
!(function (t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function");
})(this, t),
Object.assign(this, this.defaultsDeep(n, e));
}
var e, n, a;
return (
(e = t),
(n = [
{
key: "icon",
value: function (t) {
return this.icons.enabled
? ""
.concat(this.icons.prefix)
.concat(this.icons[t])
.concat(this.icons.suffix)
: "";
},
},
{
key: "label",
value: function (t) {
return this.labels[t];
},
},
{
key: "duration",
value: function (t) {
var e = this.durations[t];
return null === e ? this.durations.global : e;
},
},
{
key: "toSecs",
value: function (t) {
return "".concat(t / 1e3, "s");
},
},
{
key: "applyReplacements",
value: function (t, e) {
if (!t) return this.messages[e] || "";
for (var n = 0, o = ["general", e]; n < o.length; n++) {
var i = o[n];
if (this.replacements[i])
for (var r in this.replacements[i])
t = t.replace(r, this.replacements[i][r]);
}
return t;
},
},
{
key: "override",
value: function (e) {
return e ? new t(e, this) : this;
},
},
{
key: "defaultsDeep",
value: function (t, e) {
var n = {};
for (var i in t)
e.hasOwnProperty(i)
? (n[i] =
"object" === o(t[i]) && null !== t[i]
? this.defaultsDeep(t[i], e[i])
: e[i])
: (n[i] = t[i]);
return n;
},
},
]) && i(e.prototype, n),
a && i(e, a),
t
);
})(),
s = {
popup: "".concat("awn", "-popup"),
toast: "".concat("awn", "-toast"),
btn: "".concat("awn", "-btn"),
confirm: "".concat("awn", "-confirm"),
},
c = {
prefix: s.toast,
klass: {
label: "".concat(s.toast, "-label"),
content: "".concat(s.toast, "-content"),
icon: "".concat(s.toast, "-icon"),
progressBar: "".concat(s.toast, "-progress-bar"),
progressBarPause: "".concat(s.toast, "-progress-bar-paused"),
},
ids: { container: "".concat(s.toast, "-container") },
},
u = {
prefix: s.popup,
klass: {
buttons: "".concat("awn", "-buttons"),
button: s.btn,
successBtn: "".concat(s.btn, "-success"),
cancelBtn: "".concat(s.btn, "-cancel"),
title: "".concat(s.popup, "-title"),
body: "".concat(s.popup, "-body"),
content: "".concat(s.popup, "-content"),
dotAnimation: "".concat(s.popup, "-loading-dots"),
},
ids: {
wrapper: "".concat(s.popup, "-wrapper"),
confirmOk: "".concat(s.confirm, "-ok"),
confirmCancel: "".concat(s.confirm, "-cancel"),
},
},
l = { klass: { hiding: "".concat("awn", "-hiding") }, lib: "awn" };
function f(t, e) {
for (var n = 0; n < e.length; n++) {
var o = e[n];
(o.enumerable = o.enumerable || !1),
(o.configurable = !0),
"value" in o && (o.writable = !0),
Object.defineProperty(t, o.key, o);
}
}
var p = (function () {
function t(e, n, o, i, r) {
!(function (t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function");
})(this, t),
(this.newNode = document.createElement("div")),
n && (this.newNode.id = n),
o && (this.newNode.className = o),
i && (this.newNode.style.cssText = i),
(this.parent = e),
(this.options = r);
}
var e, n, o;
return (
(e = t),
(n = [
{ key: "beforeInsert", value: function () {} },
{ key: "afterInsert", value: function () {} },
{
key: "insert",
value: function () {
return (
this.beforeInsert(),
(this.el = this.parent.appendChild(this.newNode)),
this.afterInsert(),
this
);
},
},
{
key: "replace",
value: function (t) {
var e = this;
if (this.getElement())
return this.beforeDelete().then(function () {
return (
e.updateType(t.type),
e.parent.replaceChild(t.newNode, e.el),
(e.el = e.getElement(t.newNode)),
e.afterInsert(),
e
);
});
},
},
{
key: "beforeDelete",
value: function () {
var t = this,
e =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: this.el,
n = 0;
return (
this.start &&
(n =
this.options.minDurations[this.type] +
this.start -
Date.now()) < 0 &&
(n = 0),
new Promise(function (o) {
setTimeout(function () {
e.classList.add(l.klass.hiding),
setTimeout(o, t.options.animationDuration);
}, n);
})
);
},
},
{
key: "delete",
value: function () {
var t = this,
e =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: this.el;
return this.getElement(e)
? this.beforeDelete(e).then(function () {
e.remove(), t.afterDelete();
})
: null;
},
},
{ key: "afterDelete", value: function () {} },
{
key: "getElement",
value: function () {
var t =
arguments.length > 0 && void 0 !== arguments[0]
? arguments[0]
: this.el;
return t ? document.getElementById(t.id) : null;
},
},
{
key: "addEvent",
value: function (t, e) {
this.el.addEventListener(t, e);
},
},
{
key: "toggleClass",
value: function (t) {
this.el.classList.toggle(t);
},
},
{
key: "updateType",
value: function (t) {
(this.type = t),
(this.duration = this.options.duration(this.type));
},
},
]) && f(e.prototype, n),
o && f(e, o),
t
);
})();
function d(t, e) {
for (var n = 0; n < e.length; n++) {
var o = e[n];
(o.enumerable = o.enumerable || !1),
(o.configurable = !0),
"value" in o && (o.writable = !0),
Object.defineProperty(t, o.key, o);
}
}
var h = (function () {
function t(e, n) {
!(function (t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function");
})(this, t),
(this.callback = e),
(this.remaining = n),
this.resume();
}
var e, n, o;
return (
(e = t),
(n = [
{
key: "pause",
value: function () {
(this.paused = !0),
window.clearTimeout(this.timerId),
(this.remaining -= new Date() - this.start);
},
},
{
key: "resume",
value: function () {
var t = this;
(this.paused = !1),
(this.start = new Date()),
window.clearTimeout(this.timerId),
(this.timerId = window.setTimeout(function () {
window.clearTimeout(t.timerId), t.callback();
}, this.remaining));
},
},
{
key: "toggle",
value: function () {
this.paused ? this.resume() : this.pause();
},
},
]) && d(e.prototype, n),
o && d(e, o),
t
);
})();
function y(t) {
return (y =
"function" == typeof Symbol && "symbol" == typeof Symbol.iterator
? function (t) {
return typeof t;
}
: function (t) {
return t &&
"function" == typeof Symbol &&
t.constructor === Symbol &&
t !== Symbol.prototype
? "symbol"
: typeof t;
})(t);
}
function m(t, e) {
for (var n = 0; n < e.length; n++) {
var o = e[n];
(o.enumerable = o.enumerable || !1),
(o.configurable = !0),
"value" in o && (o.writable = !0),
Object.defineProperty(t, o.key, o);
}
}
function v(t, e) {
return !e || ("object" !== y(e) && "function" != typeof e)
? (function (t) {
if (void 0 === t)
throw new ReferenceError(
"this hasn't been initialised - super() hasn't been called"
);
return t;
})(t)
: e;
}
function b(t) {
return (b = Object.setPrototypeOf
? Object.getPrototypeOf
: function (t) {
return t.__proto__ || Object.getPrototypeOf(t);
})(t);
}
function k(t, e) {
return (k =
Object.setPrototypeOf ||
function (t, e) {
return (t.__proto__ = e), t;
})(t, e);
}
var g = (function (t) {
function e(t, n, o, i) {
var r;
return (
(function (t, e) {
if (!(t instanceof e))
throw new TypeError("Cannot call a class as a function");
})(this, e),
(r = v(
this,
b(e).call(
this,
i,
""
.concat(c.prefix, "-")
.concat(Math.floor(Date.now() - 100 * Math.random())),
"".concat(c.prefix, " ").concat(c.prefix, "-").concat(n),
"animation-duration: ".concat(o.toSecs(o.animationDuration), ";"),
o
)
)).updateType(n),
r.setInnerHtml(t),
r
);
}
var n, o, i;
return (
(function (t, e) {
if ("function" != typeof e && null !== e)
throw new TypeError(
"Super expression must either be null or a function"
);
(t.prototype = Object.create(e && e.prototype, {
constructor: { value: t, writable: !0, configurable: !0 },
})),
e && k(t, e);
})(e, t),
(n = e),
(o = [
{
key: "setInnerHtml",
value: function (t) {
"alert" === this.type && t && (t = this.options.formatError(t)),
(t = this.options.applyReplacements(t, this.type)),
(this.newNode.innerHTML = '