mozrest-sdk-react-dev 0.2.83 → 0.2.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/mozrest-sdk.es.js CHANGED
@@ -6475,6 +6475,7 @@ const SHIFTS = "Shifts";
6475
6475
  const SHIFTS_DESC = "Specify your business timings. This information is critical to increase reservations.";
6476
6476
  const SPECIAL_DATES = "Special dates";
6477
6477
  const SPECIAL_DATES_DESC = "Special closing dates or different shifts (special day, events, etc...)";
6478
+ const SPECIAL_DATES_DESC2 = "Define the period for closures or adjusted hours. Both dates are included.";
6478
6479
  const SPECIAL_SHIFTS = "Special shifts";
6479
6480
  const ADD_SPECIAL_DATE = "Add special date";
6480
6481
  const DELETE_SPECIAL_DATE = "Delete special date";
@@ -6490,6 +6491,8 @@ const NEW_EMAIL = "New email";
6490
6491
  const RESERVATIONS_DESC = "Get instant email notifications when any of the following actions happen.";
6491
6492
  const REVIEWS_DESC = "Get an instant email when you receive a negative review so that you can initiate an immediate response to your customer.";
6492
6493
  const REVIEWSREPORT_DESC = "Get a daily report by email to help you keep track of all your activity.";
6494
+ const StartDate = "Start date";
6495
+ const EndDate = "End date";
6493
6496
  var en = {
6494
6497
  errors,
6495
6498
  SPECIALCLOSINGDATES,
@@ -6852,6 +6855,7 @@ var en = {
6852
6855
  SHIFTS_DESC,
6853
6856
  SPECIAL_DATES,
6854
6857
  SPECIAL_DATES_DESC,
6858
+ SPECIAL_DATES_DESC2,
6855
6859
  SPECIAL_SHIFTS,
6856
6860
  ADD_SPECIAL_DATE,
6857
6861
  DELETE_SPECIAL_DATE,
@@ -6867,7 +6871,9 @@ var en = {
6867
6871
  NEW_EMAIL,
6868
6872
  RESERVATIONS_DESC,
6869
6873
  REVIEWS_DESC,
6870
- REVIEWSREPORT_DESC
6874
+ REVIEWSREPORT_DESC,
6875
+ StartDate,
6876
+ EndDate
6871
6877
  };
6872
6878
  instance.use(initReactI18next).init({
6873
6879
  resources: {
@@ -39583,10 +39589,12 @@ const Card = ({
39583
39589
  header: header2,
39584
39590
  children,
39585
39591
  className,
39586
- classNameContent
39592
+ classNameContent,
39593
+ style: style2
39587
39594
  }) => {
39588
39595
  return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("div", {
39589
- className: classNames$2(styles$1Y.container, className, "mz-card")
39596
+ className: classNames$2(styles$1Y.container, className, "mz-card"),
39597
+ style: style2
39590
39598
  }, /* @__PURE__ */ React__default.createElement(Header$5, {
39591
39599
  header: header2
39592
39600
  }), /* @__PURE__ */ React__default.createElement("div", {
@@ -96304,7 +96312,6 @@ const Venues = () => {
96304
96312
  const [page, updatePage] = useState(1);
96305
96313
  const [search2, setSearch] = useState("");
96306
96314
  const navigate = useNavigate();
96307
- console.log("enter here");
96308
96315
  const { data: data2, isLoading, error: error3, isValidating, reload } = useFetch(
96309
96316
  GetVenuesSummary,
96310
96317
  {
@@ -103093,56 +103100,61 @@ const ReservationsAnalytics = ({ userEmail, userFullName }) => {
103093
103100
  totalDays
103094
103101
  }));
103095
103102
  };
103096
- const mainConatiner$2 = "_mainConatiner_1px60_48";
103097
- const mainTableContainer = "_mainTableContainer_1px60_58";
103098
- const mainSidebarContainer = "_mainSidebarContainer_1px60_66";
103099
- const sidebarCloseIcon = "_sidebarCloseIcon_1px60_76";
103100
- const headerContainer = "_headerContainer_1px60_128";
103101
- const searchContainer = "_searchContainer_1px60_134";
103102
- const buttonList = "_buttonList_1px60_142";
103103
- const buttonItem = "_buttonItem_1px60_147";
103104
- const tableTopHeader = "_tableTopHeader_1px60_157";
103105
- const tableTopHeaderContent = "_tableTopHeaderContent_1px60_171";
103106
- const tableTopHeaderContentText = "_tableTopHeaderContentText_1px60_178";
103107
- const tableRowContainer = "_tableRowContainer_1px60_187";
103108
- const tableRowCard = "_tableRowCard_1px60_193";
103109
- const noData = "_noData_1px60_198";
103110
- const tableRowHour = "_tableRowHour_1px60_205";
103111
- const tableRowHourText = "_tableRowHourText_1px60_221";
103112
- const hours = "_hours_1px60_229";
103113
- const tableRowContent = "_tableRowContent_1px60_235";
103114
- const rowImage = "_rowImage_1px60_250";
103115
- const rowContactContainer = "_rowContactContainer_1px60_264";
103116
- const rowContactText = "_rowContactText_1px60_276";
103117
- const rowContactPhone = "_rowContactPhone_1px60_282";
103118
- const rowSectionContainer = "_rowSectionContainer_1px60_289";
103119
- const rowSectionText = "_rowSectionText_1px60_295";
103120
- const rowSectionSecText = "_rowSectionSecText_1px60_301";
103121
- const rowActionButton = "_rowActionButton_1px60_308";
103122
- const bookingInfoContainer = "_bookingInfoContainer_1px60_314";
103123
- const bookingInfoCardRow = "_bookingInfoCardRow_1px60_318";
103124
- const bookingInfoCardContainer = "_bookingInfoCardContainer_1px60_326";
103125
- const bookingInfoCard = "_bookingInfoCard_1px60_318";
103126
- const bookingInfoCardContent = "_bookingInfoCardContent_1px60_338";
103127
- const bookingInfoCardTitle = "_bookingInfoCardTitle_1px60_344";
103128
- const bookingInfoCardText = "_bookingInfoCardText_1px60_347";
103103
+ const mainConatiner$2 = "_mainConatiner_8120h_48";
103104
+ const mainTableContainer = "_mainTableContainer_8120h_58";
103105
+ const mainSidebarContainer = "_mainSidebarContainer_8120h_66";
103106
+ const sidebarCloseIcon = "_sidebarCloseIcon_8120h_87";
103107
+ const headerContainer = "_headerContainer_8120h_95";
103108
+ const searchContainer = "_searchContainer_8120h_101";
103109
+ const buttonList = "_buttonList_8120h_109";
103110
+ const buttonItem = "_buttonItem_8120h_114";
103111
+ const addReservationButton = "_addReservationButton_8120h_123";
103112
+ const tableTopHeader = "_tableTopHeader_8120h_132";
103113
+ const tableTopHeaderContent = "_tableTopHeaderContent_8120h_146";
103114
+ const tableTopHeaderContentText = "_tableTopHeaderContentText_8120h_153";
103115
+ const tableRowContainer = "_tableRowContainer_8120h_162";
103116
+ const tableRowCard = "_tableRowCard_8120h_168";
103117
+ const fadeInX = "_fadeInX_8120h_1";
103118
+ const noData = "_noData_8120h_176";
103119
+ const tableRowHour = "_tableRowHour_8120h_183";
103120
+ const tableRowHourText = "_tableRowHourText_8120h_199";
103121
+ const hours = "_hours_8120h_207";
103122
+ const tableRowContent = "_tableRowContent_8120h_213";
103123
+ const rowImage = "_rowImage_8120h_228";
103124
+ const rowContactContainer = "_rowContactContainer_8120h_242";
103125
+ const rowContactText = "_rowContactText_8120h_254";
103126
+ const rowContactPhone = "_rowContactPhone_8120h_260";
103127
+ const rowSectionContainer = "_rowSectionContainer_8120h_267";
103128
+ const rowSection = "_rowSection_8120h_267";
103129
+ const rowSectionText = "_rowSectionText_8120h_280";
103130
+ const rowSectionSecText = "_rowSectionSecText_8120h_286";
103131
+ const rowActionButton = "_rowActionButton_8120h_293";
103132
+ const bookingInfoContainer = "_bookingInfoContainer_8120h_305";
103133
+ const bookingInfoCardRow = "_bookingInfoCardRow_8120h_309";
103134
+ const bookingInfoCardContainer = "_bookingInfoCardContainer_8120h_317";
103135
+ const bookingInfoCard = "_bookingInfoCard_8120h_309";
103136
+ const bookingInfoCardContent = "_bookingInfoCardContent_8120h_329";
103137
+ const bookingInfoCardTitle = "_bookingInfoCardTitle_8120h_335";
103138
+ const bookingInfoCardText = "_bookingInfoCardText_8120h_338";
103129
103139
  var styles$l = {
103130
103140
  mainConatiner: mainConatiner$2,
103131
103141
  mainTableContainer,
103132
103142
  mainSidebarContainer,
103143
+ "mainSidebarContainer--open": "_mainSidebarContainer--open_8120h_76",
103144
+ "mainSidebarContainer--close": "_mainSidebarContainer--close_8120h_82",
103133
103145
  sidebarCloseIcon,
103134
- "mainSidebarContainer--open": "_mainSidebarContainer--open_1px60_84",
103135
- "mainSidebarContainer--close": "_mainSidebarContainer--close_1px60_90",
103136
- "sidebarCloseIcon--show": "_sidebarCloseIcon--show_1px60_98",
103146
+ "sidebarCloseIcon--show": "_sidebarCloseIcon--show_8120h_90",
103137
103147
  headerContainer,
103138
103148
  searchContainer,
103139
103149
  buttonList,
103140
103150
  buttonItem,
103151
+ addReservationButton,
103141
103152
  tableTopHeader,
103142
103153
  tableTopHeaderContent,
103143
103154
  tableTopHeaderContentText,
103144
103155
  tableRowContainer,
103145
103156
  tableRowCard,
103157
+ fadeInX,
103146
103158
  noData,
103147
103159
  tableRowHour,
103148
103160
  tableRowHourText,
@@ -103153,6 +103165,7 @@ var styles$l = {
103153
103165
  rowContactText,
103154
103166
  rowContactPhone,
103155
103167
  rowSectionContainer,
103168
+ rowSection,
103156
103169
  rowSectionText,
103157
103170
  rowSectionSecText,
103158
103171
  rowActionButton,
@@ -104679,14 +104692,14 @@ var icons = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty(
104679
104692
  people,
104680
104693
  clock
104681
104694
  }, Symbol.toStringTag, { value: "Module" }));
104682
- const icon$2 = "_icon_1qq6z_1";
104695
+ const icon$2 = "_icon_lm3br_1";
104683
104696
  var styles$k = {
104684
104697
  icon: icon$2,
104685
- "icon--xs": "_icon--xs_1qq6z_12",
104686
- "icon--small": "_icon--small_1qq6z_15",
104687
- "icon--medium": "_icon--medium_1qq6z_18",
104688
- "icon--large": "_icon--large_1qq6z_21",
104689
- "icon--xl": "_icon--xl_1qq6z_24"
104698
+ "icon--xs": "_icon--xs_lm3br_12",
104699
+ "icon--small": "_icon--small_lm3br_15",
104700
+ "icon--medium": "_icon--medium_lm3br_18",
104701
+ "icon--large": "_icon--large_lm3br_21",
104702
+ "icon--xl": "_icon--xl_lm3br_24"
104690
104703
  };
104691
104704
  const Icon = ({
104692
104705
  size = "medium",
@@ -106853,9 +106866,17 @@ const useSelectedBookingContext = () => {
106853
106866
  return useContext(SelectedBookingContext);
106854
106867
  };
106855
106868
  const SelectedBookingProvider = ({ children }) => {
106869
+ var _a2;
106856
106870
  const [selectedBooking, setSelectedBooking] = useState(null);
106871
+ const [canEdit, setCanEdit] = useState(false);
106872
+ const roles = (_a2 = userData == null ? void 0 : userData.roles) != null ? _a2 : [];
106873
+ useEffect(() => {
106874
+ if (!roles.includes("COMPANY_USER")) {
106875
+ setCanEdit(true);
106876
+ }
106877
+ }, [roles]);
106857
106878
  return /* @__PURE__ */ React__default.createElement(SelectedBookingContext.Provider, {
106858
- value: { selectedBooking, setSelectedBooking }
106879
+ value: { selectedBooking, setSelectedBooking, canEdit }
106859
106880
  }, children);
106860
106881
  };
106861
106882
  const debounce = (func, delay) => {
@@ -106875,10 +106896,137 @@ const ShowSidebarProvider = ({ children }) => {
106875
106896
  value: { showSidebar, setShowSidebar }
106876
106897
  }, children);
106877
106898
  };
106878
- const index$c = ({ filters: filters2, setFilters }) => {
106899
+ var styles$d = /* @__PURE__ */ (() => ".resbook-modal .ant-modal-centered .ant-modal{border:0;border-radius:6px;background-color:#2f3349}.resbook-modal .ant-modal-content{background-color:transparent;border-radius:6px}.resbook-modal .ant-modal-header,.resbook-modal .ant-modal-body{background-color:#2f3349!important;color:#fff}.resbook-modal .ant-modal-header{border-bottom:0;border-radius:6px 6px 0 0;padding-bottom:0}.resbook-modal .ant-modal-body{border-radius:0 0 6px 6px;padding-top:0}.resbook-modal .ant-modal-header h1,.resbook-modal .ant-modal-header p,.resbook-modal .ant-modal-body h1,.resbook-modal .ant-modal-body h2,.resbook-modal .ant-modal-body h3,.resbook-modal .ant-modal-body h4,.resbook-modal .ant-modal-body p{font-family:Public Sans,sans-serif}.resbook-modal .ant-modal-header p,.resbook-modal .ant-modal-body p{font-size:15px;color:#acabc1}.resbook-modal .ant-modal-header p{margin-bottom:0;margin-top:0}.resbook-modal .ant-modal-header h1,.resbook-modal .ant-modal-body h1{font-weight:600;color:#cfcde4;font-size:18px}.resbook-modal .ant-modal-body label{font-size:15px;color:#acabc1}.resbook-modal .ant-modal-body h2{color:#fff}.resbook-modal .ant-modal-body [class*=regularHourContainer]{color:#d0cee5;box-shadow:none;font-family:var(--font-family)}.resbook-modal .ant-modal-body [class*=regularHourContainer] strong{font-weight:300;font-size:15px}.resbook-modal .mz-header input,.resbook-modal .ant-modal-body input,.resbook-modal .ant-modal-body textarea{background-color:#3a3d54;color:#d0cee5;border-width:0 0 1px;border-color:#d0cee5;border-radius:0;padding:10px 5px}.resbook-modal .mz-header .css-spersy-control,.resbook-modal .ant-modal-body .css-spersy-control{background-color:#3a3d54;border-width:0 0 1px;border-radius:0}.resbook-modal .css-spersy-control>div>div:first-child{color:#d0cee5!important;font-family:Public Sans,sans-serif;padding:7px 0}.resbook-modal .ant-modal-body #react-select-4-listbox{background-color:#3a3d54;font-family:var(--font-family)}.resbook-modal .ant-modal-title,.resbook-modal .ant-modal-body span{color:#fff}.resbook-modal .ant-modal-close-x line{stroke:#fff}\n")();
106900
+ const Modal2 = ({
106901
+ open,
106902
+ children,
106903
+ onClose: onClose2,
106904
+ title: title2,
106905
+ width
106906
+ }) => {
106907
+ return /* @__PURE__ */ React__default.createElement(ModalAntd, {
106908
+ className: "resbook-modal",
106909
+ title: /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, typeof title2 === "string" && /* @__PURE__ */ React__default.createElement(Heading, null, title2), typeof title2 !== "string" && !!title2 ? title2 : /* @__PURE__ */ React__default.createElement("div", null)),
106910
+ open,
106911
+ onCancel: onClose2,
106912
+ width: width || 1e3,
106913
+ footer: null,
106914
+ closeIcon: /* @__PURE__ */ React__default.createElement(Icon, {
106915
+ icon: "close",
106916
+ size: "small"
106917
+ }),
106918
+ centered: true,
106919
+ zIndex: 1032
106920
+ }, children);
106921
+ };
106922
+ const ConfirmationModal = ({ onAccept, isLoading, title: title2, text: text2 = "AREYOUSURE?", icon: icon2, ...props }) => {
106923
+ const { t: t2 } = useTranslation();
106924
+ return /* @__PURE__ */ React__default.createElement(Modal2, {
106925
+ ...props,
106926
+ title: title2,
106927
+ width: 500
106928
+ }, icon2 && /* @__PURE__ */ React__default.createElement("div", {
106929
+ style: { display: "flex", justifyContent: "center" }
106930
+ }, /* @__PURE__ */ React__default.createElement(Icon, {
106931
+ icon: icon2,
106932
+ size: "large"
106933
+ })), /* @__PURE__ */ React__default.createElement("h3", {
106934
+ style: { marginTop: 0, paddingTop: 20 }
106935
+ }, t2(text2)), /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", {
106936
+ style: { display: "flex", justifyContent: "center", gap: 20, marginTop: 20 }
106937
+ }, /* @__PURE__ */ React__default.createElement(Button, {
106938
+ size: "small",
106939
+ mode: "tertiary",
106940
+ onClick: props.onClose,
106941
+ disabled: isLoading
106942
+ }, t2("CANCEL")), /* @__PURE__ */ React__default.createElement(Button, {
106943
+ size: "small",
106944
+ type: "submit",
106945
+ onClick: () => onAccept(),
106946
+ isLoading
106947
+ }, t2("ACCEPT")))));
106948
+ };
106949
+ const ExportBookingModal = ({ open, onClose: onClose2, isExportLoading, setIsExportLoading, userEmail, userFullName, currentVenue }) => {
106950
+ const { t: t2 } = useTranslation();
106951
+ const [exportFilters, setExportFilters] = useState({
106952
+ ["filters[from]"]: hooks().format("YYYY-MM-DD"),
106953
+ ["filters[till]"]: hooks().format("YYYY-MM-DD")
106954
+ });
106955
+ const [openConfirmationModal, setOpenConfirmationModal] = useState(false);
106956
+ const onOpenConfirmationModal = () => setOpenConfirmationModal(true);
106957
+ const onCloseConfirmationModal = () => setOpenConfirmationModal(false);
106958
+ const { isExecuting, execute, error: error3 } = useService(ExportReservationAnalytics, {
106959
+ onSuccess: async () => {
106960
+ onClose2();
106961
+ setIsExportLoading(false);
106962
+ },
106963
+ onError: async () => {
106964
+ setIsExportLoading(false);
106965
+ },
106966
+ successText: "Successfully requested"
106967
+ });
106968
+ const onRequestExcel = () => {
106969
+ setIsExportLoading(true);
106970
+ onCloseConfirmationModal();
106971
+ if (!currentVenue)
106972
+ return;
106973
+ execute({
106974
+ params: {
106975
+ "filters[venues]": [currentVenue],
106976
+ ...exportFilters,
106977
+ ...userEmail ? {
106978
+ ["filters[userEmail]"]: userEmail
106979
+ } : {},
106980
+ ...userFullName ? {
106981
+ ["filters[userFullName]"]: userFullName
106982
+ } : {}
106983
+ }
106984
+ });
106985
+ };
106986
+ return /* @__PURE__ */ React__default.createElement(Modal2, {
106987
+ open,
106988
+ onClose: onClose2,
106989
+ width: 500,
106990
+ title: /* @__PURE__ */ React__default.createElement(Heading, null, /* @__PURE__ */ React__default.createElement(Icon$2, {
106991
+ icon: "clipBoardList"
106992
+ }), t2("EXPORTDATA"))
106993
+ }, /* @__PURE__ */ React__default.createElement("div", {
106994
+ className: ""
106995
+ }, /* @__PURE__ */ React__default.createElement(DatePicker, {
106996
+ id: "dateRange",
106997
+ label: t2("BOOKINGCREATIONDATERANGE"),
106998
+ range: { from: exportFilters["filters[from]"], till: exportFilters["filters[till]"] },
106999
+ onChange: ({ from: from2, till }) => {
107000
+ if (from2 && till) {
107001
+ setExportFilters({
107002
+ ...exportFilters,
107003
+ ["filters[from]"]: hooks(from2).format("YYYY-MM-DD"),
107004
+ ["filters[till]"]: hooks(till).format("YYYY-MM-DD")
107005
+ });
107006
+ }
107007
+ }
107008
+ }), /* @__PURE__ */ React__default.createElement("div", {
107009
+ style: { display: "flex", flexDirection: "column", gap: 20 }
107010
+ }, /* @__PURE__ */ React__default.createElement("div", null, "Choose the Booking creation date range to export. The rest of the filters selected on the page will apply as export criteria."), /* @__PURE__ */ React__default.createElement("div", null, "You will receive shortly the report on you email inbox after clicking the 'Export data' button.")), /* @__PURE__ */ React__default.createElement("div", {
107011
+ style: { display: "flex", justifyContent: "center" }
107012
+ }, /* @__PURE__ */ React__default.createElement(Button$4, {
107013
+ isLoading: isExportLoading,
107014
+ onClick: () => onOpenConfirmationModal()
107015
+ }, t2("EXPORTDATA")))), /* @__PURE__ */ React__default.createElement(ConfirmationModal, {
107016
+ open: openConfirmationModal,
107017
+ onClose: onCloseConfirmationModal,
107018
+ onAccept: () => onRequestExcel(),
107019
+ text: `Do you want to export an excel file from ${exportFilters["filters[from]"]} until ${exportFilters["filters[till]"]}? You will receive shortly the report on you email inbox.`,
107020
+ width: 500,
107021
+ isLoading: isExportLoading || isExecuting,
107022
+ icon: "calendar"
107023
+ }));
107024
+ };
107025
+ const index$c = ({ filters: filters2, setFilters, currentVenue, userEmail, userFullName }) => {
106879
107026
  const { t: t2 } = useTranslation();
106880
107027
  const { showSidebar, setShowSidebar } = useShowSidebarContext();
106881
- const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
107028
+ const { selectedBooking, setSelectedBooking, canEdit } = useSelectedBookingContext();
107029
+ const [showExportBookingConfirmationModal, setShowExportBookingConfirmationModal] = useState(false);
106882
107030
  const [datePickerOpen, setDatePickerOpen] = useState(false);
106883
107031
  const datePickerRef = useRef(null);
106884
107032
  const defaultValue2 = {
@@ -106998,7 +107146,7 @@ const index$c = ({ filters: filters2, setFilters }) => {
106998
107146
  className: styles$l.buttonItem,
106999
107147
  onClick: () => selectDate("tomorrow")
107000
107148
  }, t2("TOMORROW")), /* @__PURE__ */ React__default.createElement("div", {
107001
- style: { display: "flex", flexDirection: "column", justifyContent: "center" }
107149
+ style: { display: "flex", gap: 5, justifyContent: "center", alignItems: "center" }
107002
107150
  }, /* @__PURE__ */ React__default.createElement(Button, {
107003
107151
  mode: "primary",
107004
107152
  onClick: () => setDatePickerOpen(true)
@@ -107036,17 +107184,33 @@ const index$c = ({ filters: filters2, setFilters }) => {
107036
107184
  setDatePickerOpen(false);
107037
107185
  }
107038
107186
  }, t2("TOMORROW")))
107039
- })), /* @__PURE__ */ React__default.createElement(Button, {
107187
+ })), canEdit && /* @__PURE__ */ React__default.createElement(Button, {
107188
+ className: styles$l.addReservationButton,
107040
107189
  mode: "success",
107041
107190
  onClick: () => {
107042
107191
  setSelectedBooking(null);
107043
107192
  setShowSidebar(true);
107044
107193
  }
107045
- }, t2("ADDRESERVATION"))));
107194
+ }, t2("ADDRESERVATION"))), /* @__PURE__ */ React__default.createElement(ExportBookingModal, {
107195
+ isExportLoading: false,
107196
+ setIsExportLoading: () => {
107197
+ },
107198
+ open: showExportBookingConfirmationModal,
107199
+ currentVenue,
107200
+ userEmail,
107201
+ userFullName,
107202
+ onClose: () => {
107203
+ setShowExportBookingConfirmationModal(false);
107204
+ }
107205
+ }));
107046
107206
  };
107047
107207
  const injectStyles = () => {
107048
107208
  const styleElement = document.createElement("style");
107049
107209
  styleElement.innerHTML = `
107210
+ .ant-picker-range {
107211
+ background-color: #3A3D54 !important;
107212
+ }
107213
+
107050
107214
  .ant-picker-panel {
107051
107215
  background-color: #2F3349 !important;
107052
107216
  border-radius: 6px !important;
@@ -107185,12 +107349,12 @@ const ReloadProvider = ({ children, reload }) => {
107185
107349
  value: { reload }
107186
107350
  }, children);
107187
107351
  };
107188
- const TableRow = ({ item: item2, filtersData, venueId }) => {
107352
+ const TableRow = ({ index: index2, item: item2, filtersData, venueId }) => {
107189
107353
  var _a2, _b, _c, _d;
107190
107354
  const { t: t2 } = useTranslation();
107191
107355
  const { reload: reloadMainTable } = useReloadContext();
107192
107356
  const { showSidebar, setShowSidebar } = useShowSidebarContext();
107193
- const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
107357
+ const { selectedBooking, setSelectedBooking, canEdit } = useSelectedBookingContext();
107194
107358
  const { execute } = useService(UpdateBookingStatusBooking, {
107195
107359
  onSuccess: async () => {
107196
107360
  reloadMainTable();
@@ -107253,12 +107417,17 @@ const TableRow = ({ item: item2, filtersData, venueId }) => {
107253
107417
  }
107254
107418
  };
107255
107419
  return /* @__PURE__ */ React__default.createElement(Card, {
107256
- className: styles$l.tableRowCard
107420
+ className: styles$l.tableRowCard,
107421
+ style: {
107422
+ animationDelay: `${index2 * 0.2}s`
107423
+ }
107257
107424
  }, /* @__PURE__ */ React__default.createElement("div", {
107258
- style: { display: "flex", cursor: "pointer" },
107425
+ style: { display: "flex", cursor: window.innerWidth > 768 ? "pointer" : "default" },
107259
107426
  onClick: () => {
107260
- setSelectedBooking(item2);
107261
- setShowSidebar(true);
107427
+ if (window.innerWidth > 768) {
107428
+ setSelectedBooking(item2);
107429
+ setShowSidebar(true);
107430
+ }
107262
107431
  }
107263
107432
  }, /* @__PURE__ */ React__default.createElement("div", {
107264
107433
  className: styles$l.tableRowHour
@@ -107280,17 +107449,19 @@ const TableRow = ({ item: item2, filtersData, venueId }) => {
107280
107449
  className: styles$l.rowContactPhone
107281
107450
  }, (_a2 = item2 == null ? void 0 : item2.contact) == null ? void 0 : _a2.telephone)), /* @__PURE__ */ React__default.createElement("div", {
107282
107451
  className: styles$l.rowSectionContainer
107452
+ }, /* @__PURE__ */ React__default.createElement("div", {
107453
+ className: styles$l.rowSection
107283
107454
  }, /* @__PURE__ */ React__default.createElement("h4", {
107284
107455
  className: styles$l.rowSectionText
107285
107456
  }, item2 == null ? void 0 : item2.partySize), /* @__PURE__ */ React__default.createElement("p", {
107286
107457
  className: styles$l.rowSectionSecText
107287
107458
  }, t2("GUESTS"))), /* @__PURE__ */ React__default.createElement("div", {
107288
- className: styles$l.rowSectionContainer
107459
+ className: styles$l.rowSection
107289
107460
  }, /* @__PURE__ */ React__default.createElement("h4", {
107290
107461
  className: styles$l.rowSectionText
107291
107462
  }, (_b = item2 == null ? void 0 : item2.table) == null ? void 0 : _b.name), /* @__PURE__ */ React__default.createElement("p", {
107292
107463
  className: styles$l.rowSectionSecText
107293
- }, (_c = item2 == null ? void 0 : item2.table) == null ? void 0 : _c.areaName)), /* @__PURE__ */ React__default.createElement("div", {
107464
+ }, (_c = item2 == null ? void 0 : item2.table) == null ? void 0 : _c.areaName))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
107294
107465
  className: styles$l.rowActionButton
107295
107466
  }, /* @__PURE__ */ React__default.createElement(Button, {
107296
107467
  icon: statusBuilder(item2.status).icon,
@@ -107343,8 +107514,9 @@ const TableBody = ({ data: data2, filtersData, venueId }) => {
107343
107514
  className: styles$l.tableTopHeaderContentText
107344
107515
  }, group.length, " ", t2("RESERVATIONS"))), /* @__PURE__ */ React__default.createElement("div", {
107345
107516
  className: styles$l.tableRowContainer
107346
- }, group.map((item2) => {
107517
+ }, group.map((item2, index2) => {
107347
107518
  return /* @__PURE__ */ React__default.createElement(TableRow, {
107519
+ index: index2,
107348
107520
  key: item2.id,
107349
107521
  item: item2,
107350
107522
  filtersData,
@@ -107367,7 +107539,7 @@ const index$b = ({ data: data2, filters: filters2, filtersData, venueId }) => {
107367
107539
  };
107368
107540
  const container = "_container_ut3y7_1";
107369
107541
  const tooltip = "_tooltip_ut3y7_5";
107370
- var styles$d = {
107542
+ var styles$c = {
107371
107543
  container,
107372
107544
  tooltip
107373
107545
  };
@@ -107426,7 +107598,7 @@ const Select = ({
107426
107598
  ...props
107427
107599
  }) => {
107428
107600
  return /* @__PURE__ */ React__default.createElement("div", {
107429
- className: styles$d.container
107601
+ className: styles$c.container
107430
107602
  }, label2 && /* @__PURE__ */ React__default.createElement(Label, {
107431
107603
  htmlFor: id2
107432
107604
  }, label2), /* @__PURE__ */ React__default.createElement("div", {
@@ -107457,7 +107629,7 @@ const SelectField = ({ control, name, ...props }) => {
107457
107629
  });
107458
107630
  };
107459
107631
  const input$1 = "_input_zx6p9_1";
107460
- var styles$c = {
107632
+ var styles$b = {
107461
107633
  input: input$1
107462
107634
  };
107463
107635
  const TextArea = React__default.forwardRef(
@@ -107490,7 +107662,7 @@ const TextArea = React__default.forwardRef(
107490
107662
  }, label2), /* @__PURE__ */ React__default.createElement("div", {
107491
107663
  style: { position: "relative" }
107492
107664
  }, /* @__PURE__ */ React__default.createElement("textarea", {
107493
- className: styles$c.input,
107665
+ className: styles$b.input,
107494
107666
  onChange: handleChange,
107495
107667
  id: id2,
107496
107668
  name: id2,
@@ -107521,51 +107693,6 @@ const TextAreaField = ({ control, name, ...props }) => {
107521
107693
  }))
107522
107694
  });
107523
107695
  };
107524
- var styles$b = /* @__PURE__ */ (() => ".resbook-modal .ant-modal-centered .ant-modal{border:0;border-radius:6px;background-color:#2f3349}.resbook-modal .ant-modal-content{background-color:transparent;border-radius:6px}.resbook-modal .ant-modal-header,.resbook-modal .ant-modal-body{background-color:#2f3349!important;color:#fff}.resbook-modal .ant-modal-header{border-bottom:0;border-radius:6px 6px 0 0;padding-bottom:0}.resbook-modal .ant-modal-body{border-radius:0 0 6px 6px;padding-top:0}.resbook-modal .ant-modal-header h1,.resbook-modal .ant-modal-header p,.resbook-modal .ant-modal-body h1,.resbook-modal .ant-modal-body h2,.resbook-modal .ant-modal-body h3,.resbook-modal .ant-modal-body h4,.resbook-modal .ant-modal-body p{font-family:Public Sans,sans-serif}.resbook-modal .ant-modal-header p,.resbook-modal .ant-modal-body p{font-size:15px;color:#acabc1}.resbook-modal .ant-modal-header p{margin-bottom:0;margin-top:0}.resbook-modal .ant-modal-header h1,.resbook-modal .ant-modal-body h1{font-weight:600;color:#cfcde4;font-size:18px}.resbook-modal .ant-modal-body label{font-size:15px;color:#acabc1}.resbook-modal .ant-modal-body h2{color:#fff}.resbook-modal .ant-modal-body [class*=regularHourContainer]{color:#d0cee5;box-shadow:none;font-family:var(--font-family)}.resbook-modal .ant-modal-body [class*=regularHourContainer] strong{font-weight:300;font-size:15px}.resbook-modal .mz-header input,.resbook-modal .ant-modal-body input,.resbook-modal .ant-modal-body textarea{background-color:#3a3d54;color:#d0cee5;border-width:0 0 1px;border-color:#d0cee5;border-radius:0;padding:10px 5px}.resbook-modal .mz-header .css-spersy-control,.resbook-modal .ant-modal-body .css-spersy-control{background-color:#3a3d54;border-width:0 0 1px;border-radius:0}.resbook-modal .css-spersy-control>div>div:first-child{color:#d0cee5!important;font-family:Public Sans,sans-serif;padding:7px 0}.resbook-modal .ant-modal-body #react-select-4-listbox{background-color:#3a3d54;font-family:var(--font-family)}.resbook-modal .ant-modal-title,.resbook-modal .ant-modal-body span{color:#fff}.resbook-modal .ant-modal-close-x line{stroke:#fff}\n")();
107525
- const Modal2 = ({
107526
- open,
107527
- children,
107528
- onClose: onClose2,
107529
- title: title2,
107530
- width
107531
- }) => {
107532
- return /* @__PURE__ */ React__default.createElement(ModalAntd, {
107533
- className: "resbook-modal",
107534
- title: /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, typeof title2 === "string" && /* @__PURE__ */ React__default.createElement(Heading, null, title2), typeof title2 !== "string" && !!title2 ? title2 : /* @__PURE__ */ React__default.createElement("div", null)),
107535
- open,
107536
- onCancel: onClose2,
107537
- width: width || 1e3,
107538
- footer: null,
107539
- closeIcon: /* @__PURE__ */ React__default.createElement(Icon, {
107540
- icon: "close",
107541
- size: "small"
107542
- }),
107543
- centered: true,
107544
- zIndex: 1032
107545
- }, children);
107546
- };
107547
- const ConfirmationModal = ({ onAccept, isLoading, title: title2, text: text2 = "AREYOUSURE?", ...props }) => {
107548
- const { t: t2 } = useTranslation();
107549
- return /* @__PURE__ */ React__default.createElement(Modal2, {
107550
- ...props,
107551
- title: title2,
107552
- width: 500
107553
- }, /* @__PURE__ */ React__default.createElement("h3", {
107554
- style: { marginTop: 0, paddingTop: 20 }
107555
- }, t2(text2)), /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement("div", {
107556
- style: { display: "flex", justifyContent: "center", gap: 20, marginTop: 20 }
107557
- }, /* @__PURE__ */ React__default.createElement(Button, {
107558
- size: "small",
107559
- mode: "tertiary",
107560
- onClick: props.onClose,
107561
- disabled: isLoading
107562
- }, t2("CANCEL")), /* @__PURE__ */ React__default.createElement(Button, {
107563
- size: "small",
107564
- type: "submit",
107565
- onClick: () => onAccept(),
107566
- isLoading
107567
- }, t2("ACCEPT")))));
107568
- };
107569
107696
  const ActionButtons = ({ onSubmit, venueId }) => {
107570
107697
  const { t: t2 } = useTranslation();
107571
107698
  const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
@@ -107705,7 +107832,7 @@ const Header = () => {
107705
107832
  const index$a = ({ filtersData, venueId }) => {
107706
107833
  const { t: t2 } = useTranslation();
107707
107834
  const { reload: reloadMainTable } = useReloadContext();
107708
- const { selectedBooking, setSelectedBooking } = useSelectedBookingContext();
107835
+ const { selectedBooking, setSelectedBooking, canEdit } = useSelectedBookingContext();
107709
107836
  const { showMessageError } = useMessage();
107710
107837
  const [currentTimeZone, setCurrentTimeZone] = useState("");
107711
107838
  const [partySizeOptions2, setPartySizeOptions] = useState([]);
@@ -107936,6 +108063,7 @@ const index$a = ({ filtersData, venueId }) => {
107936
108063
  }, /* @__PURE__ */ React__default.createElement(Header, null), !selectedBooking && /* @__PURE__ */ React__default.createElement("div", {
107937
108064
  style: { width: "100%" }
107938
108065
  }, /* @__PURE__ */ React__default.createElement(SelectField, {
108066
+ isDisabled: !canEdit,
107939
108067
  control,
107940
108068
  id: "source",
107941
108069
  name: "source",
@@ -107946,6 +108074,7 @@ const index$a = ({ filtersData, venueId }) => {
107946
108074
  }, /* @__PURE__ */ React__default.createElement("div", {
107947
108075
  style: { width: "50%" }
107948
108076
  }, /* @__PURE__ */ React__default.createElement(TextInputField, {
108077
+ disabled: !canEdit,
107949
108078
  control,
107950
108079
  id: "date",
107951
108080
  name: "date",
@@ -107956,6 +108085,7 @@ const index$a = ({ filtersData, venueId }) => {
107956
108085
  })), /* @__PURE__ */ React__default.createElement("div", {
107957
108086
  style: { width: "50%" }
107958
108087
  }, /* @__PURE__ */ React__default.createElement(SelectField, {
108088
+ isDisabled: !canEdit,
107959
108089
  control,
107960
108090
  isClearable: true,
107961
108091
  id: "time",
@@ -107967,6 +108097,7 @@ const index$a = ({ filtersData, venueId }) => {
107967
108097
  }, /* @__PURE__ */ React__default.createElement("div", {
107968
108098
  style: { width: "50%" }
107969
108099
  }, /* @__PURE__ */ React__default.createElement(SelectField, {
108100
+ isDisabled: !canEdit,
107970
108101
  control,
107971
108102
  isClearable: true,
107972
108103
  id: "partySize",
@@ -107976,6 +108107,7 @@ const index$a = ({ filtersData, venueId }) => {
107976
108107
  })), /* @__PURE__ */ React__default.createElement("div", {
107977
108108
  style: { width: "50%" }
107978
108109
  }, /* @__PURE__ */ React__default.createElement(SelectField, {
108110
+ isDisabled: !canEdit,
107979
108111
  control,
107980
108112
  id: "table",
107981
108113
  name: "table",
@@ -107986,7 +108118,7 @@ const index$a = ({ filtersData, venueId }) => {
107986
108118
  }, /* @__PURE__ */ React__default.createElement("div", {
107987
108119
  style: { width: "50%" }
107988
108120
  }, /* @__PURE__ */ React__default.createElement(TextInputField, {
107989
- disabled: selectedBooking,
108121
+ disabled: selectedBooking || !canEdit,
107990
108122
  control,
107991
108123
  id: "firstName",
107992
108124
  name: "firstName",
@@ -107997,7 +108129,7 @@ const index$a = ({ filtersData, venueId }) => {
107997
108129
  })), /* @__PURE__ */ React__default.createElement("div", {
107998
108130
  style: { width: "50%" }
107999
108131
  }, /* @__PURE__ */ React__default.createElement(TextInputField, {
108000
- disabled: selectedBooking,
108132
+ disabled: selectedBooking || !canEdit,
108001
108133
  control,
108002
108134
  id: "lastName",
108003
108135
  name: "lastName",
@@ -108008,7 +108140,7 @@ const index$a = ({ filtersData, venueId }) => {
108008
108140
  }))), /* @__PURE__ */ React__default.createElement("div", {
108009
108141
  style: { width: "100%" }
108010
108142
  }, /* @__PURE__ */ React__default.createElement(TextInputField, {
108011
- disabled: selectedBooking,
108143
+ disabled: selectedBooking || !canEdit,
108012
108144
  control,
108013
108145
  id: "email",
108014
108146
  name: "email",
@@ -108019,7 +108151,7 @@ const index$a = ({ filtersData, venueId }) => {
108019
108151
  })), /* @__PURE__ */ React__default.createElement("div", {
108020
108152
  style: { width: "100%" }
108021
108153
  }, /* @__PURE__ */ React__default.createElement(TextInputField, {
108022
- disabled: selectedBooking,
108154
+ disabled: selectedBooking || !canEdit,
108023
108155
  control,
108024
108156
  id: "phone",
108025
108157
  name: "phone",
@@ -108030,7 +108162,7 @@ const index$a = ({ filtersData, venueId }) => {
108030
108162
  })), /* @__PURE__ */ React__default.createElement("div", {
108031
108163
  style: { width: "100%" }
108032
108164
  }, /* @__PURE__ */ React__default.createElement(TextAreaField, {
108033
- disabled: selectedBooking,
108165
+ disabled: selectedBooking || !canEdit,
108034
108166
  control,
108035
108167
  id: "notes",
108036
108168
  name: "notes",
@@ -108038,7 +108170,7 @@ const index$a = ({ filtersData, venueId }) => {
108038
108170
  placeholder: "Notes ..."
108039
108171
  })), /* @__PURE__ */ React__default.createElement("hr", {
108040
108172
  style: { width: "100%" }
108041
- }), /* @__PURE__ */ React__default.createElement(ActionButtons, {
108173
+ }), canEdit && /* @__PURE__ */ React__default.createElement(ActionButtons, {
108042
108174
  onSubmit,
108043
108175
  venueId
108044
108176
  }), selectedBooking && /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("hr", {
@@ -108047,7 +108179,7 @@ const index$a = ({ filtersData, venueId }) => {
108047
108179
  item: selectedBooking
108048
108180
  })));
108049
108181
  };
108050
- function MainComponent({ venueId }) {
108182
+ function MainComponent({ venueId, userEmail, userFullName }) {
108051
108183
  const [currentVenue, setCurrentVenue] = useState(null);
108052
108184
  const { showSidebar, setShowSidebar } = useShowSidebarContext();
108053
108185
  const [filters2, setFilters] = useState({
@@ -108109,6 +108241,14 @@ function MainComponent({ venueId }) {
108109
108241
  document.removeEventListener("mousedown", handleOutsideClick);
108110
108242
  };
108111
108243
  }, [showSidebar, setShowSidebar]);
108244
+ useEffect(() => {
108245
+ const interval = setInterval(() => {
108246
+ reload();
108247
+ }, 6e4);
108248
+ return () => {
108249
+ clearInterval(interval);
108250
+ };
108251
+ }, [reload]);
108112
108252
  return /* @__PURE__ */ React__default.createElement(ReloadProvider, {
108113
108253
  reload
108114
108254
  }, /* @__PURE__ */ React__default.createElement("div", {
@@ -108117,7 +108257,10 @@ function MainComponent({ venueId }) {
108117
108257
  className: styles$l.mainTableContainer
108118
108258
  }, /* @__PURE__ */ React__default.createElement(index$c, {
108119
108259
  filters: filters2,
108120
- setFilters
108260
+ setFilters,
108261
+ currentVenue,
108262
+ userEmail,
108263
+ userFullName
108121
108264
  }), /* @__PURE__ */ React__default.createElement(index$b, {
108122
108265
  data: data2,
108123
108266
  filters: filters2,
@@ -108133,30 +108276,33 @@ function MainComponent({ venueId }) {
108133
108276
  venueId
108134
108277
  }))));
108135
108278
  }
108136
- function Main$2({ venueId }) {
108279
+ function Main$2({ venueId, userEmail, userFullName }) {
108137
108280
  return /* @__PURE__ */ React__default.createElement(SelectedBookingProvider, null, /* @__PURE__ */ React__default.createElement(ShowSidebarProvider, null, /* @__PURE__ */ React__default.createElement(MainComponent, {
108138
- venueId
108281
+ venueId,
108282
+ userEmail,
108283
+ userFullName
108139
108284
  })));
108140
108285
  }
108141
- const mainConatiner$1 = "_mainConatiner_au98t_70";
108142
- const header$3 = "_header_au98t_81";
108143
- const content$1 = "_content_au98t_87";
108144
- const textSecondary$1 = "_textSecondary_au98t_96";
108145
- const sectionCard$1 = "_sectionCard_au98t_100";
108146
- const cardHeader$1 = "_cardHeader_au98t_105";
108147
- const cardTitle$1 = "_cardTitle_au98t_108";
108148
- const cardDesc$1 = "_cardDesc_au98t_112";
108149
- const cardBody$1 = "_cardBody_au98t_116";
108150
- const cardFooter$1 = "_cardFooter_au98t_120";
108151
- const cardFooterContent$1 = "_cardFooterContent_au98t_120";
108152
- const sectionManagement$1 = "_sectionManagement_au98t_130";
108153
- const sectionFormRow$1 = "_sectionFormRow_au98t_130";
108154
- const drawerContent$1 = "_drawerContent_au98t_137";
108155
- const scrollableForm$1 = "_scrollableForm_au98t_142";
108156
- const fixedActions$1 = "_fixedActions_au98t_148";
108286
+ const mainConatiner$1 = "_mainConatiner_199nq_70";
108287
+ const header$3 = "_header_199nq_81";
108288
+ const content$1 = "_content_199nq_87";
108289
+ const textSecondary$1 = "_textSecondary_199nq_96";
108290
+ const sectionCard$1 = "_sectionCard_199nq_100";
108291
+ const cardHeader$1 = "_cardHeader_199nq_105";
108292
+ const cardTitle$1 = "_cardTitle_199nq_108";
108293
+ const cardDesc$1 = "_cardDesc_199nq_112";
108294
+ const cardBody$1 = "_cardBody_199nq_116";
108295
+ const cardFooter$1 = "_cardFooter_199nq_120";
108296
+ const cardFooterContent$1 = "_cardFooterContent_199nq_120";
108297
+ const sectionManagement$1 = "_sectionManagement_199nq_130";
108298
+ const sectionFormRow$1 = "_sectionFormRow_199nq_130";
108299
+ const drawerContent$1 = "_drawerContent_199nq_137";
108300
+ const scrollableForm$1 = "_scrollableForm_199nq_142";
108301
+ const fixedActions$1 = "_fixedActions_199nq_148";
108302
+ const specialDatesInfoText = "_specialDatesInfoText_199nq_157";
108157
108303
  var styles$a = {
108158
- "my-masonry-grid": "_my-masonry-grid_au98t_48",
108159
- "my-masonry-grid_column": "_my-masonry-grid_column_au98t_59",
108304
+ "my-masonry-grid": "_my-masonry-grid_199nq_48",
108305
+ "my-masonry-grid_column": "_my-masonry-grid_column_199nq_59",
108160
108306
  mainConatiner: mainConatiner$1,
108161
108307
  header: header$3,
108162
108308
  content: content$1,
@@ -108172,9 +108318,10 @@ var styles$a = {
108172
108318
  sectionFormRow: sectionFormRow$1,
108173
108319
  drawerContent: drawerContent$1,
108174
108320
  scrollableForm: scrollableForm$1,
108175
- fixedActions: fixedActions$1
108321
+ fixedActions: fixedActions$1,
108322
+ specialDatesInfoText
108176
108323
  };
108177
- const AreaManagementCard$1 = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
108324
+ const AreaManagementCard$1 = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
108178
108325
  const { t: t2 } = useTranslation();
108179
108326
  return /* @__PURE__ */ React__default.createElement(Card, {
108180
108327
  className: styles$a.sectionCard
@@ -108198,7 +108345,7 @@ const AreaManagementCard$1 = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) =>
108198
108345
  }, data2.areas.slice(0, 2).map((area, index2) => /* @__PURE__ */ React__default.createElement("p", {
108199
108346
  key: index2,
108200
108347
  style: { fontWeight: "bold" }
108201
- }, area.name)))), /* @__PURE__ */ React__default.createElement("div", {
108348
+ }, area.name)))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
108202
108349
  className: styles$a.cardFooter
108203
108350
  }, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
108204
108351
  className: styles$a.cardFooterContent,
@@ -108251,12 +108398,13 @@ const Drawer = ({ isOpen, onClose: onClose2, children, title: title2, titleDesc,
108251
108398
  className: styles$9.drawer__body
108252
108399
  }, children)));
108253
108400
  };
108254
- const label$1 = "_label_7znea_1";
108255
- const label__switch = "_label__switch_7znea_8";
108256
- const input = "_input_7znea_30";
108401
+ const label$1 = "_label_o8bxt_1";
108402
+ const label__switch = "_label__switch_o8bxt_8";
108403
+ const input = "_input_o8bxt_34";
108257
108404
  var styles$8 = {
108258
108405
  label: label$1,
108259
108406
  label__switch,
108407
+ "label__switch--disabled": "_label__switch--disabled_o8bxt_18",
108260
108408
  input
108261
108409
  };
108262
108410
  const Toggle = ({
@@ -108279,10 +108427,13 @@ const Toggle = ({
108279
108427
  htmlFor: id2,
108280
108428
  className: styles$8.label
108281
108429
  }, /* @__PURE__ */ React__default.createElement("span", {
108282
- className: styles$8.label__switch
108430
+ className: classNames$2(
108431
+ styles$8.label__switch,
108432
+ disabled2 ? styles$8["label__switch--disabled"] : ""
108433
+ )
108283
108434
  }), label2));
108284
108435
  };
108285
- const SwitchField = ({ control, name, onChangeEvent, ...props }) => {
108436
+ const SwitchField = ({ control, name, onChangeEvent, disabled: disabled2, ...props }) => {
108286
108437
  return /* @__PURE__ */ React__default.createElement(Controller, {
108287
108438
  control,
108288
108439
  name,
@@ -108294,6 +108445,7 @@ const SwitchField = ({ control, name, onChangeEvent, ...props }) => {
108294
108445
  name,
108295
108446
  value: value2 || "",
108296
108447
  label: props.label,
108448
+ disabled: disabled2,
108297
108449
  onChange: (e3) => {
108298
108450
  onChange3(e3);
108299
108451
  if (onChangeEvent) {
@@ -108512,14 +108664,15 @@ const fieldChanged$3 = (currentValue, initialData) => {
108512
108664
  }
108513
108665
  return false;
108514
108666
  };
108515
- const index$9 = ({ venueId, reloadAreas, areas }) => {
108667
+ const index$9 = ({ venueId, reloadAreas, areas, canEdit }) => {
108516
108668
  const [isOpenDrawer, setIsOpenDrawer] = useState(false);
108517
108669
  return /* @__PURE__ */ React__default.createElement("div", {
108518
108670
  className: styles$a.sectionManagement
108519
108671
  }, /* @__PURE__ */ React__default.createElement(AreaManagementCard$1, {
108520
108672
  isOpenDrawer,
108521
108673
  setIsOpenDrawer,
108522
- data: areas
108674
+ data: areas,
108675
+ canEdit
108523
108676
  }), /* @__PURE__ */ React__default.createElement(AreaEditDrawer, {
108524
108677
  data: areas,
108525
108678
  isOpen: isOpenDrawer,
@@ -108528,7 +108681,7 @@ const index$9 = ({ venueId, reloadAreas, areas }) => {
108528
108681
  reload: reloadAreas
108529
108682
  }));
108530
108683
  };
108531
- const AreaManagementCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
108684
+ const AreaManagementCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
108532
108685
  const { t: t2 } = useTranslation();
108533
108686
  return /* @__PURE__ */ React__default.createElement(Card, {
108534
108687
  className: styles$a.sectionCard
@@ -108552,7 +108705,7 @@ const AreaManagementCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
108552
108705
  }, table2.name), /* @__PURE__ */ React__default.createElement("p", null, table2.minCapacity, "-", table2.maxCapacity), /* @__PURE__ */ React__default.createElement("p", {
108553
108706
  style: { flex: 1, textAlign: "center" }
108554
108707
  }, (_b = (_a2 = table2.area) == null ? void 0 : _a2.name) != null ? _b : "---"));
108555
- }))), /* @__PURE__ */ React__default.createElement("div", {
108708
+ }))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
108556
108709
  className: styles$a.cardFooter
108557
108710
  }, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
108558
108711
  className: styles$a.cardFooterContent,
@@ -108922,7 +109075,7 @@ const fieldChanged$2 = (currentValue, initialData) => {
108922
109075
  }
108923
109076
  return false;
108924
109077
  };
108925
- const index$8 = ({ venueId, areas }) => {
109078
+ const index$8 = ({ venueId, areas, canEdit }) => {
108926
109079
  const [isOpenDrawer, setIsOpenDrawer] = useState(false);
108927
109080
  const { data: data2, isLoading, error: error3, reload } = useFetch(GetTableManagement, { cacheId: "table0management", venue_id: venueId });
108928
109081
  return /* @__PURE__ */ React__default.createElement("div", {
@@ -108930,7 +109083,8 @@ const index$8 = ({ venueId, areas }) => {
108930
109083
  }, /* @__PURE__ */ React__default.createElement(AreaManagementCard, {
108931
109084
  isOpenDrawer,
108932
109085
  setIsOpenDrawer,
108933
- data: data2
109086
+ data: data2,
109087
+ canEdit
108934
109088
  }), /* @__PURE__ */ React__default.createElement(TableEditDrawer, {
108935
109089
  data: data2,
108936
109090
  areasList: areas,
@@ -108950,7 +109104,7 @@ const TimeFormatter = ({ seconds: seconds2, type: type4 = "hours" }) => {
108950
109104
  ${minutes2 && minutes2 !== 0 ? minutes2 + "m" : ""}
108951
109105
  `);
108952
109106
  };
108953
- const ReservationDurationCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
109107
+ const ReservationDurationCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
108954
109108
  const { t: t2 } = useTranslation();
108955
109109
  return /* @__PURE__ */ React__default.createElement(Card, {
108956
109110
  className: styles$a.sectionCard
@@ -108985,7 +109139,7 @@ const ReservationDurationCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 })
108985
109139
  }, (shift == null ? void 0 : shift.duration) ? /* @__PURE__ */ React__default.createElement(TimeFormatter, {
108986
109140
  seconds: shift == null ? void 0 : shift.duration
108987
109141
  }) : "---")));
108988
- }))), /* @__PURE__ */ React__default.createElement("div", {
109142
+ }))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
108989
109143
  className: styles$a.cardFooter
108990
109144
  }, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
108991
109145
  className: styles$a.cardFooterContent,
@@ -109032,10 +109186,10 @@ const ReservationDurationEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2
109032
109186
  try {
109033
109187
  for (const shift of formData.shifts) {
109034
109188
  if (shift.shift1Id && fieldChanged$1(shift, initialData)) {
109035
- await executeUpdater({ data: { duration: shift.shift1 }, venue_id: venueId, table_id: shift.shift1Id, module: "seatingRule" });
109189
+ await executeUpdater({ data: { duration: shift.shift1 * 60 }, venue_id: venueId, table_id: shift.shift1Id, module: "seatingRule" });
109036
109190
  }
109037
109191
  if (shift.shift2Id && fieldChanged$1(shift, initialData)) {
109038
- await executeUpdater({ data: { duration: shift.shift2 }, venue_id: venueId, table_id: shift.shift2Id, module: "seatingRule" });
109192
+ await executeUpdater({ data: { duration: shift.shift2 * 60 }, venue_id: venueId, table_id: shift.shift2Id, module: "seatingRule" });
109039
109193
  }
109040
109194
  }
109041
109195
  reload();
@@ -109050,9 +109204,9 @@ const ReservationDurationEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2
109050
109204
  var _a3, _b, _c, _d;
109051
109205
  return {
109052
109206
  partySize: Number(partySize),
109053
- shift1: `${(_a3 = shifts[0]) == null ? void 0 : _a3.duration}` || null,
109207
+ shift1: `${((_a3 = shifts[0]) == null ? void 0 : _a3.duration) / 60}` || null,
109054
109208
  shift1Id: ((_b = shifts[0]) == null ? void 0 : _b.id) || null,
109055
- shift2: `${(_c = shifts[1]) == null ? void 0 : _c.duration}` || null,
109209
+ shift2: `${((_c = shifts[1]) == null ? void 0 : _c.duration) / 60}` || null,
109056
109210
  shift2Id: ((_d = shifts[1]) == null ? void 0 : _d.id) || null
109057
109211
  };
109058
109212
  });
@@ -109113,7 +109267,7 @@ const fieldChanged$1 = (currentValue, initialData) => {
109113
109267
  }
109114
109268
  return true;
109115
109269
  };
109116
- const index$7 = ({ venueId }) => {
109270
+ const index$7 = ({ venueId, canEdit }) => {
109117
109271
  const [isOpenDrawer, setIsOpenDrawer] = useState(false);
109118
109272
  const { data: data2, isLoading, error: error3, reload } = useFetch(GetSeatingRules, { cacheId: "reservation0duration", venue_id: venueId });
109119
109273
  const [formatedData, setformatedData] = useState(null);
@@ -109131,7 +109285,8 @@ const index$7 = ({ venueId }) => {
109131
109285
  }, /* @__PURE__ */ React__default.createElement(ReservationDurationCard, {
109132
109286
  isOpenDrawer,
109133
109287
  setIsOpenDrawer,
109134
- data: formatedData
109288
+ data: formatedData,
109289
+ canEdit
109135
109290
  }), /* @__PURE__ */ React__default.createElement(ReservationDurationEditDrawer, {
109136
109291
  data: formatedData,
109137
109292
  isOpen: isOpenDrawer,
@@ -109140,7 +109295,7 @@ const index$7 = ({ venueId }) => {
109140
109295
  reload
109141
109296
  }));
109142
109297
  };
109143
- const SpecialDatesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
109298
+ const SpecialDatesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
109144
109299
  const getOrdinal = (n2) => {
109145
109300
  const s2 = ["th", "st", "nd", "rd"];
109146
109301
  const v2 = n2 % 100;
@@ -109171,7 +109326,7 @@ const SpecialDatesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
109171
109326
  style: { textAlign: "center" }
109172
109327
  }, t2("CLOSED")) : /* @__PURE__ */ React__default.createElement("p", {
109173
109328
  style: { textAlign: "center" }
109174
- }, t2("SPECIAL_SHIFTS")))))), /* @__PURE__ */ React__default.createElement("div", {
109329
+ }, t2("SPECIAL_SHIFTS")))))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
109175
109330
  className: styles$a.cardFooter
109176
109331
  }, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
109177
109332
  className: styles$a.cardFooterContent,
@@ -109352,7 +109507,9 @@ const SpecialDatesEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, reloa
109352
109507
  titleDesc: t2("SPECIAL_DATES_DESC")
109353
109508
  }, /* @__PURE__ */ React__default.createElement("div", {
109354
109509
  className: styles$a.drawerContent
109355
- }, /* @__PURE__ */ React__default.createElement("div", {
109510
+ }, /* @__PURE__ */ React__default.createElement("p", {
109511
+ className: styles$a.specialDatesInfoText
109512
+ }, t2("SPECIAL_DATES_DESC2")), /* @__PURE__ */ React__default.createElement("div", {
109356
109513
  className: styles$a.scrollableForm,
109357
109514
  ref: scrollableRef
109358
109515
  }, fields.map((item2, index2) => /* @__PURE__ */ React__default.createElement(React__default.Fragment, {
@@ -109373,13 +109530,13 @@ const SpecialDatesEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, reloa
109373
109530
  control,
109374
109531
  id: `dates.${index2}.startDate`,
109375
109532
  name: `dates.${index2}.startDate`,
109376
- label: t2("From"),
109533
+ label: t2("StartDate"),
109377
109534
  type: "date"
109378
109535
  })), /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(TextInputField, {
109379
109536
  control,
109380
109537
  id: `dates.${index2}.endDate`,
109381
109538
  name: `dates.${index2}.endDate`,
109382
- label: t2("Until"),
109539
+ label: t2("EndDate"),
109383
109540
  type: "date"
109384
109541
  })), /* @__PURE__ */ React__default.createElement("div", {
109385
109542
  style: { marginTop: 20 }
@@ -109452,7 +109609,7 @@ const fieldChanged = (currentValue, initialData) => {
109452
109609
  }
109453
109610
  return false;
109454
109611
  };
109455
- const index$6 = ({ venueId }) => {
109612
+ const index$6 = ({ venueId, canEdit }) => {
109456
109613
  const [isOpenDrawer, setIsOpenDrawer] = useState(false);
109457
109614
  const { data: data2, isLoading, error: error3, reload } = useFetch(GetSpecialDates, { cacheId: "special0dates", venue_id: venueId });
109458
109615
  return /* @__PURE__ */ React__default.createElement("div", {
@@ -109460,7 +109617,8 @@ const index$6 = ({ venueId }) => {
109460
109617
  }, /* @__PURE__ */ React__default.createElement(SpecialDatesCard, {
109461
109618
  isOpenDrawer,
109462
109619
  setIsOpenDrawer,
109463
- data: data2
109620
+ data: data2,
109621
+ canEdit
109464
109622
  }), /* @__PURE__ */ React__default.createElement(SpecialDatesEditDrawer, {
109465
109623
  data: data2,
109466
109624
  isOpen: isOpenDrawer,
@@ -109469,7 +109627,7 @@ const index$6 = ({ venueId }) => {
109469
109627
  reload
109470
109628
  }));
109471
109629
  };
109472
- const ShiftsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
109630
+ const ShiftsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
109473
109631
  const { t: t2 } = useTranslation();
109474
109632
  return /* @__PURE__ */ React__default.createElement(Card, {
109475
109633
  className: styles$a.sectionCard
@@ -109496,7 +109654,7 @@ const ShiftsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
109496
109654
  }, (_c = (_b = (_a2 = day2 == null ? void 0 : day2.timeslots) == null ? void 0 : _a2[0]) == null ? void 0 : _b.start) != null ? _c : "--", " - ", (_f = (_e2 = (_d = day2 == null ? void 0 : day2.timeslots) == null ? void 0 : _d[0]) == null ? void 0 : _e2.end) != null ? _f : "--"), /* @__PURE__ */ React__default.createElement("p", {
109497
109655
  style: { textAlign: "center" }
109498
109656
  }, (_i = (_h = (_g = day2 == null ? void 0 : day2.timeslots) == null ? void 0 : _g[1]) == null ? void 0 : _h.start) != null ? _i : "--", " - ", (_l = (_k = (_j = day2 == null ? void 0 : day2.timeslots) == null ? void 0 : _j[1]) == null ? void 0 : _k.end) != null ? _l : "--")));
109499
- }))), /* @__PURE__ */ React__default.createElement("div", {
109657
+ }))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
109500
109658
  className: styles$a.cardFooter
109501
109659
  }, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
109502
109660
  className: styles$a.cardFooterContent,
@@ -109661,7 +109819,7 @@ const ShiftsEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, reload }) =
109661
109819
  onClick: () => onSubmit()
109662
109820
  }, t2("SAVE")))));
109663
109821
  };
109664
- const index$5 = ({ venueId }) => {
109822
+ const index$5 = ({ venueId, canEdit }) => {
109665
109823
  const [isOpenDrawer, setIsOpenDrawer] = useState(false);
109666
109824
  const weekdayOrder = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"];
109667
109825
  const { data: data2, isLoading, error: error3, reload } = useFetch(GetOpeningHours, { cacheId: "shifts0management", venue_id: venueId });
@@ -109680,7 +109838,8 @@ const index$5 = ({ venueId }) => {
109680
109838
  }, /* @__PURE__ */ React__default.createElement(ShiftsCard, {
109681
109839
  isOpenDrawer,
109682
109840
  setIsOpenDrawer,
109683
- data: formatedData
109841
+ data: formatedData,
109842
+ canEdit
109684
109843
  }), /* @__PURE__ */ React__default.createElement(ShiftsEditDrawer, {
109685
109844
  data: formatedData,
109686
109845
  isOpen: isOpenDrawer,
@@ -109689,7 +109848,7 @@ const index$5 = ({ venueId }) => {
109689
109848
  reload
109690
109849
  }));
109691
109850
  };
109692
- const ReservationPreferencesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
109851
+ const ReservationPreferencesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
109693
109852
  const { t: t2 } = useTranslation();
109694
109853
  return /* @__PURE__ */ React__default.createElement(Card, {
109695
109854
  className: styles$a.sectionCard
@@ -109715,7 +109874,7 @@ const ReservationPreferencesCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2
109715
109874
  style: { fontWeight: "bold" }
109716
109875
  }, t2("TIMEOFFSETTOMEALTIME")), /* @__PURE__ */ React__default.createElement("p", {
109717
109876
  style: { textAlign: "left" }
109718
- }, data2 == null ? void 0 : data2.slotDuration, " min")))), /* @__PURE__ */ React__default.createElement("div", {
109877
+ }, data2 == null ? void 0 : data2.slotDuration, " min")))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
109719
109878
  className: styles$a.cardFooter
109720
109879
  }, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
109721
109880
  className: styles$a.cardFooterContent,
@@ -109815,7 +109974,7 @@ const ReservationPreferencesEditDrawer = ({ isOpen, setIsOpen, venueId, data: da
109815
109974
  onClick: () => onSubmit()
109816
109975
  }, t2("SAVE")))));
109817
109976
  };
109818
- const index$4 = ({ venueId }) => {
109977
+ const index$4 = ({ venueId, canEdit }) => {
109819
109978
  const [isOpenDrawer, setIsOpenDrawer] = useState(false);
109820
109979
  const { data: data2, isLoading, error: error3, reload } = useFetch(GetArrivalRules, { cacheId: "bookingArrivalRules", venue_id: venueId });
109821
109980
  return /* @__PURE__ */ React__default.createElement("div", {
@@ -109823,7 +109982,8 @@ const index$4 = ({ venueId }) => {
109823
109982
  }, /* @__PURE__ */ React__default.createElement(ReservationPreferencesCard, {
109824
109983
  isOpenDrawer,
109825
109984
  setIsOpenDrawer,
109826
- data: data2
109985
+ data: data2,
109986
+ canEdit
109827
109987
  }), /* @__PURE__ */ React__default.createElement(ReservationPreferencesEditDrawer, {
109828
109988
  data: data2,
109829
109989
  isOpen: isOpenDrawer,
@@ -109861,9 +110021,17 @@ const formatVenueData = (data2) => {
109861
110021
  return { bookableAreas: data2.bookableAreas };
109862
110022
  };
109863
110023
  function Main$1({ venueId }) {
110024
+ var _a2;
109864
110025
  const { t: t2 } = useTranslation();
109865
110026
  const [currentVenue, setCurrentVenue] = useState(null);
110027
+ const [canEdit, setCanEdit] = useState(false);
109866
110028
  const { data: data2, isLoading, error: error3, reload } = useFetch(GetAreaManagement, { cacheId: "area0management", venue_id: currentVenue });
110029
+ const roles = (_a2 = userData == null ? void 0 : userData.roles) != null ? _a2 : [];
110030
+ useEffect(() => {
110031
+ if (!roles.includes("COMPANY_USER")) {
110032
+ setCanEdit(true);
110033
+ }
110034
+ }, [roles]);
109867
110035
  useEffect(() => {
109868
110036
  setCurrentVenue(venueId);
109869
110037
  }, [venueId]);
@@ -109876,20 +110044,26 @@ function Main$1({ venueId }) {
109876
110044
  }, /* @__PURE__ */ React__default.createElement(index$9, {
109877
110045
  areas: data2,
109878
110046
  reloadAreas: reload,
109879
- venueId: currentVenue
110047
+ venueId: currentVenue,
110048
+ canEdit
109880
110049
  }), /* @__PURE__ */ React__default.createElement(index$8, {
109881
110050
  areas: data2,
109882
- venueId: currentVenue
110051
+ venueId: currentVenue,
110052
+ canEdit
109883
110053
  }), /* @__PURE__ */ React__default.createElement(index$7, {
109884
- venueId: currentVenue
110054
+ venueId: currentVenue,
110055
+ canEdit
109885
110056
  })), /* @__PURE__ */ React__default.createElement("div", {
109886
110057
  className: styles$a.content
109887
110058
  }, /* @__PURE__ */ React__default.createElement(index$5, {
109888
- venueId: currentVenue
110059
+ venueId: currentVenue,
110060
+ canEdit
109889
110061
  }), /* @__PURE__ */ React__default.createElement(index$6, {
109890
- venueId: currentVenue
110062
+ venueId: currentVenue,
110063
+ canEdit
109891
110064
  }), /* @__PURE__ */ React__default.createElement(index$4, {
109892
- venueId: currentVenue
110065
+ venueId: currentVenue,
110066
+ canEdit
109893
110067
  })));
109894
110068
  }
109895
110069
  const mainConatiner = "_mainConatiner_kqq6g_70";
@@ -109928,7 +110102,7 @@ var styles$7 = {
109928
110102
  scrollableForm,
109929
110103
  fixedActions
109930
110104
  };
109931
- const EmailsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
110105
+ const EmailsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2, canEdit }) => {
109932
110106
  var _a2;
109933
110107
  const { t: t2 } = useTranslation();
109934
110108
  return /* @__PURE__ */ React__default.createElement(Card, {
@@ -109951,7 +110125,7 @@ const EmailsCard = ({ isOpenDrawer, setIsOpenDrawer, data: data2 }) => {
109951
110125
  style: { display: "flex", alignItems: "center<", gap: 10 }
109952
110126
  }, /* @__PURE__ */ React__default.createElement("div", null, /* @__PURE__ */ React__default.createElement(Icon, {
109953
110127
  icon: "mail"
109954
- })), t2("NOTDEFINED"))), /* @__PURE__ */ React__default.createElement("div", {
110128
+ })), t2("NOTDEFINED"))), canEdit && /* @__PURE__ */ React__default.createElement("div", {
109955
110129
  className: styles$7.cardFooter
109956
110130
  }, /* @__PURE__ */ React__default.createElement("hr", null), /* @__PURE__ */ React__default.createElement("div", {
109957
110131
  className: styles$7.cardFooterContent,
@@ -110045,14 +110219,15 @@ const EmailEditDrawer = ({ isOpen, setIsOpen, venueId, data: data2, reload }) =>
110045
110219
  onClick: () => onSubmit()
110046
110220
  }, t2("SAVE")))));
110047
110221
  };
110048
- const index$3 = ({ venueId, data: data2, reload }) => {
110222
+ const index$3 = ({ venueId, data: data2, reload, canEdit }) => {
110049
110223
  const [isOpenDrawer, setIsOpenDrawer] = useState(false);
110050
110224
  return /* @__PURE__ */ React__default.createElement("div", {
110051
110225
  className: styles$7.sectionManagement
110052
110226
  }, /* @__PURE__ */ React__default.createElement(EmailsCard, {
110053
110227
  isOpenDrawer,
110054
110228
  setIsOpenDrawer,
110055
- data: data2
110229
+ data: data2,
110230
+ canEdit
110056
110231
  }), /* @__PURE__ */ React__default.createElement(EmailEditDrawer, {
110057
110232
  data: data2,
110058
110233
  isOpen: isOpenDrawer,
@@ -110061,7 +110236,7 @@ const index$3 = ({ venueId, data: data2, reload }) => {
110061
110236
  reload
110062
110237
  }));
110063
110238
  };
110064
- const ReservationsCard = ({ data: data2, reload }) => {
110239
+ const ReservationsCard = ({ data: data2, reload, canEdit }) => {
110065
110240
  const { t: t2 } = useTranslation();
110066
110241
  const { isExecuting, execute } = useService(UpdateUserNotificationSettings, {
110067
110242
  onSuccess: async () => {
@@ -110108,6 +110283,7 @@ const ReservationsCard = ({ data: data2, reload }) => {
110108
110283
  id: "bookingCreation",
110109
110284
  name: "bookingCreation",
110110
110285
  label: t2("NEWBOOKINGS"),
110286
+ disabled: !canEdit,
110111
110287
  onChangeEvent: (e3) => {
110112
110288
  execute({ data: { ...getValues(), bookingCreation: e3.target.checked } });
110113
110289
  }
@@ -110116,6 +110292,7 @@ const ReservationsCard = ({ data: data2, reload }) => {
110116
110292
  id: "bookingAmendment",
110117
110293
  name: "bookingAmendment",
110118
110294
  label: t2("BOOKINGAMEND"),
110295
+ disabled: !canEdit,
110119
110296
  onChangeEvent: (e3) => {
110120
110297
  execute({ data: { ...getValues(), bookingAmendment: e3.target.checked } });
110121
110298
  }
@@ -110124,20 +110301,22 @@ const ReservationsCard = ({ data: data2, reload }) => {
110124
110301
  id: "bookingCancellation",
110125
110302
  name: "bookingCancellation",
110126
110303
  label: t2("CANCELLATIONS"),
110304
+ disabled: !canEdit,
110127
110305
  onChangeEvent: (e3) => {
110128
110306
  execute({ data: { ...getValues(), bookingCancellation: e3.target.checked } });
110129
110307
  }
110130
110308
  }))));
110131
110309
  };
110132
- const index$2 = ({ venueId, data: data2, reload }) => {
110310
+ const index$2 = ({ venueId, data: data2, reload, canEdit }) => {
110133
110311
  return /* @__PURE__ */ React__default.createElement("div", {
110134
110312
  className: styles$7.sectionManagement
110135
110313
  }, /* @__PURE__ */ React__default.createElement(ReservationsCard, {
110136
110314
  data: data2,
110137
- reload
110315
+ reload,
110316
+ canEdit
110138
110317
  }));
110139
110318
  };
110140
- const ReviewsCard = ({ data: data2, reload }) => {
110319
+ const ReviewsCard = ({ data: data2, reload, canEdit }) => {
110141
110320
  const { t: t2 } = useTranslation();
110142
110321
  const { isExecuting, execute } = useService(UpdateUserNotificationSettings, {
110143
110322
  onSuccess: async () => {
@@ -110183,6 +110362,7 @@ const ReviewsCard = ({ data: data2, reload }) => {
110183
110362
  id: "allReviewAlert",
110184
110363
  name: "allReviewAlert",
110185
110364
  label: t2("ALLREVIEWS"),
110365
+ disabled: !canEdit,
110186
110366
  onChangeEvent: (e3) => {
110187
110367
  execute({ data: { ...getValues(), allReviewAlert: e3.target.checked } });
110188
110368
  }
@@ -110191,20 +110371,22 @@ const ReviewsCard = ({ data: data2, reload }) => {
110191
110371
  id: "negativeReviewAlert",
110192
110372
  name: "negativeReviewAlert",
110193
110373
  label: t2("NEGATIVEREVIEWS1"),
110374
+ disabled: !canEdit,
110194
110375
  onChangeEvent: (e3) => {
110195
110376
  execute({ data: { ...getValues(), negativeReviewAlert: e3.target.checked } });
110196
110377
  }
110197
110378
  }))));
110198
110379
  };
110199
- const index$1 = ({ venueId, data: data2, reload }) => {
110380
+ const index$1 = ({ venueId, data: data2, reload, canEdit }) => {
110200
110381
  return /* @__PURE__ */ React__default.createElement("div", {
110201
110382
  className: styles$7.sectionManagement
110202
110383
  }, /* @__PURE__ */ React__default.createElement(ReviewsCard, {
110203
110384
  data: data2,
110204
- reload
110385
+ reload,
110386
+ canEdit
110205
110387
  }));
110206
110388
  };
110207
- const ReviewsReportCard = ({ data: data2, reload }) => {
110389
+ const ReviewsReportCard = ({ data: data2, reload, canEdit }) => {
110208
110390
  const { t: t2 } = useTranslation();
110209
110391
  const { isExecuting, execute } = useService(UpdateUserNotificationSettings, {
110210
110392
  onSuccess: async () => {
@@ -110248,6 +110430,7 @@ const ReviewsReportCard = ({ data: data2, reload }) => {
110248
110430
  style: { display: "flex", flexDirection: "column", gap: 20 }
110249
110431
  }, /* @__PURE__ */ React__default.createElement(SwitchField, {
110250
110432
  control,
110433
+ disabled: !canEdit,
110251
110434
  id: "dailyReport",
110252
110435
  name: "dailyReport",
110253
110436
  label: t2("DAILYREPORT"),
@@ -110256,6 +110439,7 @@ const ReviewsReportCard = ({ data: data2, reload }) => {
110256
110439
  }
110257
110440
  }), /* @__PURE__ */ React__default.createElement(SwitchField, {
110258
110441
  control,
110442
+ disabled: !canEdit,
110259
110443
  id: "weeklyReport",
110260
110444
  name: "weeklyReport",
110261
110445
  label: t2("WEEKLYREPORT"),
@@ -110264,6 +110448,7 @@ const ReviewsReportCard = ({ data: data2, reload }) => {
110264
110448
  }
110265
110449
  }), /* @__PURE__ */ React__default.createElement(SwitchField, {
110266
110450
  control,
110451
+ disabled: !canEdit,
110267
110452
  id: "monthlyReport",
110268
110453
  name: "monthlyReport",
110269
110454
  label: t2("MONTHLYREPORT"),
@@ -110272,23 +110457,32 @@ const ReviewsReportCard = ({ data: data2, reload }) => {
110272
110457
  }
110273
110458
  }))));
110274
110459
  };
110275
- const index = ({ venueId, data: data2, reload }) => {
110460
+ const index = ({ venueId, data: data2, reload, canEdit }) => {
110276
110461
  return /* @__PURE__ */ React__default.createElement("div", {
110277
110462
  className: styles$7.sectionManagement
110278
110463
  }, /* @__PURE__ */ React__default.createElement(ReviewsReportCard, {
110279
110464
  data: data2,
110280
- reload
110465
+ reload,
110466
+ canEdit
110281
110467
  }));
110282
110468
  };
110283
110469
  function Main({ venueId }) {
110470
+ var _a2;
110284
110471
  const { t: t2 } = useTranslation();
110285
110472
  const [currentVenue, setCurrentVenue] = useState(null);
110473
+ const [canEdit, setCanEdit] = useState(false);
110474
+ const roles = (_a2 = userData == null ? void 0 : userData.roles) != null ? _a2 : [];
110286
110475
  const { data: data2, isLoading, error: error3, reload } = useFetch(
110287
110476
  GetUserNotificationSettings,
110288
110477
  {
110289
110478
  cacheId: `user-notifications-settings`
110290
110479
  }
110291
110480
  );
110481
+ useEffect(() => {
110482
+ if (!roles.includes("COMPANY_USER")) {
110483
+ setCanEdit(true);
110484
+ }
110485
+ }, [roles]);
110292
110486
  useEffect(() => {
110293
110487
  setCurrentVenue(venueId);
110294
110488
  }, [venueId]);
@@ -110301,19 +110495,23 @@ function Main({ venueId }) {
110301
110495
  }, /* @__PURE__ */ React__default.createElement(index$3, {
110302
110496
  venueId: currentVenue,
110303
110497
  data: data2,
110304
- reload
110498
+ reload,
110499
+ canEdit
110305
110500
  }), /* @__PURE__ */ React__default.createElement(index$2, {
110306
110501
  venueId: currentVenue,
110307
110502
  data: data2,
110308
- reload
110503
+ reload,
110504
+ canEdit
110309
110505
  }), /* @__PURE__ */ React__default.createElement(index$1, {
110310
110506
  venueId: currentVenue,
110311
110507
  data: data2,
110312
- reload
110508
+ reload,
110509
+ canEdit
110313
110510
  }), /* @__PURE__ */ React__default.createElement(index, {
110314
110511
  venueId: currentVenue,
110315
110512
  data: data2,
110316
- reload
110513
+ reload,
110514
+ canEdit
110317
110515
  })));
110318
110516
  }
110319
110517
  const defaultValue = {