/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/react-native-alarm-notification@1.8.0/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
import{NativeModules}from"react-native";const{RNAlarmNotification:RNAlarmNotification}=NativeModules,ReactNativeAN={},parseDateString=e=>{const t=e.split(" "),a=t[0].split("-"),i=t[1].split(":"),o=a[2],r=a[1],n=a[0],l=i[0],s=i[1],d=i[2];return new Date(o,r-1,n,l,s,d)};ReactNativeAN.scheduleAlarm=async e=>{if(!e.fire_date||e.fire_date&&""===e.fire_date)throw new Error("failed to schedule alarm because fire date is missing");if(parseDateString(e.fire_date)<new Date)throw new Error("failed to schedule alarm because fire date is in the past");const t=e.repeat_interval||"hourly",a=e.interval_value||1;if(isNaN(a))throw new Error("interval value should be a number");if("minutely"===t&&(a<1||a>59))throw new Error("interval value should be between 1 and 59 minutes");if("hourly"===t&&(a<1||a>23))throw new Error("interval value should be between 1 and 23 hours");const i={...e,has_button:e.has_button||!1,vibrate:void 0===e.vibrate||e.vibrate,play_sound:void 0===e.play_sound||e.play_sound,schedule_type:e.schedule_type||"once",repeat_interval:e.repeat_interval||"hourly",interval_value:e.interval_value||1,volume:e.volume||.5,sound_name:e.sound_name||"",snooze_interval:e.snooze_interval||1,data:e.data||"",loop_sound:e.loop_sound||!1};return await RNAlarmNotification.scheduleAlarm(i)},ReactNativeAN.sendNotification=e=>{const t={...e,has_button:!1,vibrate:void 0===e.vibrate||e.vibrate,play_sound:void 0===e.play_sound||e.play_sound,schedule_type:e.schedule_type||"once",volume:e.volume||.5,sound_name:e.sound_name||"",snooze_interval:e.snooze_interval||1,data:e.data||""};RNAlarmNotification.sendNotification(t)},ReactNativeAN.deleteAlarm=e=>{if(!e)throw new Error("id is required to delete alarm");RNAlarmNotification.deleteAlarm(e)},ReactNativeAN.deleteRepeatingAlarm=e=>{if(!e)throw new Error("id is required to delete alarm");RNAlarmNotification.deleteRepeatingAlarm(e)},ReactNativeAN.stopAlarmSound=()=>RNAlarmNotification.stopAlarmSound(),ReactNativeAN.removeFiredNotification=e=>{if(!e)throw new Error("id is required to remove notification");RNAlarmNotification.removeFiredNotification(e)},ReactNativeAN.removeAllFiredNotifications=()=>{RNAlarmNotification.removeAllFiredNotifications()},ReactNativeAN.getScheduledAlarms=async()=>await RNAlarmNotification.getScheduledAlarms(),ReactNativeAN.requestPermissions=async e=>{let t={alert:!0,badge:!0,sound:!0};return e&&(t={alert:!!e.alert,badge:!!e.badge,sound:!!e.sound}),await RNAlarmNotification.requestPermissions(t)},ReactNativeAN.checkPermissions=e=>{RNAlarmNotification.checkPermissions(e)},ReactNativeAN.parseDate=e=>{let t,a,i;return t=1===e.getHours().toString().length?`0${e.getHours()}`:`${e.getHours()}`,a=1===e.getDate().toString().length?`0${e.getDate()}`:`${e.getDate()}`,i=1===e.getMonth().toString().length?`0${e.getMonth()+1}`:`${e.getMonth()+1}`,`${a}-${i}-${e.getFullYear()} ${t}:${e.getMinutes()}:${e.getSeconds()}`};export default ReactNativeAN;
//# sourceMappingURL=/sm/27c0655459c47fdbc1d2fabfb7c764de4431111570a4160964a39d2cb2060829.map