define(["jQuery","loading","libraryMenu","listViewStyle"],function($,loading,libraryMenu){"use strict";function reload(page){loading.show(),ApiClient.getJSON(ApiClient.getUrl("Notifications/Types")).then(function(list){var html="",lastCategory="";html+=list.map(function(i){var itemHtml="";return i.Category!=lastCategory&&(lastCategory=i.Category,lastCategory&&(itemHtml+=""),itemHtml+="
",itemHtml+=i.Category,itemHtml+="
",itemHtml+=''),itemHtml+='
',itemHtml+='',itemHtml+=i.Enabled?'
notifications_active':'
notifications_off',itemHtml+='
',itemHtml+='
'+i.Name+"
",itemHtml+="
",itemHtml+='
',itemHtml+="
",itemHtml+=""}).join(""),list.length&&(html+="
"),$(".notificationList",page).html(html).trigger("create"),loading.hide()})}function getTabs(){return[{href:"notificationsettings.html",name:Globalize.translate("TabNotifications")},{href:"appservices.html?context=notifications",name:Globalize.translate("TabServices")}]}return function(view,params){view.addEventListener("viewshow",function(){libraryMenu.setTabs("notifications",0,getTabs),reload(view)})}});