{"version":3,"file":"SystemNotificationMaker.min.js","sources":["Notification/SystemNotificationMaker.js"],"sourcesContent":["\"use strict\";\r\n$(function () {\r\n const notificationClosedKey = \"ActiveNotificationClosed\";\r\n const notificationDataKey = \"NotificationData\";\r\n if (sessionStorage.getItem(notificationClosedKey) === \"true\") {\r\n return;\r\n }\r\n let notificationData = sessionStorage.getItem(notificationDataKey);\r\n if (notificationData) {\r\n let notificationInfo = JSON.parse(notificationData);\r\n displayNotification(notificationInfo);\r\n return;\r\n }\r\n $.ajax({\r\n url: getNotificationUrl,\r\n type: \"GET\",\r\n async: true,\r\n success: function (response) {\r\n if (response == null) {\r\n return;\r\n }\r\n if (response) {\r\n let notificationInfo = {\r\n id: response.Id,\r\n buttonText: response.ButtonText,\r\n cookieName: \"system-notification-\" + response.UpdatedStamp,\r\n text: response.LocalizedMessage,\r\n themeClass: \"light\",\r\n title: response.Title,\r\n daysUntilExpiry: response.daysUntilExpiry,\r\n position: \"top\",\r\n };\r\n displayNotification(notificationInfo);\r\n sessionStorage.setItem(notificationDataKey, JSON.stringify(notificationInfo));\r\n }\r\n },\r\n });\r\n});\r\nfunction displayNotification(notificationInfo) {\r\n let systemNotificationMaker = new SystemNotificationMaker({\r\n id: notificationInfo.id,\r\n buttonText: notificationInfo.buttonText,\r\n cookieName: notificationInfo.cookieName,\r\n text: notificationInfo.text,\r\n themeClass: notificationInfo.themeClass,\r\n title: notificationInfo.title,\r\n position: notificationInfo.position,\r\n daysUntilExpiry: notificationInfo.daysUntilExpiry\r\n });\r\n if (!systemNotificationMaker.isNotificationChecked) {\r\n systemNotificationMaker.appendToBody();\r\n $('#' + systemNotificationMaker.eventPopupIds.popupId).slideToggle();\r\n }\r\n}\r\nclass SystemNotificationMaker {\r\n constructor(option) {\r\n this.option = option;\r\n this.init();\r\n }\r\n init() {\r\n this.eventPopupIds = {\r\n popupId: `system-notification-popup-container-${this.option.id}`,\r\n buttonId: `system-notification-button-${this.option.id}`\r\n };\r\n this.isNotificationChecked = CookieLibrary.getCookie(this.option.cookieName) != null;\r\n }\r\n getHtml() {\r\n if (this.isNotificationChecked)\r\n return null;\r\n return `
${this.option.text}
\r\n