/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/appointment-module-prodio@1.0.4/lib/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},axios=require("axios"),_require=require("flatted/cjs"),parse=_require.parse,stringify=_require.stringify,HttpErrors=require("http-errors"),isNull=function(e){return"string"==typeof e&&(e=e.trim()),null==e||void 0===e||""===e||"undefined"===e},isJson=function(e){try{var t=JSON.parse(JSON.stringify(e));if(t&&"object"===(void 0===t?"undefined":_typeof(t))&&null!==t)return!0}catch(e){return!1}return!1};function appointmentServices(e){this.execute=function(t,i){if(!t.action)return"Please provide valid action";switch(t.action){case"ADD_BIZ_SITE":case"EDIT_BIZ_SITE":return funAddEditBizSite(e,t,i);case"ADD_BIZ_SERVICE":case"EDIT_BIZ_SERVICE":return funAddEditBizService(e,t,i);case"ADD_BIZ_SERVICEPROVIDER":case"EDIT_BIZ_SERVICEPROVIDER":return funAddEditBizServiceProvider(e,t,i);case"ADD_BIZ_CLIENT":case"EDIT_BIZ_CLIENT":return funAddEditBizClient(e,t,i);case"LIST_BIZ_CLIENTS":return funListBizClients(e,t,i);case"REMOVE_BIZ_CLIENTS":return funRemoveBizClients(e,t,i);case"LIST_BIZ_SERVICEPROVIDERS":return funListBizServiceProviders(e,t,i);case"REMOVE_BIZ_SERVICEPROVIDERS":return funRemoveBizServiceProviders(e,t,i);case"BOOK_APPOINTMENT":return funBookAppointment(e,t,i);case"EDIT_APPOINTMENT":return funEditAppointment(e,t,i);case"RESCHEDULE_APPOINTMENT":return funRescheuldeAppointment(e,t,i);case"GET_APPOINTMENT_DETAILS":return funGetAppointmentProfile(e,t,i);case"CANCEL_APPOINTMENT":return funCancelAppointment(e,t,i);case"COMPLETE_APPOINTMENT":return funCompleteAppointment(e,t,i);case"DELETE_APPOINTMENT":return funDeleteAppointment(e,t,i);case"CONFIRM_APPOINTMENT":return funConfirmAppointment(e,t,i);case"LIST_APPOINTMENTS":return funListAppointments(e,t,i);case"LIST_APPOINTMENTS_BY_SERVICE":return funListAppointmentsByService(e,t,i);case"GET_SERVICEPROVIDERS_CALENDAR":return funGetServiceProvidersCalendar(e,t,i);case"GET_APPOINTMENTS_CALENDAR":return funGetAppointmentsCalendar(e,t,i);default:return"Please add BaseUrl."}}}var funAddEditBizSite=function(e,t,i){var n=t.meta.bizSiteId;if(isNull(n))return i(new HttpErrors.BadRequest("bizSiteId is mandatory.",{expose:!1}));var r=e+"BizSites/createUpdateBusinessSite";axios.post(r,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funAddEditBizService=function(e,t,i){var n=t.meta.bizSiteId;if(isNull(n))return i(new HttpErrors.BadRequest("bizSiteId is mandatory.",{expose:!1}));var r=t.meta.bizServiceId;if(isNull(r))return i(new HttpErrors.BadRequest("bizServiceId is mandatory.",{expose:!1}));var s=e+"BizServices/addEditService?businessSiteId="+n;axios.post(s,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funAddEditBizServiceProvider=function(e,t,i){var n=t.meta.bizSiteId;if(isNull(n))return i(new HttpErrors.BadRequest("bizSiteId is mandatory.",{expose:!1}));var r=t.meta.bizServiceProviderId;if(isNull(r))return i(new HttpErrors.BadRequest("bizServiceProviderId is mandatory.",{expose:!1}));var s=e+"BizServiceProviders/addEditServiceProvider?businessSiteId="+n;axios.post(s,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funAddEditBizClient=function(e,t,i){var n=t.meta.bizSiteId;if(isNull(n))return i(new HttpErrors.BadRequest("bizSiteId is mandatory.",{expose:!1}));var r=t.meta.bizClientId;if(isNull(r))return i(new HttpErrors.BadRequest("bizClientId is mandatory.",{expose:!1}));var s=e+"BizClients/addEditClient?businessSiteId="+n;axios.post(s,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funListBizClients=function(e,t,i){var n=t.meta.bizSiteId;if(isNull(n))return i(new HttpErrors.BadRequest("bizSiteId is mandatory.",{expose:!1}));var r=0;isNull(bizClientId)||(r=t.meta.pageNo);var s=e+"BizClients/listClients?businessSiteId="+n+"&pageNo="+r;axios.post(s,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funRemoveBizClients=function(e,t,i){var n=t.meta.bizSiteId;if(isNull(n))return i(new HttpErrors.BadRequest("bizSiteId is mandatory.",{expose:!1}));var r=t.meta.businessClientIds;if(isNull(r))return i(new HttpErrors.BadRequest("businessClientIds is mandatory.",{expose:!1}));var s=e+"BizClients/removeClientFromSite?businessSiteId="+n+"&businessClientIds="+r;axios.post(s,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funListBizServiceProviders=function(e,t,i){var n=t.meta.bizSiteId;if(isNull(n))return i(new HttpErrors.BadRequest("bizSiteId is mandatory.",{expose:!1}));var r=0;isNull(bizClientId)||(r=t.meta.pageNo);var s=e+"BizServiceProviders/listServiceProviders?businessSiteId="+n+"&pageNo="+r;axios.post(s,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funRemoveBizServiceProviders=function(e,t,i){var n=t.meta.bizSiteId;if(isNull(n))return i(new HttpErrors.BadRequest("bizSiteId is mandatory.",{expose:!1}));var r=t.meta.businessProviderIds;if(isNull(r))return i(new HttpErrors.BadRequest("businessProviderIds is mandatory.",{expose:!1}));var s=e+"BizServiceProviders/removeServiceProviderFromSite?businessSiteId="+n+"&businessProviderIds="+r;axios.post(s,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funBookAppointment=function(e,t,i){var n=t.meta.bizSiteId;if(isNull(n))return i(new HttpErrors.BadRequest("bizSiteId is mandatory.",{expose:!1}));var r=t.meta.bizClientId;if(isNull(r))return i(new HttpErrors.BadRequest("bizClientId is mandatory.",{expose:!1}));var s=e+"BizAppointments/createAppointment?businessSiteId="+n;axios.post(s,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funEditAppointment=function(e,t,i){var n=t.meta.bizSiteId;if(isNull(n))return i(new HttpErrors.BadRequest("bizSiteId is mandatory.",{expose:!1}));var r=t.meta.appointmentId;if(isNull(r))return i(new HttpErrors.BadRequest("appointmentId is mandatory.",{expose:!1}));var s=e+"BizAppointments/editAppointment?appointmentId="+r;axios.post(s,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funRescheuldeAppointment=function(e,t,i){var n=t.meta.bizSiteId;if(isNull(n))return i(new HttpErrors.BadRequest("bizSiteId is mandatory.",{expose:!1}));var r=t.meta.appointmentId;if(isNull(r))return i(new HttpErrors.BadRequest("appointmentId is mandatory.",{expose:!1}));var s=e+"BizAppointments/rescheduleAppointment?appointmentId="+r;axios.post(s,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funCompleteAppointment=function(e,t,i){var n=t.meta.appointmentId;if(isNull(n))return i(new HttpErrors.BadRequest("appointmentId is mandatory.",{expose:!1}));var r=e+"BizAppointments/markCompleteAppointment?appointmentId="+n;axios.post(r,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funCancelAppointment=function(e,t,i){var n=t.meta.appointmentId;if(isNull(n))return i(new HttpErrors.BadRequest("appointmentId is mandatory.",{expose:!1}));var r=e+"BizAppointments/cancelAppointment?appointmentId="+n;axios.post(r,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funDeleteAppointment=function(e,t,i){var n=t.meta.appointmentId;if(isNull(n))return i(new HttpErrors.BadRequest("appointmentId is mandatory.",{expose:!1}));var r=e+"BizAppointments/deleteAppointment?appointmentId="+n;axios.post(r,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funConfirmAppointment=function(e,t,i){var n=t.meta.appointmentId;if(isNull(n))return i(new HttpErrors.BadRequest("appointmentId is mandatory.",{expose:!1}));var r=e+"BizAppointments/confirmAppointment?appointmentId="+n;axios.post(r,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funListAppointmentsByService=function(e,t,i){var n="";isNull(t.meta.bizSiteId)||(n=t.meta.bizSiteId);var r="";isNull(t.meta.bizServiceId)||(r=t.meta.bizServiceId);var s=0;isNull(t.meta.pageNo)||(s=t.meta.pageNo);var a="";isNull(t.meta.timeframe)||(a=t.meta.timeframe);var o=e+"BizAppointments/listAppointmentsByService?businessSiteId="+n+"&businessServiceId="+r+"&pageNo="+s+"&timeframe="+a;axios.post(o,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funListAppointments=function(e,t,i){var n="";isNull(t.meta.bizSiteId)||(n=t.meta.bizSiteId);var r="";isNull(t.meta.bizClientId)||(r=t.meta.bizClientId);var s=0;isNull(t.meta.pageNo)||(s=t.meta.pageNo);var a="";isNull(t.meta.timeframe)||(a=t.meta.timeframe);var o="";isNull(t.meta.month)||(o=t.meta.month);var u="";isNull(t.meta.year)||(u=t.meta.year);var p="";isNull(t.meta.source)||(p=t.meta.source);var d=e+"BizAppointments/listAppointments?businessSiteId="+n+"&businessClientId="+r+"&pageNo="+s+"&timeframe="+a+"&month="+o+"&year="+u+"&source="+p;axios.post(d,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funGetServiceProvidersCalendar=function(e,t,i){var n=t.meta.bizSiteId;if(isNull(n))return i(new HttpErrors.BadRequest("bizSiteId is mandatory.",{expose:!1}));var r=t.meta.bizServiceProviderId;if(isNull(r))return i(new HttpErrors.BadRequest("bizServiceProviderId is mandatory.",{expose:!1}));var s=e+"BizAppointments/getServiceProviderCalender?businessSiteId="+n+"&businessServiceProviderId="+r;axios.post(s,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funGetAppointmentsCalendar=function(e,t,i){var n=t.meta.bizSiteId;if(isNull(n))return i(new HttpErrors.BadRequest("bizSiteId is mandatory.",{expose:!1}));var r=e+"BizAppointments/getAppointmentsCalender?businessSiteId="+n;axios.post(r,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))},funGetAppointmentProfile=function(e,t,i){var n=t.meta.appointmentId;if(isNull(n))return i(new HttpErrors.BadRequest("appointmentId is mandatory.",{expose:!1}));var r=e+"BizAppointments/getAppointmentDetails?appointmentId="+n;axios.post(r,t).then((function(e){return i(e)})).catch((function(e){var t=stringify(e);return i(t)}))};module.exports=appointmentServices;
//# sourceMappingURL=/sm/c58b17cabf32cb96e8376859fe93f5cfd5ed29fe07ae59138341ba550491db4b.map