var Unibase;(function(n){let t;(function(t){let i;(function(i){let r;(function(i){class r extends t.Core.BaseComponent{constructor(){super(...arguments);this.instantReminderId=0;this.isduplicate=!0}cssFiles(){return[]}jsFiles(){return["platform/communications/managers/reminders/remindermanager.js","platform/communications/requests/reminders/instantreminder.js","platform/communications/infos/reminders/instantreminder.js","platform/communications/requests/reminders/instantreminder.js","libs/jquery/pagination/jquery.pagination.js","platform/communications/enums/reminders/instantreminderstatus.js"]}html(){return`
Count:0 Isduplicate IsUnique
`}load(t,i){$("#btnCloseInstantreminder").click(function(){$("#"+i).modal("hide");$("#"+i).remove()});$('input[name="instantreminder_option"]').change(function(){var t=$(".isduplicate").is(":checked");n.Platform.Communications.Managers.ReminderManager.Instance().updateIsDuplicate(r.Instance().instantReminderId,t).then(function(t){t.result!=null&&(r.Instance().isduplicate=t.result,MessageHelper.Instance().showSuccess(t.message,"message_div"),$(".ActionsDatalist_body").html(""),n.Platform.Communications.Managers.ReminderManager.Instance().getRecipients(r.Instance().instantReminderId,t.result).then(function(t){t.result!=null&&n.Platform.Communications.Components.InstantReminders_Widget.Instance().loadrecipients(t.result)}))})});r.Instance().isduplicate?$(".isduplicate").prop("checked",!0):$(".isunique").prop("checked",!0)}init(t){if(n.Themes.Providers.Detail_Settings.Instance().InputParameters.length>0)for(let t of n.Themes.Providers.Detail_Settings.Instance().InputParameters)t.Key==="hf_"+n.Themes.Providers.DetailHelper.installedAppId+"_recordid"&&(r.Instance().instantReminderId=Number(t.Value));n.Platform.Communications.Components.InstantReminders_Widget.Instance().loadJsFiles();n.Platform.Communications.Components.InstantReminders_Widget.Instance().render(t)}render(t){var i=`
Reminder Details
`;$("."+t).append(i);n.Platform.Communications.Components.InstantReminders_Widget.Instance().loaddetails(r.Instance().instantReminderId)}loaddetails(t){n.Platform.Communications.Managers.ReminderManager.Instance().getInstantReminder(t).then(function(t){if(t.result!=null){r.Instance().isduplicate=t.result.IsDuplicate;var i="
SubjectBody Recipients
"+t.result.Subject+"<\/td>"+t.result.Body+'<\/td>Recipients<\/a><\/td>S.no<\/th>"+r;$("#Reminders_Row").html(r);$("#response_count").text(t.length);n.Platform.Communications.Components.InstantReminders_Widget.Instance().loaddata(0,t,i);u=$("#divpagination");u.pagination(t.length,10,{current_page:0,callback:function(r){n.Platform.Communications.Components.InstantReminders_Widget.Instance().loaddata(r,t,i)}})}loaddata(n,t,i){var r;$(".ActionsDatalist_body").html("");var u=(n+1)*10,e=u-10,f="";for(let n=e;nn){r="";for(let u=0;u"+t[n][i[u]]+"<\/td>";f+="
"+(n+1)+"<\/td>"+r+"<\/tr>"}else break;$(".ActionsDatalist_body").html(f)}loadJsFiles(){var t=n.Platform.Communications.Components.InstantReminders_Widget.Instance().jsFiles();n.Platform.Helpers.FileCacheHelper.Instance().loadJsFiles(t,function(){})}sendReminder(t){var i=new n.Platform.Communications.Requests.InstantReminder;i.InstantReminderId=t;i.ReminderStatus=Number(n.Platform.Communications.Enums.InstantReminderStatus.Active);n.Platform.Communications.Managers.ReminderManager.Instance().sendInstantReminder(i).then(function(){$(".send_btn").addClass("d-none")})}static Instance(){return this.instance==undefined&&(this.instance=new r),this.instance}}i.InstantReminders_Widget=r})(r=i.Components||(i.Components={}))})(i=t.Communications||(t.Communications={}))})(t=n.Platform||(n.Platform={}))})(Unibase||(Unibase={}));