@roomstay/core 0.1.78-2 → 0.1.78

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.
Files changed (247) hide show
  1. package/dist/browser/index.js +3901 -0
  2. package/dist/browser/index.js.map +1 -0
  3. package/dist/node/index.cjs +25 -0
  4. package/dist/node/index.cjs.map +1 -0
  5. package/dist/node/index.mjs +3901 -0
  6. package/dist/node/index.mjs.map +1 -0
  7. package/dist/node.js +1 -1
  8. package/dist/types/AnalyticsEvents/IAnalyticsEvent.type.d.ts +12 -38
  9. package/dist/types/AnalyticsEvents/IRoomstayEventData.type.d.ts +2 -27
  10. package/dist/types/AnalyticsEvents/MetaCapiTransformer.d.ts +2 -6
  11. package/dist/types/Booking/IBookingExtraFields.type.d.ts +8 -4
  12. package/dist/types/Booking/PlaceBooking.types.d.ts +0 -1
  13. package/dist/types/Company/ECompanyProvider.enum.d.ts +1 -2
  14. package/dist/types/Company/IAdminCompany.type.d.ts +0 -6
  15. package/dist/types/GiftCards/GiftCard.types.d.ts +0 -9
  16. package/dist/types/Maintenance/IMaintenanceStatus.type.d.ts +1 -4
  17. package/dist/types/Member/IRoomstayMember.type.d.ts +1 -2
  18. package/dist/types/Policies/EGuaranteePolicy.enum.d.ts +0 -5
  19. package/dist/types/index.d.ts +2 -19
  20. package/dist/types/index.d.ts.map +1 -0
  21. package/dist/types/types/Addons/Addon.enum.d.ts +3 -0
  22. package/dist/types/types/Addons/Addon.enum.d.ts.map +1 -0
  23. package/dist/types/{Addon/Addon.d.ts → types/Addons/Addon.types.d.ts} +21 -3
  24. package/dist/types/types/Addons/Addon.types.d.ts.map +1 -0
  25. package/dist/types/types/Analytics/IBigQueryResults.type.d.ts +46 -0
  26. package/dist/types/types/Analytics/IBigQueryResults.type.d.ts.map +1 -0
  27. package/dist/types/types/AnalyticsEvents/IAnalyticsEvent.type.d.ts +65 -0
  28. package/dist/types/types/AnalyticsEvents/IAnalyticsEvent.type.d.ts.map +1 -0
  29. package/dist/types/types/AnalyticsEvents/IAnalyticsSession.type.d.ts +21 -0
  30. package/dist/types/types/AnalyticsEvents/IAnalyticsSession.type.d.ts.map +1 -0
  31. package/dist/types/types/AnalyticsEvents/IRoomstayEventData.type.d.ts +66 -0
  32. package/dist/types/types/AnalyticsEvents/IRoomstayEventData.type.d.ts.map +1 -0
  33. package/dist/types/types/AnalyticsEvents/MetaCapiTransformer.d.ts +22 -0
  34. package/dist/types/types/AnalyticsEvents/MetaCapiTransformer.d.ts.map +1 -0
  35. package/dist/types/{Api/ReservationsDTO.d.ts → types/Api/Reservations.type.d.ts} +11 -28
  36. package/dist/types/types/Api/Reservations.type.d.ts.map +1 -0
  37. package/dist/types/{Api/RoomNightRateDTO.d.ts → types/Api/RoomNightRate.type.d.ts} +1 -0
  38. package/dist/types/types/Api/RoomNightRate.type.d.ts.map +1 -0
  39. package/dist/types/types/Availability/Availability.types.d.ts +122 -0
  40. package/dist/types/types/Availability/Availability.types.d.ts.map +1 -0
  41. package/dist/types/types/Booking/ConfirmBooking.types.d.ts +22 -0
  42. package/dist/types/types/Booking/ConfirmBooking.types.d.ts.map +1 -0
  43. package/dist/types/types/Booking/EBooking.types.d.ts +13 -0
  44. package/dist/types/types/Booking/EBooking.types.d.ts.map +1 -0
  45. package/dist/types/types/Booking/GetBooking.types.d.ts +8 -0
  46. package/dist/types/types/Booking/GetBooking.types.d.ts.map +1 -0
  47. package/dist/types/{Booking/IBookingCreateErrorResponse.d.ts → types/Booking/IBookingCreateErrorResponse.type.d.ts} +3 -0
  48. package/dist/types/types/Booking/IBookingCreateErrorResponse.type.d.ts.map +1 -0
  49. package/dist/types/types/Booking/IBookingExtraFields.type.d.ts +6 -0
  50. package/dist/types/types/Booking/IBookingExtraFields.type.d.ts.map +1 -0
  51. package/dist/types/types/Booking/IBookingPayment.type.d.ts +106 -0
  52. package/dist/types/types/Booking/IBookingPayment.type.d.ts.map +1 -0
  53. package/dist/types/types/Booking/IBookingQuote.type.d.ts +31 -0
  54. package/dist/types/types/Booking/IBookingQuote.type.d.ts.map +1 -0
  55. package/dist/types/types/Booking/ICommonQueryParameters.type.d.ts +4 -0
  56. package/dist/types/types/Booking/ICommonQueryParameters.type.d.ts.map +1 -0
  57. package/dist/types/types/Booking/Itinerary.types.d.ts +100 -0
  58. package/dist/types/types/Booking/Itinerary.types.d.ts.map +1 -0
  59. package/dist/types/types/Booking/PencilReservation.types.d.ts +20 -0
  60. package/dist/types/types/Booking/PencilReservation.types.d.ts.map +1 -0
  61. package/dist/types/types/Booking/PlaceBooking.types.d.ts +90 -0
  62. package/dist/types/types/Booking/PlaceBooking.types.d.ts.map +1 -0
  63. package/dist/types/types/Company/ECompanyProvider.enum.d.ts +9 -0
  64. package/dist/types/types/Company/ECompanyProvider.enum.d.ts.map +1 -0
  65. package/dist/types/types/Company/IAdminCompany.type.d.ts +47 -0
  66. package/dist/types/types/Company/IAdminCompany.type.d.ts.map +1 -0
  67. package/dist/types/types/Company/IAdminCompanyUser.type.d.ts +16 -0
  68. package/dist/types/types/Company/IAdminCompanyUser.type.d.ts.map +1 -0
  69. package/dist/types/types/Events/ERoomstayEventSource.enum.d.ts +5 -0
  70. package/dist/types/types/Events/ERoomstayEventSource.enum.d.ts.map +1 -0
  71. package/dist/types/types/Events/IRoomstayEvent.type.d.ts +51 -0
  72. package/dist/types/types/Events/IRoomstayEvent.type.d.ts.map +1 -0
  73. package/dist/types/types/Fees/EFeeType.enum.d.ts +8 -0
  74. package/dist/types/types/Fees/EFeeType.enum.d.ts.map +1 -0
  75. package/dist/types/types/Fees/IFee.type.d.ts +12 -0
  76. package/dist/types/types/Fees/IFee.type.d.ts.map +1 -0
  77. package/dist/types/types/Fees/IFeeConfigurationOptions.type.d.ts +7 -0
  78. package/dist/types/types/Fees/IFeeConfigurationOptions.type.d.ts.map +1 -0
  79. package/dist/types/types/General/Format.types.d.ts +2 -0
  80. package/dist/types/types/General/Format.types.d.ts.map +1 -0
  81. package/dist/types/types/General/HttpMethod.enum.d.ts +10 -0
  82. package/dist/types/types/General/HttpMethod.enum.d.ts.map +1 -0
  83. package/dist/types/types/General/IMessage.type.d.ts +7 -0
  84. package/dist/types/types/General/IMessage.type.d.ts.map +1 -0
  85. package/dist/types/types/General/Pagination.types.d.ts +21 -0
  86. package/dist/types/types/General/Pagination.types.d.ts.map +1 -0
  87. package/dist/types/types/General/Warning.type.d.ts +15 -0
  88. package/dist/types/types/General/Warning.type.d.ts.map +1 -0
  89. package/dist/types/types/GiftCards/GiftCard.types.d.ts +346 -0
  90. package/dist/types/types/GiftCards/GiftCard.types.d.ts.map +1 -0
  91. package/dist/types/types/GiftCards/GiftCardAuth.types.d.ts +32 -0
  92. package/dist/types/types/GiftCards/GiftCardAuth.types.d.ts.map +1 -0
  93. package/dist/types/types/GiftCards/GiftCardLogs.enum.d.ts +35 -0
  94. package/dist/types/types/GiftCards/GiftCardLogs.enum.d.ts.map +1 -0
  95. package/dist/types/types/Hotel/EHotelAddressRequirement.enum.d.ts +6 -0
  96. package/dist/types/types/Hotel/EHotelAddressRequirement.enum.d.ts.map +1 -0
  97. package/dist/types/types/Hotel/EHotelPriceModel.enum.d.ts +6 -0
  98. package/dist/types/types/Hotel/EHotelPriceModel.enum.d.ts.map +1 -0
  99. package/dist/types/types/Hotel/EHotelStateFieldConfiguration.enum.d.ts +6 -0
  100. package/dist/types/types/Hotel/EHotelStateFieldConfiguration.enum.d.ts.map +1 -0
  101. package/dist/types/types/Hotel/EHotelWeekdayStartsOn.enum.d.ts +5 -0
  102. package/dist/types/types/Hotel/EHotelWeekdayStartsOn.enum.d.ts.map +1 -0
  103. package/dist/types/types/Hotel/EIntegration.enum.d.ts +10 -0
  104. package/dist/types/types/Hotel/EIntegration.enum.d.ts.map +1 -0
  105. package/dist/types/types/Hotel/IAuxiliaryFilter.type.d.ts +25 -0
  106. package/dist/types/types/Hotel/IAuxiliaryFilter.type.d.ts.map +1 -0
  107. package/dist/types/types/Hotel/IHotelColorScheme.type.d.ts +30 -0
  108. package/dist/types/types/Hotel/IHotelColorScheme.type.d.ts.map +1 -0
  109. package/dist/types/types/Hotel/IHotelOverrides.type.d.ts +29 -0
  110. package/dist/types/types/Hotel/IHotelOverrides.type.d.ts.map +1 -0
  111. package/dist/types/types/Hotel/IHotelReplica.type.d.ts +57 -0
  112. package/dist/types/types/Hotel/IHotelReplica.type.d.ts.map +1 -0
  113. package/dist/types/types/Hotel/IHotelService.type.d.ts +7 -0
  114. package/dist/types/types/Hotel/IHotelService.type.d.ts.map +1 -0
  115. package/dist/types/types/Image/IRoomstayImage.type.d.ts +9 -0
  116. package/dist/types/types/Image/IRoomstayImage.type.d.ts.map +1 -0
  117. package/dist/types/types/Maintenance/IMaintenanceStatus.type.d.ts +27 -0
  118. package/dist/types/types/Maintenance/IMaintenanceStatus.type.d.ts.map +1 -0
  119. package/dist/types/types/Media/IMedia.type.d.ts +11 -0
  120. package/dist/types/types/Media/IMedia.type.d.ts.map +1 -0
  121. package/dist/types/types/Member/IMember.type.d.ts +8 -0
  122. package/dist/types/types/Member/IMember.type.d.ts.map +1 -0
  123. package/dist/types/types/Member/IMemberVerification.type.d.ts +11 -0
  124. package/dist/types/types/Member/IMemberVerification.type.d.ts.map +1 -0
  125. package/dist/types/types/Member/IRoomstayCognitoMember.type.d.ts +5 -0
  126. package/dist/types/types/Member/IRoomstayCognitoMember.type.d.ts.map +1 -0
  127. package/dist/types/types/Member/IRoomstayMember.type.d.ts +19 -0
  128. package/dist/types/types/Member/IRoomstayMember.type.d.ts.map +1 -0
  129. package/dist/types/types/Member/IRoomstayMemberBooking.type.d.ts +29 -0
  130. package/dist/types/types/Member/IRoomstayMemberBooking.type.d.ts.map +1 -0
  131. package/dist/types/types/Member/IRoomstayMemberBookingAddress.type.d.ts +10 -0
  132. package/dist/types/types/Member/IRoomstayMemberBookingAddress.type.d.ts.map +1 -0
  133. package/dist/types/types/Member/IRoomstayMemberBookingItem.type.d.ts +26 -0
  134. package/dist/types/types/Member/IRoomstayMemberBookingItem.type.d.ts.map +1 -0
  135. package/dist/types/types/Member/IRoomstayMemberBookingProfile.type.d.ts +12 -0
  136. package/dist/types/types/Member/IRoomstayMemberBookingProfile.type.d.ts.map +1 -0
  137. package/dist/types/types/Member/IRoomstayMemberCards.type.d.ts +13 -0
  138. package/dist/types/types/Member/IRoomstayMemberCards.type.d.ts.map +1 -0
  139. package/dist/types/types/Member/IRoomstayMemberJWTData.type.d.ts +4 -0
  140. package/dist/types/types/Member/IRoomstayMemberJWTData.type.d.ts.map +1 -0
  141. package/dist/types/types/Member/ISession.type.d.ts +5 -0
  142. package/dist/types/types/Member/ISession.type.d.ts.map +1 -0
  143. package/dist/types/types/OHIP/IOHIPConfiguration.types.d.ts +13 -0
  144. package/dist/types/types/OHIP/IOHIPConfiguration.types.d.ts.map +1 -0
  145. package/dist/types/types/OHIP/index.d.ts +2 -0
  146. package/dist/types/types/OHIP/index.d.ts.map +1 -0
  147. package/dist/types/types/Package/Package.types.d.ts +105 -0
  148. package/dist/types/types/Package/Package.types.d.ts.map +1 -0
  149. package/dist/types/types/Policies/EGuaranteePolicy.enum.d.ts +7 -0
  150. package/dist/types/types/Policies/EGuaranteePolicy.enum.d.ts.map +1 -0
  151. package/dist/types/types/PromoCode/EPromoCodeDiscountType.enum.d.ts +6 -0
  152. package/dist/types/types/PromoCode/EPromoCodeDiscountType.enum.d.ts.map +1 -0
  153. package/dist/types/types/PromoCode/PromoCodeStayDateRangeType.enum.d.ts +12 -0
  154. package/dist/types/types/PromoCode/PromoCodeStayDateRangeType.enum.d.ts.map +1 -0
  155. package/dist/types/{PMSSync/EPMSSyncStatus.enum.d.ts → types/RMS/ERMSAuthSyncHistoryStatus.type.d.ts} +4 -3
  156. package/dist/types/types/RMS/ERMSAuthSyncHistoryStatus.type.d.ts.map +1 -0
  157. package/dist/types/types/RMS/ERMSDiscountType.enum.d.ts +7 -0
  158. package/dist/types/types/RMS/ERMSDiscountType.enum.d.ts.map +1 -0
  159. package/dist/types/types/RMS/ERMSSyncStrategy.enum.d.ts +39 -0
  160. package/dist/types/types/RMS/ERMSSyncStrategy.enum.d.ts.map +1 -0
  161. package/dist/types/types/RMS/IRMSPropertyDiscount.type.d.ts +34 -0
  162. package/dist/types/types/RMS/IRMSPropertyDiscount.type.d.ts.map +1 -0
  163. package/dist/types/types/RMS/IRMSRequirement.type.d.ts +21 -0
  164. package/dist/types/types/RMS/IRMSRequirement.type.d.ts.map +1 -0
  165. package/dist/types/types/RMS/IRMSSyncResponse.type.d.ts +9 -0
  166. package/dist/types/types/RMS/IRMSSyncResponse.type.d.ts.map +1 -0
  167. package/dist/types/types/RMS/RMSBookingSource.type.d.ts +8 -0
  168. package/dist/types/types/RMS/RMSBookingSource.type.d.ts.map +1 -0
  169. package/dist/types/types/Room/IRoomGroup.type.d.ts +19 -0
  170. package/dist/types/types/Room/IRoomGroup.type.d.ts.map +1 -0
  171. package/dist/types/types/index.d.ts +139 -0
  172. package/dist/types/types/index.d.ts.map +1 -0
  173. package/dist/types/utils/TotalCalculator.d.ts +73 -0
  174. package/dist/types/utils/TotalCalculator.d.ts.map +1 -0
  175. package/dist/types/utils/bookingTotal.d.ts +8 -0
  176. package/dist/types/utils/bookingTotal.d.ts.map +1 -0
  177. package/dist/types/utils/calculateFee.d.ts +11 -0
  178. package/dist/types/utils/calculateFee.d.ts.map +1 -0
  179. package/dist/types/utils/feeTypes.d.ts +6 -0
  180. package/dist/types/utils/feeTypes.d.ts.map +1 -0
  181. package/dist/types/utils/index.d.ts +11 -0
  182. package/dist/types/utils/index.d.ts.map +1 -0
  183. package/dist/types/utils/reflection.d.ts +10 -0
  184. package/dist/types/utils/reflection.d.ts.map +1 -0
  185. package/dist/types/utils/roomstayImageResize.d.ts +15 -0
  186. package/dist/types/utils/roomstayImageResize.d.ts.map +1 -0
  187. package/dist/types/utils/roundMoney.d.ts +11 -0
  188. package/dist/types/utils/roundMoney.d.ts.map +1 -0
  189. package/dist/types/utils/typeUtils.d.ts +2 -0
  190. package/dist/types/utils/typeUtils.d.ts.map +1 -0
  191. package/dist/types/utils/uppercaseString.d.ts +2 -0
  192. package/dist/types/utils/uppercaseString.d.ts.map +1 -0
  193. package/dist/types/utils/zodUtils.d.ts +20 -0
  194. package/dist/types/utils/zodUtils.d.ts.map +1 -0
  195. package/dist/utils/roundMoney.d.ts +1 -11
  196. package/dist/web.js +1 -1
  197. package/package.json +1 -1
  198. package/dist/components/DateRangePicker/DateRangePicker.d.ts +0 -16
  199. package/dist/components/DateRangePicker/DateRangePicker.type.d.ts +0 -16
  200. package/dist/components/DateRangePicker/DateRangePickerContext.d.ts +0 -16
  201. package/dist/components/DateRangePicker/DateRangePickerDay.d.ts +0 -22
  202. package/dist/components/DateRangePicker/DateRangePickerDays.d.ts +0 -7
  203. package/dist/components/DateRangePicker/DateRangePickerMonth.d.ts +0 -9
  204. package/dist/components/DateRangePicker/FloatingDateRangePicker.d.ts +0 -26
  205. package/dist/components/DateRangePicker/index.d.ts +0 -3
  206. package/dist/components/Icon/Icon.d.ts +0 -19
  207. package/dist/components/Icon/index.d.ts +0 -1
  208. package/dist/components/Overlay/Overlay.d.ts +0 -21
  209. package/dist/components/Overlay/index.d.ts +0 -1
  210. package/dist/components/RoomstayPortal/RoomstayPortal.d.ts +0 -8
  211. package/dist/components/RoomstayPortal/index.d.ts +0 -1
  212. package/dist/components/Text/Text.d.ts +0 -18
  213. package/dist/components/Text/Text.type.d.ts +0 -14
  214. package/dist/components/Text/index.d.ts +0 -2
  215. package/dist/components/animations/AutoAutoHeight.d.ts +0 -9
  216. package/dist/components/animations/Fade.d.ts +0 -13
  217. package/dist/components/animations/index.d.ts +0 -1
  218. package/dist/components/index.d.ts +0 -6
  219. package/dist/hooks/BodyClickHook.d.ts +0 -8
  220. package/dist/index.node.d.ts +0 -2
  221. package/dist/index.web.d.ts +0 -3
  222. package/dist/node.js.map +0 -1
  223. package/dist/roomstay-core-0.1.26.tgz +0 -0
  224. package/dist/stories/DateRangePicker.stories.d.ts +0 -8
  225. package/dist/stories/FloatingDateRangePicker.stories.d.ts +0 -5
  226. package/dist/types/Addon/Addon.enum.d.ts +0 -14
  227. package/dist/types/Addon/Addon.type.d.ts +0 -24
  228. package/dist/types/Booking/IBookingStatus.type.d.ts +0 -5
  229. package/dist/types/Booking/IPrice.type.d.ts +0 -7
  230. package/dist/types/Hotel/IHotel.enum.d.ts +0 -32
  231. package/dist/types/Hotel/IHotel.type.d.ts +0 -275
  232. package/dist/types/Hotel/IntegrationConfigs.type.d.ts +0 -76
  233. package/dist/types/Hotel/InternalMemberSignInModal.type.d.ts +0 -13
  234. package/dist/types/Hotel/InternalMemberSignInModal.types.d.ts +0 -13
  235. package/dist/types/Member/IRoomstayMemberLoyalty.type.d.ts +0 -16
  236. package/dist/types/Newbook/ENewbookRegion.enum.d.ts +0 -7
  237. package/dist/types/Newbook/ENewbookSyncStrategy.enum.d.ts +0 -5
  238. package/dist/types/Newbook/index.d.ts +0 -2
  239. package/dist/types/PMSSync/IPMSSyncResponse.type.d.ts +0 -10
  240. package/dist/types/PMSSync/index.d.ts +0 -17
  241. package/dist/types/Room/HotelRoom.type.d.ts +0 -24
  242. package/dist/types/Room/SynxisRoom.type.d.ts +0 -35
  243. package/dist/utils/CalendarHelper.d.ts +0 -16
  244. package/dist/utils/color.d.ts +0 -17
  245. package/dist/utils/index.node.d.ts +0 -2
  246. package/dist/utils/index.web.d.ts +0 -4
  247. package/dist/web.js.map +0 -1
@@ -0,0 +1,3901 @@
1
+ var Et = /* @__PURE__ */ ((e) => (e.Pending = "Pending", e.Processing = "Processing", e.Committed = "Committed", e.Cancelled = "Cancelled", e.Reverted = "Reverted", e))(Et || {}), Rt = /* @__PURE__ */ ((e) => (e.Default = "Default", e.PreCheckoutPencil = "PreCheckoutPencil", e.PostCheckoutPencil = "PostCheckoutPencil", e))(Rt || {}), Dt = /* @__PURE__ */ ((e) => (e.Card = "Card", e.SavedCard = "SavedCard", e.Planpay = "Planpay", e.Adyen = "Adyen", e.Afterpay = "Afterpay", e.PCIBookingCard = "PCIBookingCard", e.TrueRewards = "TrueRewards", e))(Dt || {}), Ft = /* @__PURE__ */ ((e) => (e.Passthrough = "Passthrough", e.Adyen = "Adyen", e.Till = "Till", e.RMSPay = "RMSPay", e.Windcave = "Windcave", e.Mastercard = "Mastercard", e.Stripe = "Stripe", e.PayPal = "PayPal", e))(Ft || {}), yt = /* @__PURE__ */ ((e) => (e.Unknown = "unknown", e.Unpaid = "unpaid", e.Accepted = "accepted", e.Cancelled = "cancelled", e.Refunded = "refunded", e.Rejected = "rejected", e))(yt || {});
2
+ const Tc = [];
3
+ class Ec {
4
+ constructor() {
5
+ this.reservations = [];
6
+ }
7
+ }
8
+ class Rc {
9
+ constructor() {
10
+ this.nights = {}, this.guestCounts = {
11
+ adults: 1,
12
+ children: 0
13
+ }, this.guest = new Ut();
14
+ }
15
+ }
16
+ class Ut {
17
+ constructor() {
18
+ this.address = {};
19
+ }
20
+ }
21
+ var jt = /* @__PURE__ */ ((e) => (e.Synxis = "Synxis", e.Availpro = "Availpro", e.RMS = "RMS", e.Siteminder = "Siteminder", e.Roomstay = "Roomstay", e.OHIP = "OHIP", e))(jt || {}), Lt = /* @__PURE__ */ ((e) => (e.SuperAdmin = "SuperAdmin", e.Admin = "Admin", e.Limited = "Limited", e))(Lt || {}), St = /* @__PURE__ */ ((e) => (e.FullAddressRequired = "FullAddressRequired", e.AddressOptionalCountryRequired = "AddressOptionalCountryRequired", e.AddressOptional = "AddressOptional", e))(St || {}), xt = /* @__PURE__ */ ((e) => (e.PerPerson = "PerPerson", e.PerDay = "PerDay", e.PerOccupancy = "PerOccupancy", e))(xt || {}), qt = /* @__PURE__ */ ((e) => (e.NotIncluded = "NotIncluded", e.Optional = "Optional", e.Required = "Required", e))(qt || {}), Bt = /* @__PURE__ */ ((e) => (e.Monday = "monday", e.Sunday = "sunday", e))(Bt || {}), Gt = /* @__PURE__ */ ((e) => (e.Big4 = "Big4", e.RmsTop10 = "Top10", e.Top10 = "NewTop10", e.Gday = "Gday", e.Salesforce = "Salesforce", e.RAC = "RAC", e.AnalyticsEvents = "AnalyticsEvents", e))(Gt || {}), Mt = /* @__PURE__ */ ((e) => (e.AreaDwellingLength = "AreaDwellingLength", e.AreaDwellingType = "AreaDwellingType", e))(Mt || {}), Vt = /* @__PURE__ */ ((e) => (e.Metric = "metric", e.Imperial = "imperial", e))(Vt || {}), Wt = /* @__PURE__ */ ((e) => (e.Success = "success", e.Failure = "failure", e.New = "new", e.Queued = "queued", e.InProgress = "in_progress", e.RequireResume = "require_resume", e))(Wt || {}), Yt = /* @__PURE__ */ ((e) => (e.Percentage = "Percentage", e.Amount = "Amount", e.Bogo = "BOGO", e.NightlyRateOverride = "NightlyRateOverride", e))(Yt || {}), Ht = /* @__PURE__ */ ((e) => (e.Hotel = "hotel", e.HotelImages = "hotelImages", e.Cancellation = "cancellation", e.Room = "room", e.Rates = "rates", e.OneGuaranteePolicy = "oneGuaranteePolicy", e.RoomRates = "roomRates", e.RoomImages = "roomImages", e.BookingSources = "booking-sources", e.Areas = "areas", e.Dwellings = "dwellings", e.AreaDwellings = "areaDwellings", e.ConvertDwellingConfigToAuxInput = "convertDwellingConfigToAuxInput", e.Discounts = "discounts", e.PropertyDiscounts = "propertyDiscounts", e.RoomDiscounts = "roomDiscounts", e.PropertySundries = "propertySundries", e.PropertyFees = "propertyFees", e.PropertyCards = "property-cards", e.Countries = "countries", e.Addons = "addons", e.Requirements = "requirements", e.RoomAddons = "room-addons", e.ClientFacingPromoSync = "clientFacingPromoSync", e.ClientFacingRoomSync = "clientFacingRoomSync", e.ClientFacingRateSync = "clientFacingRateSync", e.NewRateFetch = "newRateFetch", e))(Ht || {}), Qt = /* @__PURE__ */ ((e) => (e[e.Icon = 128] = "Icon", e[e.Tiny = 256] = "Tiny", e[e.Small = 512] = "Small", e[e.Medium = 768] = "Medium", e[e.Large = 1024] = "Large", e[e.ExtraLarge = 1600] = "ExtraLarge", e))(Qt || {}), Kt = /* @__PURE__ */ ((e) => (e.Frontend = "frontend", e.Hotel = "hotel", e.Events = "events", e))(Kt || {});
22
+ class Jt {
23
+ constructor() {
24
+ this.availability = {};
25
+ }
26
+ }
27
+ class Dc extends Jt {
28
+ constructor() {
29
+ super(...arguments), this.hideDatePicker = !1, this.hideQuantity = !1;
30
+ }
31
+ }
32
+ var Xt = /* @__PURE__ */ ((e) => (e.Full = "Full", e.Percentage = "Percentage", e.FirstNight = "FirstNight", e.None = "None", e))(Xt || {}), er = /* @__PURE__ */ ((e) => (e.FlatPercent = "flatPercent", e.FlatQuantity = "flatQuantity", e.FlatQuantityPerStay = "flatQuantityPerStay", e))(er || {}), nr = /* @__PURE__ */ ((e) => (e.Allowed = "Allowed", e.Blocked = "Blocked", e))(nr || {}), tr = /* @__PURE__ */ ((e) => (e.None = "None", e.Weekly = "Weekly", e.MonthlyDayOfWeek = "MonthlyDayOfWeek", e.MonthlyDate = "MonthlyDate", e.Yearly = "Yearly", e))(tr || {}), rr = /* @__PURE__ */ ((e) => (e.Eventbrite = "eventbrite", e.ATDW = "atdw", e))(rr || {});
33
+ const Fc = "DD/MM/YYYY";
34
+ var ir = /* @__PURE__ */ ((e) => (e.GET = "GET", e.POST = "POST", e.PUT = "PUT", e.DELETE = "DELETE", e.PATCH = "PATCH", e.OPTIONS = "OPTIONS", e.HEAD = "HEAD", e))(ir || {}), L = /* @__PURE__ */ ((e) => (e.PercentageOfBooking = "PercentageOfBooking", e.FixedChargePerRoom = "FixedChargePerRoom", e.NightlyChargePerRoom = "NightlyChargePerRoom", e.FixedChargePerBooking = "FixedChargePerBooking", e.DepositSurcharge = "DepositSurcharge", e))(L || {}), Ce = /* @__PURE__ */ ((e) => (e.BasketAdd = "Basket/Add", e.ViewCheckout = "View/Checkout", e.BookingCommitted = "Booking/Committed", e))(Ce || {});
35
+ function yc(e) {
36
+ return {
37
+ [Ce.BasketAdd]: "AddToCart",
38
+ [Ce.ViewCheckout]: "InitiateCheckout",
39
+ [Ce.BookingCommitted]: "Purchase"
40
+ }[e];
41
+ }
42
+ function vn(e, n) {
43
+ let t = 0;
44
+ const r = [], i = [];
45
+ for (const o of e)
46
+ t += o.totalPrice, o.roomCode && (r.push(o.roomCode), i.push({
47
+ id: o.roomCode,
48
+ quantity: 1,
49
+ item_price: o.totalPrice
50
+ }));
51
+ return {
52
+ currency: n,
53
+ value: t,
54
+ content_ids: r,
55
+ content_type: "hotel",
56
+ contents: i,
57
+ num_items: e.length
58
+ };
59
+ }
60
+ function Uc(e) {
61
+ if ("item" in e)
62
+ return vn([e.item], e.currency);
63
+ if ("items" in e)
64
+ return vn(e.items, e.currency);
65
+ throw new Error("Invalid event data");
66
+ }
67
+ function jc(e) {
68
+ return {
69
+ em: e.email,
70
+ ph: e.phone,
71
+ fn: e.firstName,
72
+ ln: e.lastName,
73
+ ct: e.city,
74
+ st: e.state,
75
+ zp: e.postalCode,
76
+ country: e.country,
77
+ external_id: e.externalId
78
+ };
79
+ }
80
+ var V = /* @__PURE__ */ ((e) => (e.PER_STAY = "Per stay", e.PER_NIGHT = "Per night", e.PER_PERSON = "Per person", e.PER_PERSON_PER_NIGHT = "Per person per night", e.PER_ALL_PERSONS = "Per all persons", e.PER_ALL_PERSONS_PER_NIGHT = "Per all persons per night", e.PER_QUANTITY_NAME_PER_NIGHT = "Per Quantity Name Per Night", e.PER_ROOM_QUANTITY_PER_NIGHT = "Per Room Quantity Per Night", e.PER_PERSON_OCCUPANCY_PER_NIGHT = "Per Person Occupancy Per Night", e.PER_ADULT_OCCUPANCY_PER_NIGHT = "Per Adult Occupancy Per Night", e.PER_CHILD_OCCUPANCY_PER_NIGHT = "Per Child Occupancy Per Night", e))(V || {});
81
+ const qn = [
82
+ V.PER_NIGHT,
83
+ V.PER_PERSON_PER_NIGHT,
84
+ V.PER_QUANTITY_NAME_PER_NIGHT,
85
+ V.PER_ROOM_QUANTITY_PER_NIGHT,
86
+ V.PER_PERSON_OCCUPANCY_PER_NIGHT,
87
+ V.PER_ADULT_OCCUPANCY_PER_NIGHT,
88
+ V.PER_CHILD_OCCUPANCY_PER_NIGHT,
89
+ V.PER_ALL_PERSONS_PER_NIGHT
90
+ ];
91
+ function d(e, n, t) {
92
+ function r(u, c) {
93
+ var a;
94
+ Object.defineProperty(u, "_zod", {
95
+ value: u._zod ?? {},
96
+ enumerable: !1
97
+ }), (a = u._zod).traits ?? (a.traits = /* @__PURE__ */ new Set()), u._zod.traits.add(e), n(u, c);
98
+ for (const l in s.prototype)
99
+ l in u || Object.defineProperty(u, l, { value: s.prototype[l].bind(u) });
100
+ u._zod.constr = s, u._zod.def = c;
101
+ }
102
+ const i = (t == null ? void 0 : t.Parent) ?? Object;
103
+ class o extends i {
104
+ }
105
+ Object.defineProperty(o, "name", { value: e });
106
+ function s(u) {
107
+ var c;
108
+ const a = t != null && t.Parent ? new o() : this;
109
+ r(a, u), (c = a._zod).deferred ?? (c.deferred = []);
110
+ for (const l of a._zod.deferred)
111
+ l();
112
+ return a;
113
+ }
114
+ return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
115
+ value: (u) => {
116
+ var c, a;
117
+ return t != null && t.Parent && u instanceof t.Parent ? !0 : (a = (c = u == null ? void 0 : u._zod) == null ? void 0 : c.traits) == null ? void 0 : a.has(e);
118
+ }
119
+ }), Object.defineProperty(s, "name", { value: e }), s;
120
+ }
121
+ class he extends Error {
122
+ constructor() {
123
+ super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
124
+ }
125
+ }
126
+ class Bn extends Error {
127
+ constructor(n) {
128
+ super(`Encountered unidirectional transform during encode: ${n}`), this.name = "ZodEncodeError";
129
+ }
130
+ }
131
+ const Ke = {};
132
+ function ue(e) {
133
+ return e && Object.assign(Ke, e), Ke;
134
+ }
135
+ function or(e) {
136
+ const n = Object.values(e).filter((r) => typeof r == "number");
137
+ return Object.entries(e).filter(([r, i]) => n.indexOf(+r) === -1).map(([r, i]) => i);
138
+ }
139
+ function Je(e, n) {
140
+ return typeof n == "bigint" ? n.toString() : n;
141
+ }
142
+ function cn(e) {
143
+ return {
144
+ get value() {
145
+ {
146
+ const n = e();
147
+ return Object.defineProperty(this, "value", { value: n }), n;
148
+ }
149
+ }
150
+ };
151
+ }
152
+ function an(e) {
153
+ return e == null;
154
+ }
155
+ function ln(e) {
156
+ const n = e.startsWith("^") ? 1 : 0, t = e.endsWith("$") ? e.length - 1 : e.length;
157
+ return e.slice(n, t);
158
+ }
159
+ function sr(e, n) {
160
+ const t = (e.toString().split(".")[1] || "").length, r = n.toString();
161
+ let i = (r.split(".")[1] || "").length;
162
+ if (i === 0 && /\d?e-\d?/.test(r)) {
163
+ const c = r.match(/\d?e-(\d?)/);
164
+ c != null && c[1] && (i = Number.parseInt(c[1]));
165
+ }
166
+ const o = t > i ? t : i, s = Number.parseInt(e.toFixed(o).replace(".", "")), u = Number.parseInt(n.toFixed(o).replace(".", ""));
167
+ return s % u / 10 ** o;
168
+ }
169
+ const wn = Symbol("evaluating");
170
+ function $(e, n, t) {
171
+ let r;
172
+ Object.defineProperty(e, n, {
173
+ get() {
174
+ if (r !== wn)
175
+ return r === void 0 && (r = wn, r = t()), r;
176
+ },
177
+ set(i) {
178
+ Object.defineProperty(e, n, {
179
+ value: i
180
+ // configurable: true,
181
+ });
182
+ },
183
+ configurable: !0
184
+ });
185
+ }
186
+ function ur(e) {
187
+ return Object.create(Object.getPrototypeOf(e), Object.getOwnPropertyDescriptors(e));
188
+ }
189
+ function ie(e, n, t) {
190
+ Object.defineProperty(e, n, {
191
+ value: t,
192
+ writable: !0,
193
+ enumerable: !0,
194
+ configurable: !0
195
+ });
196
+ }
197
+ function pe(...e) {
198
+ const n = {};
199
+ for (const t of e) {
200
+ const r = Object.getOwnPropertyDescriptors(t);
201
+ Object.assign(n, r);
202
+ }
203
+ return Object.defineProperties({}, n);
204
+ }
205
+ function kn(e) {
206
+ return JSON.stringify(e);
207
+ }
208
+ const Gn = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
209
+ };
210
+ function Re(e) {
211
+ return typeof e == "object" && e !== null && !Array.isArray(e);
212
+ }
213
+ const cr = cn(() => {
214
+ var e;
215
+ if (typeof navigator < "u" && ((e = navigator == null ? void 0 : navigator.userAgent) != null && e.includes("Cloudflare")))
216
+ return !1;
217
+ try {
218
+ const n = Function;
219
+ return new n(""), !0;
220
+ } catch {
221
+ return !1;
222
+ }
223
+ });
224
+ function ve(e) {
225
+ if (Re(e) === !1)
226
+ return !1;
227
+ const n = e.constructor;
228
+ if (n === void 0)
229
+ return !0;
230
+ const t = n.prototype;
231
+ return !(Re(t) === !1 || Object.prototype.hasOwnProperty.call(t, "isPrototypeOf") === !1);
232
+ }
233
+ function Mn(e) {
234
+ return ve(e) ? { ...e } : e;
235
+ }
236
+ const ar = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
237
+ function Le(e) {
238
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
239
+ }
240
+ function oe(e, n, t) {
241
+ const r = new e._zod.constr(n ?? e._zod.def);
242
+ return (!n || t != null && t.parent) && (r._zod.parent = e), r;
243
+ }
244
+ function _(e) {
245
+ const n = e;
246
+ if (!n)
247
+ return {};
248
+ if (typeof n == "string")
249
+ return { error: () => n };
250
+ if ((n == null ? void 0 : n.message) !== void 0) {
251
+ if ((n == null ? void 0 : n.error) !== void 0)
252
+ throw new Error("Cannot specify both `message` and `error` params");
253
+ n.error = n.message;
254
+ }
255
+ return delete n.message, typeof n.error == "string" ? { ...n, error: () => n.error } : n;
256
+ }
257
+ function lr(e) {
258
+ return Object.keys(e).filter((n) => e[n]._zod.optin === "optional" && e[n]._zod.optout === "optional");
259
+ }
260
+ const fr = {
261
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
262
+ int32: [-2147483648, 2147483647],
263
+ uint32: [0, 4294967295],
264
+ float32: [-34028234663852886e22, 34028234663852886e22],
265
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
266
+ };
267
+ function hr(e, n) {
268
+ const t = e._zod.def, r = pe(e._zod.def, {
269
+ get shape() {
270
+ const i = {};
271
+ for (const o in n) {
272
+ if (!(o in t.shape))
273
+ throw new Error(`Unrecognized key: "${o}"`);
274
+ n[o] && (i[o] = t.shape[o]);
275
+ }
276
+ return ie(this, "shape", i), i;
277
+ },
278
+ checks: []
279
+ });
280
+ return oe(e, r);
281
+ }
282
+ function dr(e, n) {
283
+ const t = e._zod.def, r = pe(e._zod.def, {
284
+ get shape() {
285
+ const i = { ...e._zod.def.shape };
286
+ for (const o in n) {
287
+ if (!(o in t.shape))
288
+ throw new Error(`Unrecognized key: "${o}"`);
289
+ n[o] && delete i[o];
290
+ }
291
+ return ie(this, "shape", i), i;
292
+ },
293
+ checks: []
294
+ });
295
+ return oe(e, r);
296
+ }
297
+ function pr(e, n) {
298
+ if (!ve(n))
299
+ throw new Error("Invalid input to extend: expected a plain object");
300
+ const t = e._zod.def.checks;
301
+ if (t && t.length > 0)
302
+ throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");
303
+ const i = pe(e._zod.def, {
304
+ get shape() {
305
+ const o = { ...e._zod.def.shape, ...n };
306
+ return ie(this, "shape", o), o;
307
+ },
308
+ checks: []
309
+ });
310
+ return oe(e, i);
311
+ }
312
+ function mr(e, n) {
313
+ if (!ve(n))
314
+ throw new Error("Invalid input to safeExtend: expected a plain object");
315
+ const t = {
316
+ ...e._zod.def,
317
+ get shape() {
318
+ const r = { ...e._zod.def.shape, ...n };
319
+ return ie(this, "shape", r), r;
320
+ },
321
+ checks: e._zod.def.checks
322
+ };
323
+ return oe(e, t);
324
+ }
325
+ function gr(e, n) {
326
+ const t = pe(e._zod.def, {
327
+ get shape() {
328
+ const r = { ...e._zod.def.shape, ...n._zod.def.shape };
329
+ return ie(this, "shape", r), r;
330
+ },
331
+ get catchall() {
332
+ return n._zod.def.catchall;
333
+ },
334
+ checks: []
335
+ // delete existing checks
336
+ });
337
+ return oe(e, t);
338
+ }
339
+ function _r(e, n, t) {
340
+ const r = pe(n._zod.def, {
341
+ get shape() {
342
+ const i = n._zod.def.shape, o = { ...i };
343
+ if (t)
344
+ for (const s in t) {
345
+ if (!(s in i))
346
+ throw new Error(`Unrecognized key: "${s}"`);
347
+ t[s] && (o[s] = e ? new e({
348
+ type: "optional",
349
+ innerType: i[s]
350
+ }) : i[s]);
351
+ }
352
+ else
353
+ for (const s in i)
354
+ o[s] = e ? new e({
355
+ type: "optional",
356
+ innerType: i[s]
357
+ }) : i[s];
358
+ return ie(this, "shape", o), o;
359
+ },
360
+ checks: []
361
+ });
362
+ return oe(n, r);
363
+ }
364
+ function vr(e, n, t) {
365
+ const r = pe(n._zod.def, {
366
+ get shape() {
367
+ const i = n._zod.def.shape, o = { ...i };
368
+ if (t)
369
+ for (const s in t) {
370
+ if (!(s in o))
371
+ throw new Error(`Unrecognized key: "${s}"`);
372
+ t[s] && (o[s] = new e({
373
+ type: "nonoptional",
374
+ innerType: i[s]
375
+ }));
376
+ }
377
+ else
378
+ for (const s in i)
379
+ o[s] = new e({
380
+ type: "nonoptional",
381
+ innerType: i[s]
382
+ });
383
+ return ie(this, "shape", o), o;
384
+ },
385
+ checks: []
386
+ });
387
+ return oe(n, r);
388
+ }
389
+ function le(e, n = 0) {
390
+ var t;
391
+ if (e.aborted === !0)
392
+ return !0;
393
+ for (let r = n; r < e.issues.length; r++)
394
+ if (((t = e.issues[r]) == null ? void 0 : t.continue) !== !0)
395
+ return !0;
396
+ return !1;
397
+ }
398
+ function Vn(e, n) {
399
+ return n.map((t) => {
400
+ var r;
401
+ return (r = t).path ?? (r.path = []), t.path.unshift(e), t;
402
+ });
403
+ }
404
+ function $e(e) {
405
+ return typeof e == "string" ? e : e == null ? void 0 : e.message;
406
+ }
407
+ function ce(e, n, t) {
408
+ var i, o, s, u, c, a;
409
+ const r = { ...e, path: e.path ?? [] };
410
+ if (!e.message) {
411
+ const l = $e((s = (o = (i = e.inst) == null ? void 0 : i._zod.def) == null ? void 0 : o.error) == null ? void 0 : s.call(o, e)) ?? $e((u = n == null ? void 0 : n.error) == null ? void 0 : u.call(n, e)) ?? $e((c = t.customError) == null ? void 0 : c.call(t, e)) ?? $e((a = t.localeError) == null ? void 0 : a.call(t, e)) ?? "Invalid input";
412
+ r.message = l;
413
+ }
414
+ return delete r.inst, delete r.continue, n != null && n.reportInput || delete r.input, r;
415
+ }
416
+ function fn(e) {
417
+ return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
418
+ }
419
+ function we(...e) {
420
+ const [n, t, r] = e;
421
+ return typeof n == "string" ? {
422
+ message: n,
423
+ code: "custom",
424
+ input: t,
425
+ inst: r
426
+ } : { ...n };
427
+ }
428
+ const Wn = (e, n) => {
429
+ e.name = "$ZodError", Object.defineProperty(e, "_zod", {
430
+ value: e._zod,
431
+ enumerable: !1
432
+ }), Object.defineProperty(e, "issues", {
433
+ value: n,
434
+ enumerable: !1
435
+ }), e.message = JSON.stringify(n, Je, 2), Object.defineProperty(e, "toString", {
436
+ value: () => e.message,
437
+ enumerable: !1
438
+ });
439
+ }, Yn = d("$ZodError", Wn), Hn = d("$ZodError", Wn, { Parent: Error });
440
+ function wr(e, n = (t) => t.message) {
441
+ const t = {}, r = [];
442
+ for (const i of e.issues)
443
+ i.path.length > 0 ? (t[i.path[0]] = t[i.path[0]] || [], t[i.path[0]].push(n(i))) : r.push(n(i));
444
+ return { formErrors: r, fieldErrors: t };
445
+ }
446
+ function kr(e, n) {
447
+ const t = n || function(o) {
448
+ return o.message;
449
+ }, r = { _errors: [] }, i = (o) => {
450
+ for (const s of o.issues)
451
+ if (s.code === "invalid_union" && s.errors.length)
452
+ s.errors.map((u) => i({ issues: u }));
453
+ else if (s.code === "invalid_key")
454
+ i({ issues: s.issues });
455
+ else if (s.code === "invalid_element")
456
+ i({ issues: s.issues });
457
+ else if (s.path.length === 0)
458
+ r._errors.push(t(s));
459
+ else {
460
+ let u = r, c = 0;
461
+ for (; c < s.path.length; ) {
462
+ const a = s.path[c];
463
+ c === s.path.length - 1 ? (u[a] = u[a] || { _errors: [] }, u[a]._errors.push(t(s))) : u[a] = u[a] || { _errors: [] }, u = u[a], c++;
464
+ }
465
+ }
466
+ };
467
+ return i(e), r;
468
+ }
469
+ const hn = (e) => (n, t, r, i) => {
470
+ const o = r ? Object.assign(r, { async: !1 }) : { async: !1 }, s = n._zod.run({ value: t, issues: [] }, o);
471
+ if (s instanceof Promise)
472
+ throw new he();
473
+ if (s.issues.length) {
474
+ const u = new ((i == null ? void 0 : i.Err) ?? e)(s.issues.map((c) => ce(c, o, ue())));
475
+ throw Gn(u, i == null ? void 0 : i.callee), u;
476
+ }
477
+ return s.value;
478
+ }, dn = (e) => async (n, t, r, i) => {
479
+ const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
480
+ let s = n._zod.run({ value: t, issues: [] }, o);
481
+ if (s instanceof Promise && (s = await s), s.issues.length) {
482
+ const u = new ((i == null ? void 0 : i.Err) ?? e)(s.issues.map((c) => ce(c, o, ue())));
483
+ throw Gn(u, i == null ? void 0 : i.callee), u;
484
+ }
485
+ return s.value;
486
+ }, Se = (e) => (n, t, r) => {
487
+ const i = r ? { ...r, async: !1 } : { async: !1 }, o = n._zod.run({ value: t, issues: [] }, i);
488
+ if (o instanceof Promise)
489
+ throw new he();
490
+ return o.issues.length ? {
491
+ success: !1,
492
+ error: new (e ?? Yn)(o.issues.map((s) => ce(s, i, ue())))
493
+ } : { success: !0, data: o.value };
494
+ }, br = /* @__PURE__ */ Se(Hn), xe = (e) => async (n, t, r) => {
495
+ const i = r ? Object.assign(r, { async: !0 }) : { async: !0 };
496
+ let o = n._zod.run({ value: t, issues: [] }, i);
497
+ return o instanceof Promise && (o = await o), o.issues.length ? {
498
+ success: !1,
499
+ error: new e(o.issues.map((s) => ce(s, i, ue())))
500
+ } : { success: !0, data: o.value };
501
+ }, Pr = /* @__PURE__ */ xe(Hn), Nr = (e) => (n, t, r) => {
502
+ const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
503
+ return hn(e)(n, t, i);
504
+ }, zr = (e) => (n, t, r) => hn(e)(n, t, r), Zr = (e) => async (n, t, r) => {
505
+ const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
506
+ return dn(e)(n, t, i);
507
+ }, $r = (e) => async (n, t, r) => dn(e)(n, t, r), Ir = (e) => (n, t, r) => {
508
+ const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
509
+ return Se(e)(n, t, i);
510
+ }, Ar = (e) => (n, t, r) => Se(e)(n, t, r), Cr = (e) => async (n, t, r) => {
511
+ const i = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
512
+ return xe(e)(n, t, i);
513
+ }, Or = (e) => async (n, t, r) => xe(e)(n, t, r), Tr = /^[cC][^\s-]{8,}$/, Er = /^[0-9a-z]+$/, Rr = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Dr = /^[0-9a-vA-V]{20}$/, Fr = /^[A-Za-z0-9]{27}$/, yr = /^[a-zA-Z0-9_-]{21}$/, Ur = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, jr = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, bn = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, Lr = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Sr = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
514
+ function xr() {
515
+ return new RegExp(Sr, "u");
516
+ }
517
+ const qr = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, Br = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/, Gr = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, Mr = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Vr = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Qn = /^[A-Za-z0-9_-]*$/, Wr = /^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/, Yr = /^\+(?:[0-9]){6,14}[0-9]$/, Kn = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))", Hr = /* @__PURE__ */ new RegExp(`^${Kn}$`);
518
+ function Jn(e) {
519
+ const n = "(?:[01]\\d|2[0-3]):[0-5]\\d";
520
+ return typeof e.precision == "number" ? e.precision === -1 ? `${n}` : e.precision === 0 ? `${n}:[0-5]\\d` : `${n}:[0-5]\\d\\.\\d{${e.precision}}` : `${n}(?::[0-5]\\d(?:\\.\\d+)?)?`;
521
+ }
522
+ function Qr(e) {
523
+ return new RegExp(`^${Jn(e)}$`);
524
+ }
525
+ function Kr(e) {
526
+ const n = Jn({ precision: e.precision }), t = ["Z"];
527
+ e.local && t.push(""), e.offset && t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
528
+ const r = `${n}(?:${t.join("|")})`;
529
+ return new RegExp(`^${Kn}T(?:${r})$`);
530
+ }
531
+ const Jr = (e) => {
532
+ const n = e ? `[\\s\\S]{${(e == null ? void 0 : e.minimum) ?? 0},${(e == null ? void 0 : e.maximum) ?? ""}}` : "[\\s\\S]*";
533
+ return new RegExp(`^${n}$`);
534
+ }, Xr = /^\d+$/, ei = /^-?\d+(?:\.\d+)?/i, ni = /true|false/i, ti = /^[^A-Z]*$/, ri = /^[^a-z]*$/, q = /* @__PURE__ */ d("$ZodCheck", (e, n) => {
535
+ var t;
536
+ e._zod ?? (e._zod = {}), e._zod.def = n, (t = e._zod).onattach ?? (t.onattach = []);
537
+ }), Xn = {
538
+ number: "number",
539
+ bigint: "bigint",
540
+ object: "date"
541
+ }, et = /* @__PURE__ */ d("$ZodCheckLessThan", (e, n) => {
542
+ q.init(e, n);
543
+ const t = Xn[typeof n.value];
544
+ e._zod.onattach.push((r) => {
545
+ const i = r._zod.bag, o = (n.inclusive ? i.maximum : i.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
546
+ n.value < o && (n.inclusive ? i.maximum = n.value : i.exclusiveMaximum = n.value);
547
+ }), e._zod.check = (r) => {
548
+ (n.inclusive ? r.value <= n.value : r.value < n.value) || r.issues.push({
549
+ origin: t,
550
+ code: "too_big",
551
+ maximum: n.value,
552
+ input: r.value,
553
+ inclusive: n.inclusive,
554
+ inst: e,
555
+ continue: !n.abort
556
+ });
557
+ };
558
+ }), nt = /* @__PURE__ */ d("$ZodCheckGreaterThan", (e, n) => {
559
+ q.init(e, n);
560
+ const t = Xn[typeof n.value];
561
+ e._zod.onattach.push((r) => {
562
+ const i = r._zod.bag, o = (n.inclusive ? i.minimum : i.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
563
+ n.value > o && (n.inclusive ? i.minimum = n.value : i.exclusiveMinimum = n.value);
564
+ }), e._zod.check = (r) => {
565
+ (n.inclusive ? r.value >= n.value : r.value > n.value) || r.issues.push({
566
+ origin: t,
567
+ code: "too_small",
568
+ minimum: n.value,
569
+ input: r.value,
570
+ inclusive: n.inclusive,
571
+ inst: e,
572
+ continue: !n.abort
573
+ });
574
+ };
575
+ }), ii = /* @__PURE__ */ d("$ZodCheckMultipleOf", (e, n) => {
576
+ q.init(e, n), e._zod.onattach.push((t) => {
577
+ var r;
578
+ (r = t._zod.bag).multipleOf ?? (r.multipleOf = n.value);
579
+ }), e._zod.check = (t) => {
580
+ if (typeof t.value != typeof n.value)
581
+ throw new Error("Cannot mix number and bigint in multiple_of check.");
582
+ (typeof t.value == "bigint" ? t.value % n.value === BigInt(0) : sr(t.value, n.value) === 0) || t.issues.push({
583
+ origin: typeof t.value,
584
+ code: "not_multiple_of",
585
+ divisor: n.value,
586
+ input: t.value,
587
+ inst: e,
588
+ continue: !n.abort
589
+ });
590
+ };
591
+ }), oi = /* @__PURE__ */ d("$ZodCheckNumberFormat", (e, n) => {
592
+ var s;
593
+ q.init(e, n), n.format = n.format || "float64";
594
+ const t = (s = n.format) == null ? void 0 : s.includes("int"), r = t ? "int" : "number", [i, o] = fr[n.format];
595
+ e._zod.onattach.push((u) => {
596
+ const c = u._zod.bag;
597
+ c.format = n.format, c.minimum = i, c.maximum = o, t && (c.pattern = Xr);
598
+ }), e._zod.check = (u) => {
599
+ const c = u.value;
600
+ if (t) {
601
+ if (!Number.isInteger(c)) {
602
+ u.issues.push({
603
+ expected: r,
604
+ format: n.format,
605
+ code: "invalid_type",
606
+ continue: !1,
607
+ input: c,
608
+ inst: e
609
+ });
610
+ return;
611
+ }
612
+ if (!Number.isSafeInteger(c)) {
613
+ c > 0 ? u.issues.push({
614
+ input: c,
615
+ code: "too_big",
616
+ maximum: Number.MAX_SAFE_INTEGER,
617
+ note: "Integers must be within the safe integer range.",
618
+ inst: e,
619
+ origin: r,
620
+ continue: !n.abort
621
+ }) : u.issues.push({
622
+ input: c,
623
+ code: "too_small",
624
+ minimum: Number.MIN_SAFE_INTEGER,
625
+ note: "Integers must be within the safe integer range.",
626
+ inst: e,
627
+ origin: r,
628
+ continue: !n.abort
629
+ });
630
+ return;
631
+ }
632
+ }
633
+ c < i && u.issues.push({
634
+ origin: "number",
635
+ input: c,
636
+ code: "too_small",
637
+ minimum: i,
638
+ inclusive: !0,
639
+ inst: e,
640
+ continue: !n.abort
641
+ }), c > o && u.issues.push({
642
+ origin: "number",
643
+ input: c,
644
+ code: "too_big",
645
+ maximum: o,
646
+ inst: e
647
+ });
648
+ };
649
+ }), si = /* @__PURE__ */ d("$ZodCheckMaxLength", (e, n) => {
650
+ var t;
651
+ q.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
652
+ const i = r.value;
653
+ return !an(i) && i.length !== void 0;
654
+ }), e._zod.onattach.push((r) => {
655
+ const i = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
656
+ n.maximum < i && (r._zod.bag.maximum = n.maximum);
657
+ }), e._zod.check = (r) => {
658
+ const i = r.value;
659
+ if (i.length <= n.maximum)
660
+ return;
661
+ const s = fn(i);
662
+ r.issues.push({
663
+ origin: s,
664
+ code: "too_big",
665
+ maximum: n.maximum,
666
+ inclusive: !0,
667
+ input: i,
668
+ inst: e,
669
+ continue: !n.abort
670
+ });
671
+ };
672
+ }), ui = /* @__PURE__ */ d("$ZodCheckMinLength", (e, n) => {
673
+ var t;
674
+ q.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
675
+ const i = r.value;
676
+ return !an(i) && i.length !== void 0;
677
+ }), e._zod.onattach.push((r) => {
678
+ const i = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
679
+ n.minimum > i && (r._zod.bag.minimum = n.minimum);
680
+ }), e._zod.check = (r) => {
681
+ const i = r.value;
682
+ if (i.length >= n.minimum)
683
+ return;
684
+ const s = fn(i);
685
+ r.issues.push({
686
+ origin: s,
687
+ code: "too_small",
688
+ minimum: n.minimum,
689
+ inclusive: !0,
690
+ input: i,
691
+ inst: e,
692
+ continue: !n.abort
693
+ });
694
+ };
695
+ }), ci = /* @__PURE__ */ d("$ZodCheckLengthEquals", (e, n) => {
696
+ var t;
697
+ q.init(e, n), (t = e._zod.def).when ?? (t.when = (r) => {
698
+ const i = r.value;
699
+ return !an(i) && i.length !== void 0;
700
+ }), e._zod.onattach.push((r) => {
701
+ const i = r._zod.bag;
702
+ i.minimum = n.length, i.maximum = n.length, i.length = n.length;
703
+ }), e._zod.check = (r) => {
704
+ const i = r.value, o = i.length;
705
+ if (o === n.length)
706
+ return;
707
+ const s = fn(i), u = o > n.length;
708
+ r.issues.push({
709
+ origin: s,
710
+ ...u ? { code: "too_big", maximum: n.length } : { code: "too_small", minimum: n.length },
711
+ inclusive: !0,
712
+ exact: !0,
713
+ input: r.value,
714
+ inst: e,
715
+ continue: !n.abort
716
+ });
717
+ };
718
+ }), qe = /* @__PURE__ */ d("$ZodCheckStringFormat", (e, n) => {
719
+ var t, r;
720
+ q.init(e, n), e._zod.onattach.push((i) => {
721
+ const o = i._zod.bag;
722
+ o.format = n.format, n.pattern && (o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n.pattern));
723
+ }), n.pattern ? (t = e._zod).check ?? (t.check = (i) => {
724
+ n.pattern.lastIndex = 0, !n.pattern.test(i.value) && i.issues.push({
725
+ origin: "string",
726
+ code: "invalid_format",
727
+ format: n.format,
728
+ input: i.value,
729
+ ...n.pattern ? { pattern: n.pattern.toString() } : {},
730
+ inst: e,
731
+ continue: !n.abort
732
+ });
733
+ }) : (r = e._zod).check ?? (r.check = () => {
734
+ });
735
+ }), ai = /* @__PURE__ */ d("$ZodCheckRegex", (e, n) => {
736
+ qe.init(e, n), e._zod.check = (t) => {
737
+ n.pattern.lastIndex = 0, !n.pattern.test(t.value) && t.issues.push({
738
+ origin: "string",
739
+ code: "invalid_format",
740
+ format: "regex",
741
+ input: t.value,
742
+ pattern: n.pattern.toString(),
743
+ inst: e,
744
+ continue: !n.abort
745
+ });
746
+ };
747
+ }), li = /* @__PURE__ */ d("$ZodCheckLowerCase", (e, n) => {
748
+ n.pattern ?? (n.pattern = ti), qe.init(e, n);
749
+ }), fi = /* @__PURE__ */ d("$ZodCheckUpperCase", (e, n) => {
750
+ n.pattern ?? (n.pattern = ri), qe.init(e, n);
751
+ }), hi = /* @__PURE__ */ d("$ZodCheckIncludes", (e, n) => {
752
+ q.init(e, n);
753
+ const t = Le(n.includes), r = new RegExp(typeof n.position == "number" ? `^.{${n.position}}${t}` : t);
754
+ n.pattern = r, e._zod.onattach.push((i) => {
755
+ const o = i._zod.bag;
756
+ o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(r);
757
+ }), e._zod.check = (i) => {
758
+ i.value.includes(n.includes, n.position) || i.issues.push({
759
+ origin: "string",
760
+ code: "invalid_format",
761
+ format: "includes",
762
+ includes: n.includes,
763
+ input: i.value,
764
+ inst: e,
765
+ continue: !n.abort
766
+ });
767
+ };
768
+ }), di = /* @__PURE__ */ d("$ZodCheckStartsWith", (e, n) => {
769
+ q.init(e, n);
770
+ const t = new RegExp(`^${Le(n.prefix)}.*`);
771
+ n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
772
+ const i = r._zod.bag;
773
+ i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(t);
774
+ }), e._zod.check = (r) => {
775
+ r.value.startsWith(n.prefix) || r.issues.push({
776
+ origin: "string",
777
+ code: "invalid_format",
778
+ format: "starts_with",
779
+ prefix: n.prefix,
780
+ input: r.value,
781
+ inst: e,
782
+ continue: !n.abort
783
+ });
784
+ };
785
+ }), pi = /* @__PURE__ */ d("$ZodCheckEndsWith", (e, n) => {
786
+ q.init(e, n);
787
+ const t = new RegExp(`.*${Le(n.suffix)}$`);
788
+ n.pattern ?? (n.pattern = t), e._zod.onattach.push((r) => {
789
+ const i = r._zod.bag;
790
+ i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(t);
791
+ }), e._zod.check = (r) => {
792
+ r.value.endsWith(n.suffix) || r.issues.push({
793
+ origin: "string",
794
+ code: "invalid_format",
795
+ format: "ends_with",
796
+ suffix: n.suffix,
797
+ input: r.value,
798
+ inst: e,
799
+ continue: !n.abort
800
+ });
801
+ };
802
+ }), mi = /* @__PURE__ */ d("$ZodCheckOverwrite", (e, n) => {
803
+ q.init(e, n), e._zod.check = (t) => {
804
+ t.value = n.tx(t.value);
805
+ };
806
+ });
807
+ class gi {
808
+ constructor(n = []) {
809
+ this.content = [], this.indent = 0, this && (this.args = n);
810
+ }
811
+ indented(n) {
812
+ this.indent += 1, n(this), this.indent -= 1;
813
+ }
814
+ write(n) {
815
+ if (typeof n == "function") {
816
+ n(this, { execution: "sync" }), n(this, { execution: "async" });
817
+ return;
818
+ }
819
+ const r = n.split(`
820
+ `).filter((s) => s), i = Math.min(...r.map((s) => s.length - s.trimStart().length)), o = r.map((s) => s.slice(i)).map((s) => " ".repeat(this.indent * 2) + s);
821
+ for (const s of o)
822
+ this.content.push(s);
823
+ }
824
+ compile() {
825
+ const n = Function, t = this == null ? void 0 : this.args, i = [...((this == null ? void 0 : this.content) ?? [""]).map((o) => ` ${o}`)];
826
+ return new n(...t, i.join(`
827
+ `));
828
+ }
829
+ }
830
+ const _i = {
831
+ major: 4,
832
+ minor: 1,
833
+ patch: 5
834
+ }, T = /* @__PURE__ */ d("$ZodType", (e, n) => {
835
+ var i;
836
+ var t;
837
+ e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = _i;
838
+ const r = [...e._zod.def.checks ?? []];
839
+ e._zod.traits.has("$ZodCheck") && r.unshift(e);
840
+ for (const o of r)
841
+ for (const s of o._zod.onattach)
842
+ s(e);
843
+ if (r.length === 0)
844
+ (t = e._zod).deferred ?? (t.deferred = []), (i = e._zod.deferred) == null || i.push(() => {
845
+ e._zod.run = e._zod.parse;
846
+ });
847
+ else {
848
+ const o = (u, c, a) => {
849
+ let l = le(u), f;
850
+ for (const h of c) {
851
+ if (h._zod.def.when) {
852
+ if (!h._zod.def.when(u))
853
+ continue;
854
+ } else if (l)
855
+ continue;
856
+ const m = u.issues.length, k = h._zod.check(u);
857
+ if (k instanceof Promise && (a == null ? void 0 : a.async) === !1)
858
+ throw new he();
859
+ if (f || k instanceof Promise)
860
+ f = (f ?? Promise.resolve()).then(async () => {
861
+ await k, u.issues.length !== m && (l || (l = le(u, m)));
862
+ });
863
+ else {
864
+ if (u.issues.length === m)
865
+ continue;
866
+ l || (l = le(u, m));
867
+ }
868
+ }
869
+ return f ? f.then(() => u) : u;
870
+ }, s = (u, c, a) => {
871
+ if (le(u))
872
+ return u.aborted = !0, u;
873
+ const l = o(c, r, a);
874
+ if (l instanceof Promise) {
875
+ if (a.async === !1)
876
+ throw new he();
877
+ return l.then((f) => e._zod.parse(f, a));
878
+ }
879
+ return e._zod.parse(l, a);
880
+ };
881
+ e._zod.run = (u, c) => {
882
+ if (c.skipChecks)
883
+ return e._zod.parse(u, c);
884
+ if (c.direction === "backward") {
885
+ const l = e._zod.parse({ value: u.value, issues: [] }, { ...c, skipChecks: !0 });
886
+ return l instanceof Promise ? l.then((f) => s(f, u, c)) : s(l, u, c);
887
+ }
888
+ const a = e._zod.parse(u, c);
889
+ if (a instanceof Promise) {
890
+ if (c.async === !1)
891
+ throw new he();
892
+ return a.then((l) => o(l, r, c));
893
+ }
894
+ return o(a, r, c);
895
+ };
896
+ }
897
+ e["~standard"] = {
898
+ validate: (o) => {
899
+ var s;
900
+ try {
901
+ const u = br(e, o);
902
+ return u.success ? { value: u.data } : { issues: (s = u.error) == null ? void 0 : s.issues };
903
+ } catch {
904
+ return Pr(e, o).then((c) => {
905
+ var a;
906
+ return c.success ? { value: c.data } : { issues: (a = c.error) == null ? void 0 : a.issues };
907
+ });
908
+ }
909
+ },
910
+ vendor: "zod",
911
+ version: 1
912
+ };
913
+ }), pn = /* @__PURE__ */ d("$ZodString", (e, n) => {
914
+ var t;
915
+ T.init(e, n), e._zod.pattern = [...((t = e == null ? void 0 : e._zod.bag) == null ? void 0 : t.patterns) ?? []].pop() ?? Jr(e._zod.bag), e._zod.parse = (r, i) => {
916
+ if (n.coerce)
917
+ try {
918
+ r.value = String(r.value);
919
+ } catch {
920
+ }
921
+ return typeof r.value == "string" || r.issues.push({
922
+ expected: "string",
923
+ code: "invalid_type",
924
+ input: r.value,
925
+ inst: e
926
+ }), r;
927
+ };
928
+ }), C = /* @__PURE__ */ d("$ZodStringFormat", (e, n) => {
929
+ qe.init(e, n), pn.init(e, n);
930
+ }), vi = /* @__PURE__ */ d("$ZodGUID", (e, n) => {
931
+ n.pattern ?? (n.pattern = jr), C.init(e, n);
932
+ }), wi = /* @__PURE__ */ d("$ZodUUID", (e, n) => {
933
+ if (n.version) {
934
+ const r = {
935
+ v1: 1,
936
+ v2: 2,
937
+ v3: 3,
938
+ v4: 4,
939
+ v5: 5,
940
+ v6: 6,
941
+ v7: 7,
942
+ v8: 8
943
+ }[n.version];
944
+ if (r === void 0)
945
+ throw new Error(`Invalid UUID version: "${n.version}"`);
946
+ n.pattern ?? (n.pattern = bn(r));
947
+ } else
948
+ n.pattern ?? (n.pattern = bn());
949
+ C.init(e, n);
950
+ }), ki = /* @__PURE__ */ d("$ZodEmail", (e, n) => {
951
+ n.pattern ?? (n.pattern = Lr), C.init(e, n);
952
+ }), bi = /* @__PURE__ */ d("$ZodURL", (e, n) => {
953
+ C.init(e, n), e._zod.check = (t) => {
954
+ try {
955
+ const r = t.value.trim(), i = new URL(r);
956
+ n.hostname && (n.hostname.lastIndex = 0, n.hostname.test(i.hostname) || t.issues.push({
957
+ code: "invalid_format",
958
+ format: "url",
959
+ note: "Invalid hostname",
960
+ pattern: Wr.source,
961
+ input: t.value,
962
+ inst: e,
963
+ continue: !n.abort
964
+ })), n.protocol && (n.protocol.lastIndex = 0, n.protocol.test(i.protocol.endsWith(":") ? i.protocol.slice(0, -1) : i.protocol) || t.issues.push({
965
+ code: "invalid_format",
966
+ format: "url",
967
+ note: "Invalid protocol",
968
+ pattern: n.protocol.source,
969
+ input: t.value,
970
+ inst: e,
971
+ continue: !n.abort
972
+ })), n.normalize ? t.value = i.href : t.value = r;
973
+ return;
974
+ } catch {
975
+ t.issues.push({
976
+ code: "invalid_format",
977
+ format: "url",
978
+ input: t.value,
979
+ inst: e,
980
+ continue: !n.abort
981
+ });
982
+ }
983
+ };
984
+ }), Pi = /* @__PURE__ */ d("$ZodEmoji", (e, n) => {
985
+ n.pattern ?? (n.pattern = xr()), C.init(e, n);
986
+ }), Ni = /* @__PURE__ */ d("$ZodNanoID", (e, n) => {
987
+ n.pattern ?? (n.pattern = yr), C.init(e, n);
988
+ }), zi = /* @__PURE__ */ d("$ZodCUID", (e, n) => {
989
+ n.pattern ?? (n.pattern = Tr), C.init(e, n);
990
+ }), Zi = /* @__PURE__ */ d("$ZodCUID2", (e, n) => {
991
+ n.pattern ?? (n.pattern = Er), C.init(e, n);
992
+ }), $i = /* @__PURE__ */ d("$ZodULID", (e, n) => {
993
+ n.pattern ?? (n.pattern = Rr), C.init(e, n);
994
+ }), Ii = /* @__PURE__ */ d("$ZodXID", (e, n) => {
995
+ n.pattern ?? (n.pattern = Dr), C.init(e, n);
996
+ }), Ai = /* @__PURE__ */ d("$ZodKSUID", (e, n) => {
997
+ n.pattern ?? (n.pattern = Fr), C.init(e, n);
998
+ }), Ci = /* @__PURE__ */ d("$ZodISODateTime", (e, n) => {
999
+ n.pattern ?? (n.pattern = Kr(n)), C.init(e, n);
1000
+ }), Oi = /* @__PURE__ */ d("$ZodISODate", (e, n) => {
1001
+ n.pattern ?? (n.pattern = Hr), C.init(e, n);
1002
+ }), Ti = /* @__PURE__ */ d("$ZodISOTime", (e, n) => {
1003
+ n.pattern ?? (n.pattern = Qr(n)), C.init(e, n);
1004
+ }), Ei = /* @__PURE__ */ d("$ZodISODuration", (e, n) => {
1005
+ n.pattern ?? (n.pattern = Ur), C.init(e, n);
1006
+ }), Ri = /* @__PURE__ */ d("$ZodIPv4", (e, n) => {
1007
+ n.pattern ?? (n.pattern = qr), C.init(e, n), e._zod.onattach.push((t) => {
1008
+ const r = t._zod.bag;
1009
+ r.format = "ipv4";
1010
+ });
1011
+ }), Di = /* @__PURE__ */ d("$ZodIPv6", (e, n) => {
1012
+ n.pattern ?? (n.pattern = Br), C.init(e, n), e._zod.onattach.push((t) => {
1013
+ const r = t._zod.bag;
1014
+ r.format = "ipv6";
1015
+ }), e._zod.check = (t) => {
1016
+ try {
1017
+ new URL(`http://[${t.value}]`);
1018
+ } catch {
1019
+ t.issues.push({
1020
+ code: "invalid_format",
1021
+ format: "ipv6",
1022
+ input: t.value,
1023
+ inst: e,
1024
+ continue: !n.abort
1025
+ });
1026
+ }
1027
+ };
1028
+ }), Fi = /* @__PURE__ */ d("$ZodCIDRv4", (e, n) => {
1029
+ n.pattern ?? (n.pattern = Gr), C.init(e, n);
1030
+ }), yi = /* @__PURE__ */ d("$ZodCIDRv6", (e, n) => {
1031
+ n.pattern ?? (n.pattern = Mr), C.init(e, n), e._zod.check = (t) => {
1032
+ const [r, i] = t.value.split("/");
1033
+ try {
1034
+ if (!i)
1035
+ throw new Error();
1036
+ const o = Number(i);
1037
+ if (`${o}` !== i)
1038
+ throw new Error();
1039
+ if (o < 0 || o > 128)
1040
+ throw new Error();
1041
+ new URL(`http://[${r}]`);
1042
+ } catch {
1043
+ t.issues.push({
1044
+ code: "invalid_format",
1045
+ format: "cidrv6",
1046
+ input: t.value,
1047
+ inst: e,
1048
+ continue: !n.abort
1049
+ });
1050
+ }
1051
+ };
1052
+ });
1053
+ function tt(e) {
1054
+ if (e === "")
1055
+ return !0;
1056
+ if (e.length % 4 !== 0)
1057
+ return !1;
1058
+ try {
1059
+ return atob(e), !0;
1060
+ } catch {
1061
+ return !1;
1062
+ }
1063
+ }
1064
+ const Ui = /* @__PURE__ */ d("$ZodBase64", (e, n) => {
1065
+ n.pattern ?? (n.pattern = Vr), C.init(e, n), e._zod.onattach.push((t) => {
1066
+ t._zod.bag.contentEncoding = "base64";
1067
+ }), e._zod.check = (t) => {
1068
+ tt(t.value) || t.issues.push({
1069
+ code: "invalid_format",
1070
+ format: "base64",
1071
+ input: t.value,
1072
+ inst: e,
1073
+ continue: !n.abort
1074
+ });
1075
+ };
1076
+ });
1077
+ function ji(e) {
1078
+ if (!Qn.test(e))
1079
+ return !1;
1080
+ const n = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), t = n.padEnd(Math.ceil(n.length / 4) * 4, "=");
1081
+ return tt(t);
1082
+ }
1083
+ const Li = /* @__PURE__ */ d("$ZodBase64URL", (e, n) => {
1084
+ n.pattern ?? (n.pattern = Qn), C.init(e, n), e._zod.onattach.push((t) => {
1085
+ t._zod.bag.contentEncoding = "base64url";
1086
+ }), e._zod.check = (t) => {
1087
+ ji(t.value) || t.issues.push({
1088
+ code: "invalid_format",
1089
+ format: "base64url",
1090
+ input: t.value,
1091
+ inst: e,
1092
+ continue: !n.abort
1093
+ });
1094
+ };
1095
+ }), Si = /* @__PURE__ */ d("$ZodE164", (e, n) => {
1096
+ n.pattern ?? (n.pattern = Yr), C.init(e, n);
1097
+ });
1098
+ function xi(e, n = null) {
1099
+ try {
1100
+ const t = e.split(".");
1101
+ if (t.length !== 3)
1102
+ return !1;
1103
+ const [r] = t;
1104
+ if (!r)
1105
+ return !1;
1106
+ const i = JSON.parse(atob(r));
1107
+ return !("typ" in i && (i == null ? void 0 : i.typ) !== "JWT" || !i.alg || n && (!("alg" in i) || i.alg !== n));
1108
+ } catch {
1109
+ return !1;
1110
+ }
1111
+ }
1112
+ const qi = /* @__PURE__ */ d("$ZodJWT", (e, n) => {
1113
+ C.init(e, n), e._zod.check = (t) => {
1114
+ xi(t.value, n.alg) || t.issues.push({
1115
+ code: "invalid_format",
1116
+ format: "jwt",
1117
+ input: t.value,
1118
+ inst: e,
1119
+ continue: !n.abort
1120
+ });
1121
+ };
1122
+ }), rt = /* @__PURE__ */ d("$ZodNumber", (e, n) => {
1123
+ T.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? ei, e._zod.parse = (t, r) => {
1124
+ if (n.coerce)
1125
+ try {
1126
+ t.value = Number(t.value);
1127
+ } catch {
1128
+ }
1129
+ const i = t.value;
1130
+ if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i))
1131
+ return t;
1132
+ const o = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : "Infinity" : void 0;
1133
+ return t.issues.push({
1134
+ expected: "number",
1135
+ code: "invalid_type",
1136
+ input: i,
1137
+ inst: e,
1138
+ ...o ? { received: o } : {}
1139
+ }), t;
1140
+ };
1141
+ }), Bi = /* @__PURE__ */ d("$ZodNumber", (e, n) => {
1142
+ oi.init(e, n), rt.init(e, n);
1143
+ }), Gi = /* @__PURE__ */ d("$ZodBoolean", (e, n) => {
1144
+ T.init(e, n), e._zod.pattern = ni, e._zod.parse = (t, r) => {
1145
+ if (n.coerce)
1146
+ try {
1147
+ t.value = !!t.value;
1148
+ } catch {
1149
+ }
1150
+ const i = t.value;
1151
+ return typeof i == "boolean" || t.issues.push({
1152
+ expected: "boolean",
1153
+ code: "invalid_type",
1154
+ input: i,
1155
+ inst: e
1156
+ }), t;
1157
+ };
1158
+ }), Mi = /* @__PURE__ */ d("$ZodUnknown", (e, n) => {
1159
+ T.init(e, n), e._zod.parse = (t) => t;
1160
+ }), Vi = /* @__PURE__ */ d("$ZodNever", (e, n) => {
1161
+ T.init(e, n), e._zod.parse = (t, r) => (t.issues.push({
1162
+ expected: "never",
1163
+ code: "invalid_type",
1164
+ input: t.value,
1165
+ inst: e
1166
+ }), t);
1167
+ }), Wi = /* @__PURE__ */ d("$ZodDate", (e, n) => {
1168
+ T.init(e, n), e._zod.parse = (t, r) => {
1169
+ if (n.coerce)
1170
+ try {
1171
+ t.value = new Date(t.value);
1172
+ } catch {
1173
+ }
1174
+ const i = t.value, o = i instanceof Date;
1175
+ return o && !Number.isNaN(i.getTime()) || t.issues.push({
1176
+ expected: "date",
1177
+ code: "invalid_type",
1178
+ input: i,
1179
+ ...o ? { received: "Invalid Date" } : {},
1180
+ inst: e
1181
+ }), t;
1182
+ };
1183
+ });
1184
+ function Pn(e, n, t) {
1185
+ e.issues.length && n.issues.push(...Vn(t, e.issues)), n.value[t] = e.value;
1186
+ }
1187
+ const Yi = /* @__PURE__ */ d("$ZodArray", (e, n) => {
1188
+ T.init(e, n), e._zod.parse = (t, r) => {
1189
+ const i = t.value;
1190
+ if (!Array.isArray(i))
1191
+ return t.issues.push({
1192
+ expected: "array",
1193
+ code: "invalid_type",
1194
+ input: i,
1195
+ inst: e
1196
+ }), t;
1197
+ t.value = Array(i.length);
1198
+ const o = [];
1199
+ for (let s = 0; s < i.length; s++) {
1200
+ const u = i[s], c = n.element._zod.run({
1201
+ value: u,
1202
+ issues: []
1203
+ }, r);
1204
+ c instanceof Promise ? o.push(c.then((a) => Pn(a, t, s))) : Pn(c, t, s);
1205
+ }
1206
+ return o.length ? Promise.all(o).then(() => t) : t;
1207
+ };
1208
+ });
1209
+ function De(e, n, t, r) {
1210
+ e.issues.length && n.issues.push(...Vn(t, e.issues)), e.value === void 0 ? t in r && (n.value[t] = void 0) : n.value[t] = e.value;
1211
+ }
1212
+ function it(e) {
1213
+ const n = Object.keys(e.shape);
1214
+ for (const r of n)
1215
+ if (!e.shape[r]._zod.traits.has("$ZodType"))
1216
+ throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
1217
+ const t = lr(e.shape);
1218
+ return {
1219
+ ...e,
1220
+ keys: n,
1221
+ keySet: new Set(n),
1222
+ numKeys: n.length,
1223
+ optionalKeys: new Set(t)
1224
+ };
1225
+ }
1226
+ function ot(e, n, t, r, i, o) {
1227
+ const s = [], u = i.keySet, c = i.catchall._zod, a = c.def.type;
1228
+ for (const l of Object.keys(n)) {
1229
+ if (u.has(l))
1230
+ continue;
1231
+ if (a === "never") {
1232
+ s.push(l);
1233
+ continue;
1234
+ }
1235
+ const f = c.run({ value: n[l], issues: [] }, r);
1236
+ f instanceof Promise ? e.push(f.then((h) => De(h, t, l, n))) : De(f, t, l, n);
1237
+ }
1238
+ return s.length && t.issues.push({
1239
+ code: "unrecognized_keys",
1240
+ keys: s,
1241
+ input: n,
1242
+ inst: o
1243
+ }), e.length ? Promise.all(e).then(() => t) : t;
1244
+ }
1245
+ const Hi = /* @__PURE__ */ d("$ZodObject", (e, n) => {
1246
+ T.init(e, n);
1247
+ const t = cn(() => it(n));
1248
+ $(e._zod, "propValues", () => {
1249
+ const s = n.shape, u = {};
1250
+ for (const c in s) {
1251
+ const a = s[c]._zod;
1252
+ if (a.values) {
1253
+ u[c] ?? (u[c] = /* @__PURE__ */ new Set());
1254
+ for (const l of a.values)
1255
+ u[c].add(l);
1256
+ }
1257
+ }
1258
+ return u;
1259
+ });
1260
+ const r = Re, i = n.catchall;
1261
+ let o;
1262
+ e._zod.parse = (s, u) => {
1263
+ o ?? (o = t.value);
1264
+ const c = s.value;
1265
+ if (!r(c))
1266
+ return s.issues.push({
1267
+ expected: "object",
1268
+ code: "invalid_type",
1269
+ input: c,
1270
+ inst: e
1271
+ }), s;
1272
+ s.value = {};
1273
+ const a = [], l = o.shape;
1274
+ for (const f of o.keys) {
1275
+ const m = l[f]._zod.run({ value: c[f], issues: [] }, u);
1276
+ m instanceof Promise ? a.push(m.then((k) => De(k, s, f, c))) : De(m, s, f, c);
1277
+ }
1278
+ return i ? ot(a, c, s, u, t.value, e) : a.length ? Promise.all(a).then(() => s) : s;
1279
+ };
1280
+ }), Qi = /* @__PURE__ */ d("$ZodObjectJIT", (e, n) => {
1281
+ Hi.init(e, n);
1282
+ const t = e._zod.parse, r = cn(() => it(n)), i = (h) => {
1283
+ const m = new gi(["shape", "payload", "ctx"]), k = r.value, w = (P) => {
1284
+ const N = kn(P);
1285
+ return `shape[${N}]._zod.run({ value: input[${N}], issues: [] }, ctx)`;
1286
+ };
1287
+ m.write("const input = payload.value;");
1288
+ const D = /* @__PURE__ */ Object.create(null);
1289
+ let I = 0;
1290
+ for (const P of k.keys)
1291
+ D[P] = `key_${I++}`;
1292
+ m.write("const newResult = {}");
1293
+ for (const P of k.keys) {
1294
+ const N = D[P], H = kn(P);
1295
+ m.write(`const ${N} = ${w(P)};`), m.write(`
1296
+ if (${N}.issues.length) {
1297
+ payload.issues = payload.issues.concat(${N}.issues.map(iss => ({
1298
+ ...iss,
1299
+ path: iss.path ? [${H}, ...iss.path] : [${H}]
1300
+ })));
1301
+ }
1302
+
1303
+ if (${N}.value === undefined) {
1304
+ if (${H} in input) {
1305
+ newResult[${H}] = undefined;
1306
+ }
1307
+ } else {
1308
+ newResult[${H}] = ${N}.value;
1309
+ }
1310
+ `);
1311
+ }
1312
+ m.write("payload.value = newResult;"), m.write("return payload;");
1313
+ const B = m.compile();
1314
+ return (P, N) => B(h, P, N);
1315
+ };
1316
+ let o;
1317
+ const s = Re, u = !Ke.jitless, a = u && cr.value, l = n.catchall;
1318
+ let f;
1319
+ e._zod.parse = (h, m) => {
1320
+ f ?? (f = r.value);
1321
+ const k = h.value;
1322
+ return s(k) ? u && a && (m == null ? void 0 : m.async) === !1 && m.jitless !== !0 ? (o || (o = i(n.shape)), h = o(h, m), l ? ot([], k, h, m, f, e) : h) : t(h, m) : (h.issues.push({
1323
+ expected: "object",
1324
+ code: "invalid_type",
1325
+ input: k,
1326
+ inst: e
1327
+ }), h);
1328
+ };
1329
+ });
1330
+ function Nn(e, n, t, r) {
1331
+ for (const o of e)
1332
+ if (o.issues.length === 0)
1333
+ return n.value = o.value, n;
1334
+ const i = e.filter((o) => !le(o));
1335
+ return i.length === 1 ? (n.value = i[0].value, i[0]) : (n.issues.push({
1336
+ code: "invalid_union",
1337
+ input: n.value,
1338
+ inst: t,
1339
+ errors: e.map((o) => o.issues.map((s) => ce(s, r, ue())))
1340
+ }), n);
1341
+ }
1342
+ const Ki = /* @__PURE__ */ d("$ZodUnion", (e, n) => {
1343
+ T.init(e, n), $(e._zod, "optin", () => n.options.some((i) => i._zod.optin === "optional") ? "optional" : void 0), $(e._zod, "optout", () => n.options.some((i) => i._zod.optout === "optional") ? "optional" : void 0), $(e._zod, "values", () => {
1344
+ if (n.options.every((i) => i._zod.values))
1345
+ return new Set(n.options.flatMap((i) => Array.from(i._zod.values)));
1346
+ }), $(e._zod, "pattern", () => {
1347
+ if (n.options.every((i) => i._zod.pattern)) {
1348
+ const i = n.options.map((o) => o._zod.pattern);
1349
+ return new RegExp(`^(${i.map((o) => ln(o.source)).join("|")})$`);
1350
+ }
1351
+ });
1352
+ const t = n.options.length === 1, r = n.options[0]._zod.run;
1353
+ e._zod.parse = (i, o) => {
1354
+ if (t)
1355
+ return r(i, o);
1356
+ let s = !1;
1357
+ const u = [];
1358
+ for (const c of n.options) {
1359
+ const a = c._zod.run({
1360
+ value: i.value,
1361
+ issues: []
1362
+ }, o);
1363
+ if (a instanceof Promise)
1364
+ u.push(a), s = !0;
1365
+ else {
1366
+ if (a.issues.length === 0)
1367
+ return a;
1368
+ u.push(a);
1369
+ }
1370
+ }
1371
+ return s ? Promise.all(u).then((c) => Nn(c, i, e, o)) : Nn(u, i, e, o);
1372
+ };
1373
+ }), Ji = /* @__PURE__ */ d("$ZodIntersection", (e, n) => {
1374
+ T.init(e, n), e._zod.parse = (t, r) => {
1375
+ const i = t.value, o = n.left._zod.run({ value: i, issues: [] }, r), s = n.right._zod.run({ value: i, issues: [] }, r);
1376
+ return o instanceof Promise || s instanceof Promise ? Promise.all([o, s]).then(([c, a]) => zn(t, c, a)) : zn(t, o, s);
1377
+ };
1378
+ });
1379
+ function Xe(e, n) {
1380
+ if (e === n)
1381
+ return { valid: !0, data: e };
1382
+ if (e instanceof Date && n instanceof Date && +e == +n)
1383
+ return { valid: !0, data: e };
1384
+ if (ve(e) && ve(n)) {
1385
+ const t = Object.keys(n), r = Object.keys(e).filter((o) => t.indexOf(o) !== -1), i = { ...e, ...n };
1386
+ for (const o of r) {
1387
+ const s = Xe(e[o], n[o]);
1388
+ if (!s.valid)
1389
+ return {
1390
+ valid: !1,
1391
+ mergeErrorPath: [o, ...s.mergeErrorPath]
1392
+ };
1393
+ i[o] = s.data;
1394
+ }
1395
+ return { valid: !0, data: i };
1396
+ }
1397
+ if (Array.isArray(e) && Array.isArray(n)) {
1398
+ if (e.length !== n.length)
1399
+ return { valid: !1, mergeErrorPath: [] };
1400
+ const t = [];
1401
+ for (let r = 0; r < e.length; r++) {
1402
+ const i = e[r], o = n[r], s = Xe(i, o);
1403
+ if (!s.valid)
1404
+ return {
1405
+ valid: !1,
1406
+ mergeErrorPath: [r, ...s.mergeErrorPath]
1407
+ };
1408
+ t.push(s.data);
1409
+ }
1410
+ return { valid: !0, data: t };
1411
+ }
1412
+ return { valid: !1, mergeErrorPath: [] };
1413
+ }
1414
+ function zn(e, n, t) {
1415
+ if (n.issues.length && e.issues.push(...n.issues), t.issues.length && e.issues.push(...t.issues), le(e))
1416
+ return e;
1417
+ const r = Xe(n.value, t.value);
1418
+ if (!r.valid)
1419
+ throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
1420
+ return e.value = r.data, e;
1421
+ }
1422
+ const Xi = /* @__PURE__ */ d("$ZodEnum", (e, n) => {
1423
+ T.init(e, n);
1424
+ const t = or(n.entries), r = new Set(t);
1425
+ e._zod.values = r, e._zod.pattern = new RegExp(`^(${t.filter((i) => ar.has(typeof i)).map((i) => typeof i == "string" ? Le(i) : i.toString()).join("|")})$`), e._zod.parse = (i, o) => {
1426
+ const s = i.value;
1427
+ return r.has(s) || i.issues.push({
1428
+ code: "invalid_value",
1429
+ values: t,
1430
+ input: s,
1431
+ inst: e
1432
+ }), i;
1433
+ };
1434
+ }), eo = /* @__PURE__ */ d("$ZodTransform", (e, n) => {
1435
+ T.init(e, n), e._zod.parse = (t, r) => {
1436
+ if (r.direction === "backward")
1437
+ throw new Bn(e.constructor.name);
1438
+ const i = n.transform(t.value, t);
1439
+ if (r.async)
1440
+ return (i instanceof Promise ? i : Promise.resolve(i)).then((s) => (t.value = s, t));
1441
+ if (i instanceof Promise)
1442
+ throw new he();
1443
+ return t.value = i, t;
1444
+ };
1445
+ });
1446
+ function Zn(e, n) {
1447
+ return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
1448
+ }
1449
+ const no = /* @__PURE__ */ d("$ZodOptional", (e, n) => {
1450
+ T.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", $(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), $(e._zod, "pattern", () => {
1451
+ const t = n.innerType._zod.pattern;
1452
+ return t ? new RegExp(`^(${ln(t.source)})?$`) : void 0;
1453
+ }), e._zod.parse = (t, r) => {
1454
+ if (n.innerType._zod.optin === "optional") {
1455
+ const i = n.innerType._zod.run(t, r);
1456
+ return i instanceof Promise ? i.then((o) => Zn(o, t.value)) : Zn(i, t.value);
1457
+ }
1458
+ return t.value === void 0 ? t : n.innerType._zod.run(t, r);
1459
+ };
1460
+ }), to = /* @__PURE__ */ d("$ZodNullable", (e, n) => {
1461
+ T.init(e, n), $(e._zod, "optin", () => n.innerType._zod.optin), $(e._zod, "optout", () => n.innerType._zod.optout), $(e._zod, "pattern", () => {
1462
+ const t = n.innerType._zod.pattern;
1463
+ return t ? new RegExp(`^(${ln(t.source)}|null)$`) : void 0;
1464
+ }), $(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, r) => t.value === null ? t : n.innerType._zod.run(t, r);
1465
+ }), ro = /* @__PURE__ */ d("$ZodDefault", (e, n) => {
1466
+ T.init(e, n), e._zod.optin = "optional", $(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1467
+ if (r.direction === "backward")
1468
+ return n.innerType._zod.run(t, r);
1469
+ if (t.value === void 0)
1470
+ return t.value = n.defaultValue, t;
1471
+ const i = n.innerType._zod.run(t, r);
1472
+ return i instanceof Promise ? i.then((o) => $n(o, n)) : $n(i, n);
1473
+ };
1474
+ });
1475
+ function $n(e, n) {
1476
+ return e.value === void 0 && (e.value = n.defaultValue), e;
1477
+ }
1478
+ const io = /* @__PURE__ */ d("$ZodPrefault", (e, n) => {
1479
+ T.init(e, n), e._zod.optin = "optional", $(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => (r.direction === "backward" || t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, r));
1480
+ }), oo = /* @__PURE__ */ d("$ZodNonOptional", (e, n) => {
1481
+ T.init(e, n), $(e._zod, "values", () => {
1482
+ const t = n.innerType._zod.values;
1483
+ return t ? new Set([...t].filter((r) => r !== void 0)) : void 0;
1484
+ }), e._zod.parse = (t, r) => {
1485
+ const i = n.innerType._zod.run(t, r);
1486
+ return i instanceof Promise ? i.then((o) => In(o, e)) : In(i, e);
1487
+ };
1488
+ });
1489
+ function In(e, n) {
1490
+ return !e.issues.length && e.value === void 0 && e.issues.push({
1491
+ code: "invalid_type",
1492
+ expected: "nonoptional",
1493
+ input: e.value,
1494
+ inst: n
1495
+ }), e;
1496
+ }
1497
+ const so = /* @__PURE__ */ d("$ZodCatch", (e, n) => {
1498
+ T.init(e, n), $(e._zod, "optin", () => n.innerType._zod.optin), $(e._zod, "optout", () => n.innerType._zod.optout), $(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, r) => {
1499
+ if (r.direction === "backward")
1500
+ return n.innerType._zod.run(t, r);
1501
+ const i = n.innerType._zod.run(t, r);
1502
+ return i instanceof Promise ? i.then((o) => (t.value = o.value, o.issues.length && (t.value = n.catchValue({
1503
+ ...t,
1504
+ error: {
1505
+ issues: o.issues.map((s) => ce(s, r, ue()))
1506
+ },
1507
+ input: t.value
1508
+ }), t.issues = []), t)) : (t.value = i.value, i.issues.length && (t.value = n.catchValue({
1509
+ ...t,
1510
+ error: {
1511
+ issues: i.issues.map((o) => ce(o, r, ue()))
1512
+ },
1513
+ input: t.value
1514
+ }), t.issues = []), t);
1515
+ };
1516
+ }), uo = /* @__PURE__ */ d("$ZodPipe", (e, n) => {
1517
+ T.init(e, n), $(e._zod, "values", () => n.in._zod.values), $(e._zod, "optin", () => n.in._zod.optin), $(e._zod, "optout", () => n.out._zod.optout), $(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, r) => {
1518
+ if (r.direction === "backward") {
1519
+ const o = n.out._zod.run(t, r);
1520
+ return o instanceof Promise ? o.then((s) => Ie(s, n.in, r)) : Ie(o, n.in, r);
1521
+ }
1522
+ const i = n.in._zod.run(t, r);
1523
+ return i instanceof Promise ? i.then((o) => Ie(o, n.out, r)) : Ie(i, n.out, r);
1524
+ };
1525
+ });
1526
+ function Ie(e, n, t) {
1527
+ return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
1528
+ }
1529
+ const co = /* @__PURE__ */ d("$ZodReadonly", (e, n) => {
1530
+ T.init(e, n), $(e._zod, "propValues", () => n.innerType._zod.propValues), $(e._zod, "values", () => n.innerType._zod.values), $(e._zod, "optin", () => n.innerType._zod.optin), $(e._zod, "optout", () => n.innerType._zod.optout), e._zod.parse = (t, r) => {
1531
+ if (r.direction === "backward")
1532
+ return n.innerType._zod.run(t, r);
1533
+ const i = n.innerType._zod.run(t, r);
1534
+ return i instanceof Promise ? i.then(An) : An(i);
1535
+ };
1536
+ });
1537
+ function An(e) {
1538
+ return e.value = Object.freeze(e.value), e;
1539
+ }
1540
+ const ao = /* @__PURE__ */ d("$ZodCustom", (e, n) => {
1541
+ q.init(e, n), T.init(e, n), e._zod.parse = (t, r) => t, e._zod.check = (t) => {
1542
+ const r = t.value, i = n.fn(r);
1543
+ if (i instanceof Promise)
1544
+ return i.then((o) => Cn(o, t, r, e));
1545
+ Cn(i, t, r, e);
1546
+ };
1547
+ });
1548
+ function Cn(e, n, t, r) {
1549
+ if (!e) {
1550
+ const i = {
1551
+ code: "custom",
1552
+ input: t,
1553
+ inst: r,
1554
+ // incorporates params.error into issue reporting
1555
+ path: [...r._zod.def.path ?? []],
1556
+ // incorporates params.error into issue reporting
1557
+ continue: !r._zod.def.abort
1558
+ // params: inst._zod.def.params,
1559
+ };
1560
+ r._zod.def.params && (i.params = r._zod.def.params), n.issues.push(we(i));
1561
+ }
1562
+ }
1563
+ class lo {
1564
+ constructor() {
1565
+ this._map = /* @__PURE__ */ new Map(), this._idmap = /* @__PURE__ */ new Map();
1566
+ }
1567
+ add(n, ...t) {
1568
+ const r = t[0];
1569
+ if (this._map.set(n, r), r && typeof r == "object" && "id" in r) {
1570
+ if (this._idmap.has(r.id))
1571
+ throw new Error(`ID ${r.id} already exists in the registry`);
1572
+ this._idmap.set(r.id, n);
1573
+ }
1574
+ return this;
1575
+ }
1576
+ clear() {
1577
+ return this._map = /* @__PURE__ */ new Map(), this._idmap = /* @__PURE__ */ new Map(), this;
1578
+ }
1579
+ remove(n) {
1580
+ const t = this._map.get(n);
1581
+ return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(n), this;
1582
+ }
1583
+ get(n) {
1584
+ const t = n._zod.parent;
1585
+ if (t) {
1586
+ const r = { ...this.get(t) ?? {} };
1587
+ delete r.id;
1588
+ const i = { ...r, ...this._map.get(n) };
1589
+ return Object.keys(i).length ? i : void 0;
1590
+ }
1591
+ return this._map.get(n);
1592
+ }
1593
+ has(n) {
1594
+ return this._map.has(n);
1595
+ }
1596
+ }
1597
+ function fo() {
1598
+ return new lo();
1599
+ }
1600
+ const Ae = /* @__PURE__ */ fo();
1601
+ function ho(e, n) {
1602
+ return new e({
1603
+ type: "string",
1604
+ ..._(n)
1605
+ });
1606
+ }
1607
+ function st(e, n) {
1608
+ return new e({
1609
+ type: "string",
1610
+ format: "email",
1611
+ check: "string_format",
1612
+ abort: !1,
1613
+ ..._(n)
1614
+ });
1615
+ }
1616
+ function On(e, n) {
1617
+ return new e({
1618
+ type: "string",
1619
+ format: "guid",
1620
+ check: "string_format",
1621
+ abort: !1,
1622
+ ..._(n)
1623
+ });
1624
+ }
1625
+ function ut(e, n) {
1626
+ return new e({
1627
+ type: "string",
1628
+ format: "uuid",
1629
+ check: "string_format",
1630
+ abort: !1,
1631
+ ..._(n)
1632
+ });
1633
+ }
1634
+ function po(e, n) {
1635
+ return new e({
1636
+ type: "string",
1637
+ format: "uuid",
1638
+ check: "string_format",
1639
+ abort: !1,
1640
+ version: "v4",
1641
+ ..._(n)
1642
+ });
1643
+ }
1644
+ function mo(e, n) {
1645
+ return new e({
1646
+ type: "string",
1647
+ format: "uuid",
1648
+ check: "string_format",
1649
+ abort: !1,
1650
+ version: "v6",
1651
+ ..._(n)
1652
+ });
1653
+ }
1654
+ function go(e, n) {
1655
+ return new e({
1656
+ type: "string",
1657
+ format: "uuid",
1658
+ check: "string_format",
1659
+ abort: !1,
1660
+ version: "v7",
1661
+ ..._(n)
1662
+ });
1663
+ }
1664
+ function _o(e, n) {
1665
+ return new e({
1666
+ type: "string",
1667
+ format: "url",
1668
+ check: "string_format",
1669
+ abort: !1,
1670
+ ..._(n)
1671
+ });
1672
+ }
1673
+ function vo(e, n) {
1674
+ return new e({
1675
+ type: "string",
1676
+ format: "emoji",
1677
+ check: "string_format",
1678
+ abort: !1,
1679
+ ..._(n)
1680
+ });
1681
+ }
1682
+ function wo(e, n) {
1683
+ return new e({
1684
+ type: "string",
1685
+ format: "nanoid",
1686
+ check: "string_format",
1687
+ abort: !1,
1688
+ ..._(n)
1689
+ });
1690
+ }
1691
+ function ko(e, n) {
1692
+ return new e({
1693
+ type: "string",
1694
+ format: "cuid",
1695
+ check: "string_format",
1696
+ abort: !1,
1697
+ ..._(n)
1698
+ });
1699
+ }
1700
+ function bo(e, n) {
1701
+ return new e({
1702
+ type: "string",
1703
+ format: "cuid2",
1704
+ check: "string_format",
1705
+ abort: !1,
1706
+ ..._(n)
1707
+ });
1708
+ }
1709
+ function Po(e, n) {
1710
+ return new e({
1711
+ type: "string",
1712
+ format: "ulid",
1713
+ check: "string_format",
1714
+ abort: !1,
1715
+ ..._(n)
1716
+ });
1717
+ }
1718
+ function No(e, n) {
1719
+ return new e({
1720
+ type: "string",
1721
+ format: "xid",
1722
+ check: "string_format",
1723
+ abort: !1,
1724
+ ..._(n)
1725
+ });
1726
+ }
1727
+ function zo(e, n) {
1728
+ return new e({
1729
+ type: "string",
1730
+ format: "ksuid",
1731
+ check: "string_format",
1732
+ abort: !1,
1733
+ ..._(n)
1734
+ });
1735
+ }
1736
+ function Zo(e, n) {
1737
+ return new e({
1738
+ type: "string",
1739
+ format: "ipv4",
1740
+ check: "string_format",
1741
+ abort: !1,
1742
+ ..._(n)
1743
+ });
1744
+ }
1745
+ function $o(e, n) {
1746
+ return new e({
1747
+ type: "string",
1748
+ format: "ipv6",
1749
+ check: "string_format",
1750
+ abort: !1,
1751
+ ..._(n)
1752
+ });
1753
+ }
1754
+ function Io(e, n) {
1755
+ return new e({
1756
+ type: "string",
1757
+ format: "cidrv4",
1758
+ check: "string_format",
1759
+ abort: !1,
1760
+ ..._(n)
1761
+ });
1762
+ }
1763
+ function Ao(e, n) {
1764
+ return new e({
1765
+ type: "string",
1766
+ format: "cidrv6",
1767
+ check: "string_format",
1768
+ abort: !1,
1769
+ ..._(n)
1770
+ });
1771
+ }
1772
+ function Co(e, n) {
1773
+ return new e({
1774
+ type: "string",
1775
+ format: "base64",
1776
+ check: "string_format",
1777
+ abort: !1,
1778
+ ..._(n)
1779
+ });
1780
+ }
1781
+ function Oo(e, n) {
1782
+ return new e({
1783
+ type: "string",
1784
+ format: "base64url",
1785
+ check: "string_format",
1786
+ abort: !1,
1787
+ ..._(n)
1788
+ });
1789
+ }
1790
+ function To(e, n) {
1791
+ return new e({
1792
+ type: "string",
1793
+ format: "e164",
1794
+ check: "string_format",
1795
+ abort: !1,
1796
+ ..._(n)
1797
+ });
1798
+ }
1799
+ function Eo(e, n) {
1800
+ return new e({
1801
+ type: "string",
1802
+ format: "jwt",
1803
+ check: "string_format",
1804
+ abort: !1,
1805
+ ..._(n)
1806
+ });
1807
+ }
1808
+ function Ro(e, n) {
1809
+ return new e({
1810
+ type: "string",
1811
+ format: "datetime",
1812
+ check: "string_format",
1813
+ offset: !1,
1814
+ local: !1,
1815
+ precision: null,
1816
+ ..._(n)
1817
+ });
1818
+ }
1819
+ function Do(e, n) {
1820
+ return new e({
1821
+ type: "string",
1822
+ format: "date",
1823
+ check: "string_format",
1824
+ ..._(n)
1825
+ });
1826
+ }
1827
+ function Fo(e, n) {
1828
+ return new e({
1829
+ type: "string",
1830
+ format: "time",
1831
+ check: "string_format",
1832
+ precision: null,
1833
+ ..._(n)
1834
+ });
1835
+ }
1836
+ function yo(e, n) {
1837
+ return new e({
1838
+ type: "string",
1839
+ format: "duration",
1840
+ check: "string_format",
1841
+ ..._(n)
1842
+ });
1843
+ }
1844
+ function Uo(e, n) {
1845
+ return new e({
1846
+ type: "number",
1847
+ checks: [],
1848
+ ..._(n)
1849
+ });
1850
+ }
1851
+ function jo(e, n) {
1852
+ return new e({
1853
+ type: "number",
1854
+ coerce: !0,
1855
+ checks: [],
1856
+ ..._(n)
1857
+ });
1858
+ }
1859
+ function Lo(e, n) {
1860
+ return new e({
1861
+ type: "number",
1862
+ check: "number_format",
1863
+ abort: !1,
1864
+ format: "safeint",
1865
+ ..._(n)
1866
+ });
1867
+ }
1868
+ function So(e, n) {
1869
+ return new e({
1870
+ type: "boolean",
1871
+ ..._(n)
1872
+ });
1873
+ }
1874
+ function xo(e) {
1875
+ return new e({
1876
+ type: "unknown"
1877
+ });
1878
+ }
1879
+ function qo(e, n) {
1880
+ return new e({
1881
+ type: "never",
1882
+ ..._(n)
1883
+ });
1884
+ }
1885
+ function Bo(e, n) {
1886
+ return new e({
1887
+ type: "date",
1888
+ ..._(n)
1889
+ });
1890
+ }
1891
+ function Tn(e, n) {
1892
+ return new et({
1893
+ check: "less_than",
1894
+ ..._(n),
1895
+ value: e,
1896
+ inclusive: !1
1897
+ });
1898
+ }
1899
+ function Oe(e, n) {
1900
+ return new et({
1901
+ check: "less_than",
1902
+ ..._(n),
1903
+ value: e,
1904
+ inclusive: !0
1905
+ });
1906
+ }
1907
+ function En(e, n) {
1908
+ return new nt({
1909
+ check: "greater_than",
1910
+ ..._(n),
1911
+ value: e,
1912
+ inclusive: !1
1913
+ });
1914
+ }
1915
+ function Te(e, n) {
1916
+ return new nt({
1917
+ check: "greater_than",
1918
+ ..._(n),
1919
+ value: e,
1920
+ inclusive: !0
1921
+ });
1922
+ }
1923
+ function Rn(e, n) {
1924
+ return new ii({
1925
+ check: "multiple_of",
1926
+ ..._(n),
1927
+ value: e
1928
+ });
1929
+ }
1930
+ function ct(e, n) {
1931
+ return new si({
1932
+ check: "max_length",
1933
+ ..._(n),
1934
+ maximum: e
1935
+ });
1936
+ }
1937
+ function Fe(e, n) {
1938
+ return new ui({
1939
+ check: "min_length",
1940
+ ..._(n),
1941
+ minimum: e
1942
+ });
1943
+ }
1944
+ function at(e, n) {
1945
+ return new ci({
1946
+ check: "length_equals",
1947
+ ..._(n),
1948
+ length: e
1949
+ });
1950
+ }
1951
+ function Go(e, n) {
1952
+ return new ai({
1953
+ check: "string_format",
1954
+ format: "regex",
1955
+ ..._(n),
1956
+ pattern: e
1957
+ });
1958
+ }
1959
+ function Mo(e) {
1960
+ return new li({
1961
+ check: "string_format",
1962
+ format: "lowercase",
1963
+ ..._(e)
1964
+ });
1965
+ }
1966
+ function Vo(e) {
1967
+ return new fi({
1968
+ check: "string_format",
1969
+ format: "uppercase",
1970
+ ..._(e)
1971
+ });
1972
+ }
1973
+ function Wo(e, n) {
1974
+ return new hi({
1975
+ check: "string_format",
1976
+ format: "includes",
1977
+ ..._(n),
1978
+ includes: e
1979
+ });
1980
+ }
1981
+ function Yo(e, n) {
1982
+ return new di({
1983
+ check: "string_format",
1984
+ format: "starts_with",
1985
+ ..._(n),
1986
+ prefix: e
1987
+ });
1988
+ }
1989
+ function Ho(e, n) {
1990
+ return new pi({
1991
+ check: "string_format",
1992
+ format: "ends_with",
1993
+ ..._(n),
1994
+ suffix: e
1995
+ });
1996
+ }
1997
+ function be(e) {
1998
+ return new mi({
1999
+ check: "overwrite",
2000
+ tx: e
2001
+ });
2002
+ }
2003
+ function Qo(e) {
2004
+ return be((n) => n.normalize(e));
2005
+ }
2006
+ function Ko() {
2007
+ return be((e) => e.trim());
2008
+ }
2009
+ function Jo() {
2010
+ return be((e) => e.toLowerCase());
2011
+ }
2012
+ function Xo() {
2013
+ return be((e) => e.toUpperCase());
2014
+ }
2015
+ function es(e, n, t) {
2016
+ return new e({
2017
+ type: "array",
2018
+ element: n,
2019
+ // get element() {
2020
+ // return element;
2021
+ // },
2022
+ ..._(t)
2023
+ });
2024
+ }
2025
+ function ns(e, n, t) {
2026
+ return new e({
2027
+ type: "custom",
2028
+ check: "custom",
2029
+ fn: n,
2030
+ ..._(t)
2031
+ });
2032
+ }
2033
+ function ts(e) {
2034
+ const n = rs((t) => (t.addIssue = (r) => {
2035
+ if (typeof r == "string")
2036
+ t.issues.push(we(r, t.value, n._zod.def));
2037
+ else {
2038
+ const i = r;
2039
+ i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = t.value), i.inst ?? (i.inst = n), i.continue ?? (i.continue = !n._zod.def.abort), t.issues.push(we(i));
2040
+ }
2041
+ }, e(t.value, t)));
2042
+ return n;
2043
+ }
2044
+ function rs(e, n) {
2045
+ const t = new q({
2046
+ check: "custom",
2047
+ ..._(n)
2048
+ });
2049
+ return t._zod.check = e, t;
2050
+ }
2051
+ const is = /* @__PURE__ */ d("ZodISODateTime", (e, n) => {
2052
+ Ci.init(e, n), O.init(e, n);
2053
+ });
2054
+ function os(e) {
2055
+ return Ro(is, e);
2056
+ }
2057
+ const ss = /* @__PURE__ */ d("ZodISODate", (e, n) => {
2058
+ Oi.init(e, n), O.init(e, n);
2059
+ });
2060
+ function us(e) {
2061
+ return Do(ss, e);
2062
+ }
2063
+ const cs = /* @__PURE__ */ d("ZodISOTime", (e, n) => {
2064
+ Ti.init(e, n), O.init(e, n);
2065
+ });
2066
+ function as(e) {
2067
+ return Fo(cs, e);
2068
+ }
2069
+ const ls = /* @__PURE__ */ d("ZodISODuration", (e, n) => {
2070
+ Ei.init(e, n), O.init(e, n);
2071
+ });
2072
+ function fs(e) {
2073
+ return yo(ls, e);
2074
+ }
2075
+ const hs = (e, n) => {
2076
+ Yn.init(e, n), e.name = "ZodError", Object.defineProperties(e, {
2077
+ format: {
2078
+ value: (t) => kr(e, t)
2079
+ // enumerable: false,
2080
+ },
2081
+ flatten: {
2082
+ value: (t) => wr(e, t)
2083
+ // enumerable: false,
2084
+ },
2085
+ addIssue: {
2086
+ value: (t) => {
2087
+ e.issues.push(t), e.message = JSON.stringify(e.issues, Je, 2);
2088
+ }
2089
+ // enumerable: false,
2090
+ },
2091
+ addIssues: {
2092
+ value: (t) => {
2093
+ e.issues.push(...t), e.message = JSON.stringify(e.issues, Je, 2);
2094
+ }
2095
+ // enumerable: false,
2096
+ },
2097
+ isEmpty: {
2098
+ get() {
2099
+ return e.issues.length === 0;
2100
+ }
2101
+ // enumerable: false,
2102
+ }
2103
+ });
2104
+ }, G = d("ZodError", hs, {
2105
+ Parent: Error
2106
+ }), ds = /* @__PURE__ */ hn(G), ps = /* @__PURE__ */ dn(G), ms = /* @__PURE__ */ Se(G), gs = /* @__PURE__ */ xe(G), _s = /* @__PURE__ */ Nr(G), vs = /* @__PURE__ */ zr(G), ws = /* @__PURE__ */ Zr(G), ks = /* @__PURE__ */ $r(G), bs = /* @__PURE__ */ Ir(G), Ps = /* @__PURE__ */ Ar(G), Ns = /* @__PURE__ */ Cr(G), zs = /* @__PURE__ */ Or(G), E = /* @__PURE__ */ d("ZodType", (e, n) => (T.init(e, n), e.def = n, e.type = n.type, Object.defineProperty(e, "_def", { value: n }), e.check = (...t) => e.clone(
2107
+ {
2108
+ ...n,
2109
+ checks: [
2110
+ ...n.checks ?? [],
2111
+ ...t.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
2112
+ ]
2113
+ }
2114
+ // { parent: true }
2115
+ ), e.clone = (t, r) => oe(e, t, r), e.brand = () => e, e.register = (t, r) => (t.add(e, r), e), e.parse = (t, r) => ds(e, t, r, { callee: e.parse }), e.safeParse = (t, r) => ms(e, t, r), e.parseAsync = async (t, r) => ps(e, t, r, { callee: e.parseAsync }), e.safeParseAsync = async (t, r) => gs(e, t, r), e.spa = e.safeParseAsync, e.encode = (t, r) => _s(e, t, r), e.decode = (t, r) => vs(e, t, r), e.encodeAsync = async (t, r) => ws(e, t, r), e.decodeAsync = async (t, r) => ks(e, t, r), e.safeEncode = (t, r) => bs(e, t, r), e.safeDecode = (t, r) => Ps(e, t, r), e.safeEncodeAsync = async (t, r) => Ns(e, t, r), e.safeDecodeAsync = async (t, r) => zs(e, t, r), e.refine = (t, r) => e.check(gu(t, r)), e.superRefine = (t) => e.check(_u(t)), e.overwrite = (t) => e.check(be(t)), e.optional = () => Un(e), e.nullable = () => jn(e), e.nullish = () => Un(jn(e)), e.nonoptional = (t) => au(e, t), e.array = () => ht(e), e.or = (t) => eu([e, t]), e.and = (t) => tu(e, t), e.transform = (t) => nn(e, pt(t)), e.default = (t) => su(e, t), e.prefault = (t) => cu(e, t), e.catch = (t) => fu(e, t), e.pipe = (t) => nn(e, t), e.readonly = () => pu(e), e.describe = (t) => {
2116
+ const r = e.clone();
2117
+ return Ae.add(r, { description: t }), r;
2118
+ }, Object.defineProperty(e, "description", {
2119
+ get() {
2120
+ var t;
2121
+ return (t = Ae.get(e)) == null ? void 0 : t.description;
2122
+ },
2123
+ configurable: !0
2124
+ }), e.meta = (...t) => {
2125
+ if (t.length === 0)
2126
+ return Ae.get(e);
2127
+ const r = e.clone();
2128
+ return Ae.add(r, t[0]), r;
2129
+ }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), lt = /* @__PURE__ */ d("_ZodString", (e, n) => {
2130
+ pn.init(e, n), E.init(e, n);
2131
+ const t = e._zod.bag;
2132
+ e.format = t.format ?? null, e.minLength = t.minimum ?? null, e.maxLength = t.maximum ?? null, e.regex = (...r) => e.check(Go(...r)), e.includes = (...r) => e.check(Wo(...r)), e.startsWith = (...r) => e.check(Yo(...r)), e.endsWith = (...r) => e.check(Ho(...r)), e.min = (...r) => e.check(Fe(...r)), e.max = (...r) => e.check(ct(...r)), e.length = (...r) => e.check(at(...r)), e.nonempty = (...r) => e.check(Fe(1, ...r)), e.lowercase = (r) => e.check(Mo(r)), e.uppercase = (r) => e.check(Vo(r)), e.trim = () => e.check(Ko()), e.normalize = (...r) => e.check(Qo(...r)), e.toLowerCase = () => e.check(Jo()), e.toUpperCase = () => e.check(Xo());
2133
+ }), Zs = /* @__PURE__ */ d("ZodString", (e, n) => {
2134
+ pn.init(e, n), lt.init(e, n), e.email = (t) => e.check(st(ft, t)), e.url = (t) => e.check(_o(Is, t)), e.jwt = (t) => e.check(Eo(qs, t)), e.emoji = (t) => e.check(vo(As, t)), e.guid = (t) => e.check(On(Dn, t)), e.uuid = (t) => e.check(ut(_e, t)), e.uuidv4 = (t) => e.check(po(_e, t)), e.uuidv6 = (t) => e.check(mo(_e, t)), e.uuidv7 = (t) => e.check(go(_e, t)), e.nanoid = (t) => e.check(wo(Cs, t)), e.guid = (t) => e.check(On(Dn, t)), e.cuid = (t) => e.check(ko(Os, t)), e.cuid2 = (t) => e.check(bo(Ts, t)), e.ulid = (t) => e.check(Po(Es, t)), e.base64 = (t) => e.check(Co(Ls, t)), e.base64url = (t) => e.check(Oo(Ss, t)), e.xid = (t) => e.check(No(Rs, t)), e.ksuid = (t) => e.check(zo(Ds, t)), e.ipv4 = (t) => e.check(Zo(Fs, t)), e.ipv6 = (t) => e.check($o(ys, t)), e.cidrv4 = (t) => e.check(Io(Us, t)), e.cidrv6 = (t) => e.check(Ao(js, t)), e.e164 = (t) => e.check(To(xs, t)), e.datetime = (t) => e.check(os(t)), e.date = (t) => e.check(us(t)), e.time = (t) => e.check(as(t)), e.duration = (t) => e.check(fs(t));
2135
+ });
2136
+ function Q(e) {
2137
+ return ho(Zs, e);
2138
+ }
2139
+ const O = /* @__PURE__ */ d("ZodStringFormat", (e, n) => {
2140
+ C.init(e, n), lt.init(e, n);
2141
+ }), ft = /* @__PURE__ */ d("ZodEmail", (e, n) => {
2142
+ ki.init(e, n), O.init(e, n);
2143
+ });
2144
+ function Be(e) {
2145
+ return st(ft, e);
2146
+ }
2147
+ const Dn = /* @__PURE__ */ d("ZodGUID", (e, n) => {
2148
+ vi.init(e, n), O.init(e, n);
2149
+ }), _e = /* @__PURE__ */ d("ZodUUID", (e, n) => {
2150
+ wi.init(e, n), O.init(e, n);
2151
+ });
2152
+ function $s(e) {
2153
+ return ut(_e, e);
2154
+ }
2155
+ const Is = /* @__PURE__ */ d("ZodURL", (e, n) => {
2156
+ bi.init(e, n), O.init(e, n);
2157
+ }), As = /* @__PURE__ */ d("ZodEmoji", (e, n) => {
2158
+ Pi.init(e, n), O.init(e, n);
2159
+ }), Cs = /* @__PURE__ */ d("ZodNanoID", (e, n) => {
2160
+ Ni.init(e, n), O.init(e, n);
2161
+ }), Os = /* @__PURE__ */ d("ZodCUID", (e, n) => {
2162
+ zi.init(e, n), O.init(e, n);
2163
+ }), Ts = /* @__PURE__ */ d("ZodCUID2", (e, n) => {
2164
+ Zi.init(e, n), O.init(e, n);
2165
+ }), Es = /* @__PURE__ */ d("ZodULID", (e, n) => {
2166
+ $i.init(e, n), O.init(e, n);
2167
+ }), Rs = /* @__PURE__ */ d("ZodXID", (e, n) => {
2168
+ Ii.init(e, n), O.init(e, n);
2169
+ }), Ds = /* @__PURE__ */ d("ZodKSUID", (e, n) => {
2170
+ Ai.init(e, n), O.init(e, n);
2171
+ }), Fs = /* @__PURE__ */ d("ZodIPv4", (e, n) => {
2172
+ Ri.init(e, n), O.init(e, n);
2173
+ }), ys = /* @__PURE__ */ d("ZodIPv6", (e, n) => {
2174
+ Di.init(e, n), O.init(e, n);
2175
+ }), Us = /* @__PURE__ */ d("ZodCIDRv4", (e, n) => {
2176
+ Fi.init(e, n), O.init(e, n);
2177
+ }), js = /* @__PURE__ */ d("ZodCIDRv6", (e, n) => {
2178
+ yi.init(e, n), O.init(e, n);
2179
+ }), Ls = /* @__PURE__ */ d("ZodBase64", (e, n) => {
2180
+ Ui.init(e, n), O.init(e, n);
2181
+ }), Ss = /* @__PURE__ */ d("ZodBase64URL", (e, n) => {
2182
+ Li.init(e, n), O.init(e, n);
2183
+ }), xs = /* @__PURE__ */ d("ZodE164", (e, n) => {
2184
+ Si.init(e, n), O.init(e, n);
2185
+ }), qs = /* @__PURE__ */ d("ZodJWT", (e, n) => {
2186
+ qi.init(e, n), O.init(e, n);
2187
+ }), mn = /* @__PURE__ */ d("ZodNumber", (e, n) => {
2188
+ rt.init(e, n), E.init(e, n), e.gt = (r, i) => e.check(En(r, i)), e.gte = (r, i) => e.check(Te(r, i)), e.min = (r, i) => e.check(Te(r, i)), e.lt = (r, i) => e.check(Tn(r, i)), e.lte = (r, i) => e.check(Oe(r, i)), e.max = (r, i) => e.check(Oe(r, i)), e.int = (r) => e.check(Fn(r)), e.safe = (r) => e.check(Fn(r)), e.positive = (r) => e.check(En(0, r)), e.nonnegative = (r) => e.check(Te(0, r)), e.negative = (r) => e.check(Tn(0, r)), e.nonpositive = (r) => e.check(Oe(0, r)), e.multipleOf = (r, i) => e.check(Rn(r, i)), e.step = (r, i) => e.check(Rn(r, i)), e.finite = () => e;
2189
+ const t = e._zod.bag;
2190
+ e.minValue = Math.max(t.minimum ?? Number.NEGATIVE_INFINITY, t.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(t.maximum ?? Number.POSITIVE_INFINITY, t.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (t.format ?? "").includes("int") || Number.isSafeInteger(t.multipleOf ?? 0.5), e.isFinite = !0, e.format = t.format ?? null;
2191
+ });
2192
+ function me(e) {
2193
+ return Uo(mn, e);
2194
+ }
2195
+ const Bs = /* @__PURE__ */ d("ZodNumberFormat", (e, n) => {
2196
+ Bi.init(e, n), mn.init(e, n);
2197
+ });
2198
+ function Fn(e) {
2199
+ return Lo(Bs, e);
2200
+ }
2201
+ const Gs = /* @__PURE__ */ d("ZodBoolean", (e, n) => {
2202
+ Gi.init(e, n), E.init(e, n);
2203
+ });
2204
+ function Ms(e) {
2205
+ return So(Gs, e);
2206
+ }
2207
+ const Vs = /* @__PURE__ */ d("ZodUnknown", (e, n) => {
2208
+ Mi.init(e, n), E.init(e, n);
2209
+ });
2210
+ function yn() {
2211
+ return xo(Vs);
2212
+ }
2213
+ const Ws = /* @__PURE__ */ d("ZodNever", (e, n) => {
2214
+ Vi.init(e, n), E.init(e, n);
2215
+ });
2216
+ function Ys(e) {
2217
+ return qo(Ws, e);
2218
+ }
2219
+ const Hs = /* @__PURE__ */ d("ZodDate", (e, n) => {
2220
+ Wi.init(e, n), E.init(e, n), e.min = (r, i) => e.check(Te(r, i)), e.max = (r, i) => e.check(Oe(r, i));
2221
+ const t = e._zod.bag;
2222
+ e.minDate = t.minimum ? new Date(t.minimum) : null, e.maxDate = t.maximum ? new Date(t.maximum) : null;
2223
+ });
2224
+ function Qs(e) {
2225
+ return Bo(Hs, e);
2226
+ }
2227
+ const Ks = /* @__PURE__ */ d("ZodArray", (e, n) => {
2228
+ Yi.init(e, n), E.init(e, n), e.element = n.element, e.min = (t, r) => e.check(Fe(t, r)), e.nonempty = (t) => e.check(Fe(1, t)), e.max = (t, r) => e.check(ct(t, r)), e.length = (t, r) => e.check(at(t, r)), e.unwrap = () => e.element;
2229
+ });
2230
+ function ht(e, n) {
2231
+ return es(Ks, e, n);
2232
+ }
2233
+ const Js = /* @__PURE__ */ d("ZodObject", (e, n) => {
2234
+ Qi.init(e, n), E.init(e, n), $(e, "shape", () => n.shape), e.keyof = () => dt(Object.keys(e._zod.def.shape)), e.catchall = (t) => e.clone({ ...e._zod.def, catchall: t }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: yn() }), e.loose = () => e.clone({ ...e._zod.def, catchall: yn() }), e.strict = () => e.clone({ ...e._zod.def, catchall: Ys() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (t) => pr(e, t), e.safeExtend = (t) => mr(e, t), e.merge = (t) => gr(e, t), e.pick = (t) => hr(e, t), e.omit = (t) => dr(e, t), e.partial = (...t) => _r(mt, e, t[0]), e.required = (...t) => vr(gt, e, t[0]);
2235
+ });
2236
+ function S(e, n) {
2237
+ const t = {
2238
+ type: "object",
2239
+ get shape() {
2240
+ return ie(this, "shape", e ? ur(e) : {}), this.shape;
2241
+ },
2242
+ ..._(n)
2243
+ };
2244
+ return new Js(t);
2245
+ }
2246
+ const Xs = /* @__PURE__ */ d("ZodUnion", (e, n) => {
2247
+ Ki.init(e, n), E.init(e, n), e.options = n.options;
2248
+ });
2249
+ function eu(e, n) {
2250
+ return new Xs({
2251
+ type: "union",
2252
+ options: e,
2253
+ ..._(n)
2254
+ });
2255
+ }
2256
+ const nu = /* @__PURE__ */ d("ZodIntersection", (e, n) => {
2257
+ Ji.init(e, n), E.init(e, n);
2258
+ });
2259
+ function tu(e, n) {
2260
+ return new nu({
2261
+ type: "intersection",
2262
+ left: e,
2263
+ right: n
2264
+ });
2265
+ }
2266
+ const en = /* @__PURE__ */ d("ZodEnum", (e, n) => {
2267
+ Xi.init(e, n), E.init(e, n), e.enum = n.entries, e.options = Object.values(n.entries);
2268
+ const t = new Set(Object.keys(n.entries));
2269
+ e.extract = (r, i) => {
2270
+ const o = {};
2271
+ for (const s of r)
2272
+ if (t.has(s))
2273
+ o[s] = n.entries[s];
2274
+ else
2275
+ throw new Error(`Key ${s} not found in enum`);
2276
+ return new en({
2277
+ ...n,
2278
+ checks: [],
2279
+ ..._(i),
2280
+ entries: o
2281
+ });
2282
+ }, e.exclude = (r, i) => {
2283
+ const o = { ...n.entries };
2284
+ for (const s of r)
2285
+ if (t.has(s))
2286
+ delete o[s];
2287
+ else
2288
+ throw new Error(`Key ${s} not found in enum`);
2289
+ return new en({
2290
+ ...n,
2291
+ checks: [],
2292
+ ..._(i),
2293
+ entries: o
2294
+ });
2295
+ };
2296
+ });
2297
+ function dt(e, n) {
2298
+ const t = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
2299
+ return new en({
2300
+ type: "enum",
2301
+ entries: t,
2302
+ ..._(n)
2303
+ });
2304
+ }
2305
+ const ru = /* @__PURE__ */ d("ZodTransform", (e, n) => {
2306
+ eo.init(e, n), E.init(e, n), e._zod.parse = (t, r) => {
2307
+ if (r.direction === "backward")
2308
+ throw new Bn(e.constructor.name);
2309
+ t.addIssue = (o) => {
2310
+ if (typeof o == "string")
2311
+ t.issues.push(we(o, t.value, n));
2312
+ else {
2313
+ const s = o;
2314
+ s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = t.value), s.inst ?? (s.inst = e), t.issues.push(we(s));
2315
+ }
2316
+ };
2317
+ const i = n.transform(t.value, t);
2318
+ return i instanceof Promise ? i.then((o) => (t.value = o, t)) : (t.value = i, t);
2319
+ };
2320
+ });
2321
+ function pt(e) {
2322
+ return new ru({
2323
+ type: "transform",
2324
+ transform: e
2325
+ });
2326
+ }
2327
+ const mt = /* @__PURE__ */ d("ZodOptional", (e, n) => {
2328
+ no.init(e, n), E.init(e, n), e.unwrap = () => e._zod.def.innerType;
2329
+ });
2330
+ function Un(e) {
2331
+ return new mt({
2332
+ type: "optional",
2333
+ innerType: e
2334
+ });
2335
+ }
2336
+ const iu = /* @__PURE__ */ d("ZodNullable", (e, n) => {
2337
+ to.init(e, n), E.init(e, n), e.unwrap = () => e._zod.def.innerType;
2338
+ });
2339
+ function jn(e) {
2340
+ return new iu({
2341
+ type: "nullable",
2342
+ innerType: e
2343
+ });
2344
+ }
2345
+ const ou = /* @__PURE__ */ d("ZodDefault", (e, n) => {
2346
+ ro.init(e, n), E.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2347
+ });
2348
+ function su(e, n) {
2349
+ return new ou({
2350
+ type: "default",
2351
+ innerType: e,
2352
+ get defaultValue() {
2353
+ return typeof n == "function" ? n() : Mn(n);
2354
+ }
2355
+ });
2356
+ }
2357
+ const uu = /* @__PURE__ */ d("ZodPrefault", (e, n) => {
2358
+ io.init(e, n), E.init(e, n), e.unwrap = () => e._zod.def.innerType;
2359
+ });
2360
+ function cu(e, n) {
2361
+ return new uu({
2362
+ type: "prefault",
2363
+ innerType: e,
2364
+ get defaultValue() {
2365
+ return typeof n == "function" ? n() : Mn(n);
2366
+ }
2367
+ });
2368
+ }
2369
+ const gt = /* @__PURE__ */ d("ZodNonOptional", (e, n) => {
2370
+ oo.init(e, n), E.init(e, n), e.unwrap = () => e._zod.def.innerType;
2371
+ });
2372
+ function au(e, n) {
2373
+ return new gt({
2374
+ type: "nonoptional",
2375
+ innerType: e,
2376
+ ..._(n)
2377
+ });
2378
+ }
2379
+ const lu = /* @__PURE__ */ d("ZodCatch", (e, n) => {
2380
+ so.init(e, n), E.init(e, n), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
2381
+ });
2382
+ function fu(e, n) {
2383
+ return new lu({
2384
+ type: "catch",
2385
+ innerType: e,
2386
+ catchValue: typeof n == "function" ? n : () => n
2387
+ });
2388
+ }
2389
+ const hu = /* @__PURE__ */ d("ZodPipe", (e, n) => {
2390
+ uo.init(e, n), E.init(e, n), e.in = n.in, e.out = n.out;
2391
+ });
2392
+ function nn(e, n) {
2393
+ return new hu({
2394
+ type: "pipe",
2395
+ in: e,
2396
+ out: n
2397
+ // ...util.normalizeParams(params),
2398
+ });
2399
+ }
2400
+ const du = /* @__PURE__ */ d("ZodReadonly", (e, n) => {
2401
+ co.init(e, n), E.init(e, n), e.unwrap = () => e._zod.def.innerType;
2402
+ });
2403
+ function pu(e) {
2404
+ return new du({
2405
+ type: "readonly",
2406
+ innerType: e
2407
+ });
2408
+ }
2409
+ const mu = /* @__PURE__ */ d("ZodCustom", (e, n) => {
2410
+ ao.init(e, n), E.init(e, n);
2411
+ });
2412
+ function gu(e, n = {}) {
2413
+ return ns(mu, e, n);
2414
+ }
2415
+ function _u(e) {
2416
+ return ts(e);
2417
+ }
2418
+ function _t(e, n) {
2419
+ return nn(pt(e), n);
2420
+ }
2421
+ function vu(e) {
2422
+ return jo(mn, e);
2423
+ }
2424
+ function Lc(e, n, t) {
2425
+ const r = n.safeParse(t);
2426
+ return r.success ? r.data : (r.error.issues.forEach((i) => {
2427
+ const o = i.path.join(".");
2428
+ e.getFieldState(o) ? e.setError(o, {
2429
+ type: "manual",
2430
+ message: i.message
2431
+ }) : e.setError("root", {
2432
+ type: "manual",
2433
+ message: i.message
2434
+ });
2435
+ }), null);
2436
+ }
2437
+ const wu = (e) => _t((n) => {
2438
+ if (n) {
2439
+ if (typeof n == "string") {
2440
+ const t = Number(n);
2441
+ return isNaN(t) ? n : t;
2442
+ }
2443
+ return n;
2444
+ }
2445
+ }, e), ku = (e) => _t((n) => {
2446
+ if (!n)
2447
+ return;
2448
+ let t;
2449
+ return typeof n == "string" && (t = new Date(n)), n instanceof Date && (t = n), t ? (t.setUTCHours(0, 0, 0, 0), t) : n;
2450
+ }, e), A = (e) => Q().min(1, { error: "Required" }).max(e, `Maximum length is ${e} characters`), vt = () => Be("Invalid email address").min(1, "Required"), Ge = () => wu(
2451
+ me("Valid amount required").positive("Positive amount required")
2452
+ ), wt = () => ku(
2453
+ Qs("Valid date required").min(/* @__PURE__ */ new Date(), "Date must be in the future")
2454
+ ), F = (e) => Q().max(e, `Maximum length is ${e} characters`), bu = S({
2455
+ address1: A(100),
2456
+ // Primary address line
2457
+ address2: F(100).optional(),
2458
+ // Secondary address line (optional)
2459
+ city: A(50),
2460
+ // City name
2461
+ state: F(50).optional(),
2462
+ // State/Province (optional for some countries)
2463
+ postcode: F(20).optional(),
2464
+ // Postal/ZIP code (optional for some countries)
2465
+ country: A(50)
2466
+ // Country name
2467
+ }), kt = S({
2468
+ amount: Ge(),
2469
+ message: F(500).nullish(),
2470
+ giverFirstName: A(50),
2471
+ giverLastName: A(50),
2472
+ giverEmail: vt(),
2473
+ giverPhone: A(31),
2474
+ giverAddress: bu,
2475
+ // Use the international address schema
2476
+ cardHolder: A(101),
2477
+ recipientFirstName: F(50).nullish(),
2478
+ recipientLastName: F(50).nullish(),
2479
+ recipientEmail: Be("Invalid email address").nullish(),
2480
+ recipientPhone: F(31).nullish()
2481
+ }), Sc = kt.extend({
2482
+ expiry: wt(),
2483
+ notes: F(500).nullish()
2484
+ }), xc = S({
2485
+ balance: Ge(),
2486
+ expiry: wt(),
2487
+ message: F(500).nullish(),
2488
+ notes: F(500).nullish(),
2489
+ giverFirstName: A(50),
2490
+ giverLastName: A(50),
2491
+ giverEmail: vt(),
2492
+ giverPhone: A(31),
2493
+ cardHolder: A(101),
2494
+ recipientEmail: Be("Invalid email address").nullish(),
2495
+ recipientPhone: F(31).nullish()
2496
+ });
2497
+ var Pu = /* @__PURE__ */ ((e) => (e.Passthrough = "Passthrough", e.PaymentProcessor = "PaymentProcessor", e))(Pu || {});
2498
+ const qc = S({
2499
+ companyId: me().int().positive(),
2500
+ amount: Ge(),
2501
+ currency: A(3).default("AUD")
2502
+ }), Nu = S({
2503
+ sessionId: A(100),
2504
+ resultCode: A(50),
2505
+ pspReference: F(100).optional()
2506
+ }), zu = S({
2507
+ cardHolder: A(100),
2508
+ cardNumberToken: F(200),
2509
+ cardCvcToken: F(200),
2510
+ cardExpiry: F(5)
2511
+ // MM/YY format
2512
+ }), Bc = kt.extend({
2513
+ companyId: me().int().positive(),
2514
+ sendViaEmail: Ms().default(!0),
2515
+ // Payment processor data (Adyen) - provided if using payment processor
2516
+ payment: Nu.optional(),
2517
+ // Passthrough payment data (VGS) - provided if using passthrough tokenization
2518
+ passthroughPayment: zu.optional()
2519
+ }), Gc = S({
2520
+ giftCardId: me().int().positive(),
2521
+ reason: F(500).optional()
2522
+ }), Zu = S({
2523
+ companyId: me().int().positive().nullish(),
2524
+ code: A(10),
2525
+ password: A(10)
2526
+ }), Mc = Zu.extend({
2527
+ amount: Ge(),
2528
+ description: A(200)
2529
+ });
2530
+ var $u = /* @__PURE__ */ ((e) => (e.Adyen = "Adyen", e))($u || {}), Iu = /* @__PURE__ */ ((e) => (e.Pending = "Pending", e.Authorized = "Authorized", e.Captured = "Captured", e.Failed = "Failed", e.Refunded = "Refunded", e))(Iu || {}), Au = /* @__PURE__ */ ((e) => (e.Authorised = "Authorised", e.Refused = "Refused", e.Cancelled = "Cancelled", e.Pending = "Pending", e.Received = "Received", e.Error = "Error", e.IdentifyShopper = "IdentifyShopper", e.ChallengeShopper = "ChallengeShopper", e))(Au || {}), Cu = /* @__PURE__ */ ((e) => (e.AUTHORISATION = "AUTHORISATION", e.CAPTURE = "CAPTURE", e.REFUND = "REFUND", e.CANCELLATION = "CANCELLATION", e.REFUND_FAILED = "REFUND_FAILED", e.CAPTURE_FAILED = "CAPTURE_FAILED", e))(Cu || {}), Ou = /* @__PURE__ */ ((e) => (e.Purchase = "Purchase", e.Redemption = "Redemption", e.Adjustment = "Adjustment", e))(Ou || {}), Tu = /* @__PURE__ */ ((e) => (e.Pending = "Pending", e.Complete = "Complete", e.Cancelled = "Cancelled", e.Expired = "Expired", e))(Tu || {});
2531
+ const Vc = S({
2532
+ code: A(10),
2533
+ token: A(128)
2534
+ }), Wc = S({
2535
+ companyId: me().int().positive(),
2536
+ code: A(10),
2537
+ token: A(128)
2538
+ }), Yc = S({
2539
+ companyId: vu().int().positive()
2540
+ }), Hc = S({
2541
+ giftCardPaymentType: dt([
2542
+ "Passthrough",
2543
+ "PaymentProcessor"
2544
+ /* PaymentProcessor */
2545
+ ])
2546
+ }), Qc = S({
2547
+ merchantAccount: A(100),
2548
+ clientKey: A(100),
2549
+ apiKey: F(200).optional(),
2550
+ webhookHmacKey: F(200).optional()
2551
+ }), Kc = S({
2552
+ grant_type: Q().readonly().default("refresh_token"),
2553
+ client_id: $s(),
2554
+ client_secret: Q(),
2555
+ refresh_token: Q(),
2556
+ scope: Q().optional()
2557
+ }), Jc = S({
2558
+ email: Be(),
2559
+ firstName: Q().max(100).optional(),
2560
+ lastName: Q().max(100).optional(),
2561
+ phone: Q().max(20).optional(),
2562
+ scopes: ht(Q()).optional()
2563
+ });
2564
+ var Eu = /* @__PURE__ */ ((e) => (e.Critical = "Critical", e.Error = "Error", e.Warn = "Warn", e.Info = "Info", e))(Eu || {}), Ru = /* @__PURE__ */ ((e) => (e.Debug = "Diagnostics", e.Security = "Security", e.Audit = "Audit", e))(Ru || {}), Du = /* @__PURE__ */ ((e) => (e.General = "General", e.Authenticated = "Token Authenticated", e.Unauthorized = "Unauthorized Access", e.RefreshToken = "Refresh Token Created", e.AccessToken = "Access Token Created", e.Revoked = "Token Revoked", e.UserCreated = "User Created", e.UserLinked = "User Linked to Company", e.Purchase = "Gift Card Purchased", e.Payment = "Payment", e.Email = "Email Delivery", e.Transaction = "Gift Card Transaction", e))(Du || {});
2565
+ const Xc = (e) => {
2566
+ let n = 0;
2567
+ const t = Object.values(e.itinerary);
2568
+ for (const r of t) {
2569
+ const i = Object.keys(r.nights);
2570
+ for (const o of i)
2571
+ n += r.nights[o].total;
2572
+ }
2573
+ return n;
2574
+ };
2575
+ /*!
2576
+ * decimal.js v10.4.3
2577
+ * An arbitrary-precision Decimal type for JavaScript.
2578
+ * https://github.com/MikeMcl/decimal.js
2579
+ * Copyright (c) 2022 Michael Mclaughlin <M8ch88l@gmail.com>
2580
+ * MIT Licence
2581
+ */
2582
+ var fe = 9e15, se = 1e9, tn = "0123456789abcdef", ye = "2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058", Ue = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789", rn = {
2583
+ // These values must be integers within the stated ranges (inclusive).
2584
+ // Most of these values can be changed at run-time using the `Decimal.config` method.
2585
+ // The maximum number of significant digits of the result of a calculation or base conversion.
2586
+ // E.g. `Decimal.config({ precision: 20 });`
2587
+ precision: 20,
2588
+ // 1 to MAX_DIGITS
2589
+ // The rounding mode used when rounding to `precision`.
2590
+ //
2591
+ // ROUND_UP 0 Away from zero.
2592
+ // ROUND_DOWN 1 Towards zero.
2593
+ // ROUND_CEIL 2 Towards +Infinity.
2594
+ // ROUND_FLOOR 3 Towards -Infinity.
2595
+ // ROUND_HALF_UP 4 Towards nearest neighbour. If equidistant, up.
2596
+ // ROUND_HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.
2597
+ // ROUND_HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.
2598
+ // ROUND_HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.
2599
+ // ROUND_HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.
2600
+ //
2601
+ // E.g.
2602
+ // `Decimal.rounding = 4;`
2603
+ // `Decimal.rounding = Decimal.ROUND_HALF_UP;`
2604
+ rounding: 4,
2605
+ // 0 to 8
2606
+ // The modulo mode used when calculating the modulus: a mod n.
2607
+ // The quotient (q = a / n) is calculated according to the corresponding rounding mode.
2608
+ // The remainder (r) is calculated as: r = a - n * q.
2609
+ //
2610
+ // UP 0 The remainder is positive if the dividend is negative, else is negative.
2611
+ // DOWN 1 The remainder has the same sign as the dividend (JavaScript %).
2612
+ // FLOOR 3 The remainder has the same sign as the divisor (Python %).
2613
+ // HALF_EVEN 6 The IEEE 754 remainder function.
2614
+ // EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)). Always positive.
2615
+ //
2616
+ // Truncated division (1), floored division (3), the IEEE 754 remainder (6), and Euclidian
2617
+ // division (9) are commonly used for the modulus operation. The other rounding modes can also
2618
+ // be used, but they may not give useful results.
2619
+ modulo: 1,
2620
+ // 0 to 9
2621
+ // The exponent value at and beneath which `toString` returns exponential notation.
2622
+ // JavaScript numbers: -7
2623
+ toExpNeg: -7,
2624
+ // 0 to -EXP_LIMIT
2625
+ // The exponent value at and above which `toString` returns exponential notation.
2626
+ // JavaScript numbers: 21
2627
+ toExpPos: 21,
2628
+ // 0 to EXP_LIMIT
2629
+ // The minimum exponent value, beneath which underflow to zero occurs.
2630
+ // JavaScript numbers: -324 (5e-324)
2631
+ minE: -fe,
2632
+ // -1 to -EXP_LIMIT
2633
+ // The maximum exponent value, above which overflow to Infinity occurs.
2634
+ // JavaScript numbers: 308 (1.7976931348623157e+308)
2635
+ maxE: fe,
2636
+ // 1 to EXP_LIMIT
2637
+ // Whether to use cryptographically-secure random number generation, if available.
2638
+ crypto: !1
2639
+ // true/false
2640
+ }, bt, X, b = !0, Me = "[DecimalError] ", te = Me + "Invalid argument: ", Pt = Me + "Precision limit exceeded", Nt = Me + "crypto unavailable", zt = "[object Decimal]", j = Math.floor, R = Math.pow, Fu = /^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i, yu = /^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i, Uu = /^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i, Zt = /^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, Y = 1e7, v = 7, ju = 9007199254740991, Lu = ye.length - 1, on = Ue.length - 1, p = { toStringTag: zt };
2641
+ p.absoluteValue = p.abs = function() {
2642
+ var e = new this.constructor(this);
2643
+ return e.s < 0 && (e.s = 1), g(e);
2644
+ };
2645
+ p.ceil = function() {
2646
+ return g(new this.constructor(this), this.e + 1, 2);
2647
+ };
2648
+ p.clampedTo = p.clamp = function(e, n) {
2649
+ var t, r = this, i = r.constructor;
2650
+ if (e = new i(e), n = new i(n), !e.s || !n.s)
2651
+ return new i(NaN);
2652
+ if (e.gt(n))
2653
+ throw Error(te + n);
2654
+ return t = r.cmp(e), t < 0 ? e : r.cmp(n) > 0 ? n : new i(r);
2655
+ };
2656
+ p.comparedTo = p.cmp = function(e) {
2657
+ var n, t, r, i, o = this, s = o.d, u = (e = new o.constructor(e)).d, c = o.s, a = e.s;
2658
+ if (!s || !u)
2659
+ return !c || !a ? NaN : c !== a ? c : s === u ? 0 : !s ^ c < 0 ? 1 : -1;
2660
+ if (!s[0] || !u[0])
2661
+ return s[0] ? c : u[0] ? -a : 0;
2662
+ if (c !== a)
2663
+ return c;
2664
+ if (o.e !== e.e)
2665
+ return o.e > e.e ^ c < 0 ? 1 : -1;
2666
+ for (r = s.length, i = u.length, n = 0, t = r < i ? r : i; n < t; ++n)
2667
+ if (s[n] !== u[n])
2668
+ return s[n] > u[n] ^ c < 0 ? 1 : -1;
2669
+ return r === i ? 0 : r > i ^ c < 0 ? 1 : -1;
2670
+ };
2671
+ p.cosine = p.cos = function() {
2672
+ var e, n, t = this, r = t.constructor;
2673
+ return t.d ? t.d[0] ? (e = r.precision, n = r.rounding, r.precision = e + Math.max(t.e, t.sd()) + v, r.rounding = 1, t = Su(r, Ot(r, t)), r.precision = e, r.rounding = n, g(X == 2 || X == 3 ? t.neg() : t, e, n, !0)) : new r(1) : new r(NaN);
2674
+ };
2675
+ p.cubeRoot = p.cbrt = function() {
2676
+ var e, n, t, r, i, o, s, u, c, a, l = this, f = l.constructor;
2677
+ if (!l.isFinite() || l.isZero())
2678
+ return new f(l);
2679
+ for (b = !1, o = l.s * R(l.s * l, 1 / 3), !o || Math.abs(o) == 1 / 0 ? (t = y(l.d), e = l.e, (o = (e - t.length + 1) % 3) && (t += o == 1 || o == -2 ? "0" : "00"), o = R(t, 1 / 3), e = j((e + 1) / 3) - (e % 3 == (e < 0 ? -1 : 2)), o == 1 / 0 ? t = "5e" + e : (t = o.toExponential(), t = t.slice(0, t.indexOf("e") + 1) + e), r = new f(t), r.s = l.s) : r = new f(o.toString()), s = (e = f.precision) + 3; ; )
2680
+ if (u = r, c = u.times(u).times(u), a = c.plus(l), r = z(a.plus(l).times(u), a.plus(c), s + 2, 1), y(u.d).slice(0, s) === (t = y(r.d)).slice(0, s))
2681
+ if (t = t.slice(s - 3, s + 1), t == "9999" || !i && t == "4999") {
2682
+ if (!i && (g(u, e + 1, 0), u.times(u).times(u).eq(l))) {
2683
+ r = u;
2684
+ break;
2685
+ }
2686
+ s += 4, i = 1;
2687
+ } else {
2688
+ (!+t || !+t.slice(1) && t.charAt(0) == "5") && (g(r, e + 1, 1), n = !r.times(r).times(r).eq(l));
2689
+ break;
2690
+ }
2691
+ return b = !0, g(r, e, f.rounding, n);
2692
+ };
2693
+ p.decimalPlaces = p.dp = function() {
2694
+ var e, n = this.d, t = NaN;
2695
+ if (n) {
2696
+ if (e = n.length - 1, t = (e - j(this.e / v)) * v, e = n[e], e)
2697
+ for (; e % 10 == 0; e /= 10)
2698
+ t--;
2699
+ t < 0 && (t = 0);
2700
+ }
2701
+ return t;
2702
+ };
2703
+ p.dividedBy = p.div = function(e) {
2704
+ return z(this, new this.constructor(e));
2705
+ };
2706
+ p.dividedToIntegerBy = p.divToInt = function(e) {
2707
+ var n = this, t = n.constructor;
2708
+ return g(z(n, new t(e), 0, 1, 1), t.precision, t.rounding);
2709
+ };
2710
+ p.equals = p.eq = function(e) {
2711
+ return this.cmp(e) === 0;
2712
+ };
2713
+ p.floor = function() {
2714
+ return g(new this.constructor(this), this.e + 1, 3);
2715
+ };
2716
+ p.greaterThan = p.gt = function(e) {
2717
+ return this.cmp(e) > 0;
2718
+ };
2719
+ p.greaterThanOrEqualTo = p.gte = function(e) {
2720
+ var n = this.cmp(e);
2721
+ return n == 1 || n === 0;
2722
+ };
2723
+ p.hyperbolicCosine = p.cosh = function() {
2724
+ var e, n, t, r, i, o = this, s = o.constructor, u = new s(1);
2725
+ if (!o.isFinite())
2726
+ return new s(o.s ? 1 / 0 : NaN);
2727
+ if (o.isZero())
2728
+ return u;
2729
+ t = s.precision, r = s.rounding, s.precision = t + Math.max(o.e, o.sd()) + 4, s.rounding = 1, i = o.d.length, i < 32 ? (e = Math.ceil(i / 3), n = (1 / We(4, e)).toString()) : (e = 16, n = "2.3283064365386962890625e-10"), o = de(s, 1, o.times(n), new s(1), !0);
2730
+ for (var c, a = e, l = new s(8); a--; )
2731
+ c = o.times(o), o = u.minus(c.times(l.minus(c.times(l))));
2732
+ return g(o, s.precision = t, s.rounding = r, !0);
2733
+ };
2734
+ p.hyperbolicSine = p.sinh = function() {
2735
+ var e, n, t, r, i = this, o = i.constructor;
2736
+ if (!i.isFinite() || i.isZero())
2737
+ return new o(i);
2738
+ if (n = o.precision, t = o.rounding, o.precision = n + Math.max(i.e, i.sd()) + 4, o.rounding = 1, r = i.d.length, r < 3)
2739
+ i = de(o, 2, i, i, !0);
2740
+ else {
2741
+ e = 1.4 * Math.sqrt(r), e = e > 16 ? 16 : e | 0, i = i.times(1 / We(5, e)), i = de(o, 2, i, i, !0);
2742
+ for (var s, u = new o(5), c = new o(16), a = new o(20); e--; )
2743
+ s = i.times(i), i = i.times(u.plus(s.times(c.times(s).plus(a))));
2744
+ }
2745
+ return o.precision = n, o.rounding = t, g(i, n, t, !0);
2746
+ };
2747
+ p.hyperbolicTangent = p.tanh = function() {
2748
+ var e, n, t = this, r = t.constructor;
2749
+ return t.isFinite() ? t.isZero() ? new r(t) : (e = r.precision, n = r.rounding, r.precision = e + 7, r.rounding = 1, z(t.sinh(), t.cosh(), r.precision = e, r.rounding = n)) : new r(t.s);
2750
+ };
2751
+ p.inverseCosine = p.acos = function() {
2752
+ var e, n = this, t = n.constructor, r = n.abs().cmp(1), i = t.precision, o = t.rounding;
2753
+ return r !== -1 ? r === 0 ? n.isNeg() ? W(t, i, o) : new t(0) : new t(NaN) : n.isZero() ? W(t, i + 4, o).times(0.5) : (t.precision = i + 6, t.rounding = 1, n = n.asin(), e = W(t, i + 4, o).times(0.5), t.precision = i, t.rounding = o, e.minus(n));
2754
+ };
2755
+ p.inverseHyperbolicCosine = p.acosh = function() {
2756
+ var e, n, t = this, r = t.constructor;
2757
+ return t.lte(1) ? new r(t.eq(1) ? 0 : NaN) : t.isFinite() ? (e = r.precision, n = r.rounding, r.precision = e + Math.max(Math.abs(t.e), t.sd()) + 4, r.rounding = 1, b = !1, t = t.times(t).minus(1).sqrt().plus(t), b = !0, r.precision = e, r.rounding = n, t.ln()) : new r(t);
2758
+ };
2759
+ p.inverseHyperbolicSine = p.asinh = function() {
2760
+ var e, n, t = this, r = t.constructor;
2761
+ return !t.isFinite() || t.isZero() ? new r(t) : (e = r.precision, n = r.rounding, r.precision = e + 2 * Math.max(Math.abs(t.e), t.sd()) + 6, r.rounding = 1, b = !1, t = t.times(t).plus(1).sqrt().plus(t), b = !0, r.precision = e, r.rounding = n, t.ln());
2762
+ };
2763
+ p.inverseHyperbolicTangent = p.atanh = function() {
2764
+ var e, n, t, r, i = this, o = i.constructor;
2765
+ return i.isFinite() ? i.e >= 0 ? new o(i.abs().eq(1) ? i.s / 0 : i.isZero() ? i : NaN) : (e = o.precision, n = o.rounding, r = i.sd(), Math.max(r, e) < 2 * -i.e - 1 ? g(new o(i), e, n, !0) : (o.precision = t = r - i.e, i = z(i.plus(1), new o(1).minus(i), t + e, 1), o.precision = e + 4, o.rounding = 1, i = i.ln(), o.precision = e, o.rounding = n, i.times(0.5))) : new o(NaN);
2766
+ };
2767
+ p.inverseSine = p.asin = function() {
2768
+ var e, n, t, r, i = this, o = i.constructor;
2769
+ return i.isZero() ? new o(i) : (n = i.abs().cmp(1), t = o.precision, r = o.rounding, n !== -1 ? n === 0 ? (e = W(o, t + 4, r).times(0.5), e.s = i.s, e) : new o(NaN) : (o.precision = t + 6, o.rounding = 1, i = i.div(new o(1).minus(i.times(i)).sqrt().plus(1)).atan(), o.precision = t, o.rounding = r, i.times(2)));
2770
+ };
2771
+ p.inverseTangent = p.atan = function() {
2772
+ var e, n, t, r, i, o, s, u, c, a = this, l = a.constructor, f = l.precision, h = l.rounding;
2773
+ if (a.isFinite()) {
2774
+ if (a.isZero())
2775
+ return new l(a);
2776
+ if (a.abs().eq(1) && f + 4 <= on)
2777
+ return s = W(l, f + 4, h).times(0.25), s.s = a.s, s;
2778
+ } else {
2779
+ if (!a.s)
2780
+ return new l(NaN);
2781
+ if (f + 4 <= on)
2782
+ return s = W(l, f + 4, h).times(0.5), s.s = a.s, s;
2783
+ }
2784
+ for (l.precision = u = f + 10, l.rounding = 1, t = Math.min(28, u / v + 2 | 0), e = t; e; --e)
2785
+ a = a.div(a.times(a).plus(1).sqrt().plus(1));
2786
+ for (b = !1, n = Math.ceil(u / v), r = 1, c = a.times(a), s = new l(a), i = a; e !== -1; )
2787
+ if (i = i.times(c), o = s.minus(i.div(r += 2)), i = i.times(c), s = o.plus(i.div(r += 2)), s.d[n] !== void 0)
2788
+ for (e = n; s.d[e] === o.d[e] && e--; )
2789
+ ;
2790
+ return t && (s = s.times(2 << t - 1)), b = !0, g(s, l.precision = f, l.rounding = h, !0);
2791
+ };
2792
+ p.isFinite = function() {
2793
+ return !!this.d;
2794
+ };
2795
+ p.isInteger = p.isInt = function() {
2796
+ return !!this.d && j(this.e / v) > this.d.length - 2;
2797
+ };
2798
+ p.isNaN = function() {
2799
+ return !this.s;
2800
+ };
2801
+ p.isNegative = p.isNeg = function() {
2802
+ return this.s < 0;
2803
+ };
2804
+ p.isPositive = p.isPos = function() {
2805
+ return this.s > 0;
2806
+ };
2807
+ p.isZero = function() {
2808
+ return !!this.d && this.d[0] === 0;
2809
+ };
2810
+ p.lessThan = p.lt = function(e) {
2811
+ return this.cmp(e) < 0;
2812
+ };
2813
+ p.lessThanOrEqualTo = p.lte = function(e) {
2814
+ return this.cmp(e) < 1;
2815
+ };
2816
+ p.logarithm = p.log = function(e) {
2817
+ var n, t, r, i, o, s, u, c, a = this, l = a.constructor, f = l.precision, h = l.rounding, m = 5;
2818
+ if (e == null)
2819
+ e = new l(10), n = !0;
2820
+ else {
2821
+ if (e = new l(e), t = e.d, e.s < 0 || !t || !t[0] || e.eq(1))
2822
+ return new l(NaN);
2823
+ n = e.eq(10);
2824
+ }
2825
+ if (t = a.d, a.s < 0 || !t || !t[0] || a.eq(1))
2826
+ return new l(t && !t[0] ? -1 / 0 : a.s != 1 ? NaN : t ? 0 : 1 / 0);
2827
+ if (n)
2828
+ if (t.length > 1)
2829
+ o = !0;
2830
+ else {
2831
+ for (i = t[0]; i % 10 === 0; )
2832
+ i /= 10;
2833
+ o = i !== 1;
2834
+ }
2835
+ if (b = !1, u = f + m, s = ne(a, u), r = n ? je(l, u + 10) : ne(e, u), c = z(s, r, u, 1), ke(c.d, i = f, h))
2836
+ do
2837
+ if (u += 10, s = ne(a, u), r = n ? je(l, u + 10) : ne(e, u), c = z(s, r, u, 1), !o) {
2838
+ +y(c.d).slice(i + 1, i + 15) + 1 == 1e14 && (c = g(c, f + 1, 0));
2839
+ break;
2840
+ }
2841
+ while (ke(c.d, i += 10, h));
2842
+ return b = !0, g(c, f, h);
2843
+ };
2844
+ p.minus = p.sub = function(e) {
2845
+ var n, t, r, i, o, s, u, c, a, l, f, h, m = this, k = m.constructor;
2846
+ if (e = new k(e), !m.d || !e.d)
2847
+ return !m.s || !e.s ? e = new k(NaN) : m.d ? e.s = -e.s : e = new k(e.d || m.s !== e.s ? m : NaN), e;
2848
+ if (m.s != e.s)
2849
+ return e.s = -e.s, m.plus(e);
2850
+ if (a = m.d, h = e.d, u = k.precision, c = k.rounding, !a[0] || !h[0]) {
2851
+ if (h[0])
2852
+ e.s = -e.s;
2853
+ else if (a[0])
2854
+ e = new k(m);
2855
+ else
2856
+ return new k(c === 3 ? -0 : 0);
2857
+ return b ? g(e, u, c) : e;
2858
+ }
2859
+ if (t = j(e.e / v), l = j(m.e / v), a = a.slice(), o = l - t, o) {
2860
+ for (f = o < 0, f ? (n = a, o = -o, s = h.length) : (n = h, t = l, s = a.length), r = Math.max(Math.ceil(u / v), s) + 2, o > r && (o = r, n.length = 1), n.reverse(), r = o; r--; )
2861
+ n.push(0);
2862
+ n.reverse();
2863
+ } else {
2864
+ for (r = a.length, s = h.length, f = r < s, f && (s = r), r = 0; r < s; r++)
2865
+ if (a[r] != h[r]) {
2866
+ f = a[r] < h[r];
2867
+ break;
2868
+ }
2869
+ o = 0;
2870
+ }
2871
+ for (f && (n = a, a = h, h = n, e.s = -e.s), s = a.length, r = h.length - s; r > 0; --r)
2872
+ a[s++] = 0;
2873
+ for (r = h.length; r > o; ) {
2874
+ if (a[--r] < h[r]) {
2875
+ for (i = r; i && a[--i] === 0; )
2876
+ a[i] = Y - 1;
2877
+ --a[i], a[r] += Y;
2878
+ }
2879
+ a[r] -= h[r];
2880
+ }
2881
+ for (; a[--s] === 0; )
2882
+ a.pop();
2883
+ for (; a[0] === 0; a.shift())
2884
+ --t;
2885
+ return a[0] ? (e.d = a, e.e = Ve(a, t), b ? g(e, u, c) : e) : new k(c === 3 ? -0 : 0);
2886
+ };
2887
+ p.modulo = p.mod = function(e) {
2888
+ var n, t = this, r = t.constructor;
2889
+ return e = new r(e), !t.d || !e.s || e.d && !e.d[0] ? new r(NaN) : !e.d || t.d && !t.d[0] ? g(new r(t), r.precision, r.rounding) : (b = !1, r.modulo == 9 ? (n = z(t, e.abs(), 0, 3, 1), n.s *= e.s) : n = z(t, e, 0, r.modulo, 1), n = n.times(e), b = !0, t.minus(n));
2890
+ };
2891
+ p.naturalExponential = p.exp = function() {
2892
+ return sn(this);
2893
+ };
2894
+ p.naturalLogarithm = p.ln = function() {
2895
+ return ne(this);
2896
+ };
2897
+ p.negated = p.neg = function() {
2898
+ var e = new this.constructor(this);
2899
+ return e.s = -e.s, g(e);
2900
+ };
2901
+ p.plus = p.add = function(e) {
2902
+ var n, t, r, i, o, s, u, c, a, l, f = this, h = f.constructor;
2903
+ if (e = new h(e), !f.d || !e.d)
2904
+ return !f.s || !e.s ? e = new h(NaN) : f.d || (e = new h(e.d || f.s === e.s ? f : NaN)), e;
2905
+ if (f.s != e.s)
2906
+ return e.s = -e.s, f.minus(e);
2907
+ if (a = f.d, l = e.d, u = h.precision, c = h.rounding, !a[0] || !l[0])
2908
+ return l[0] || (e = new h(f)), b ? g(e, u, c) : e;
2909
+ if (o = j(f.e / v), r = j(e.e / v), a = a.slice(), i = o - r, i) {
2910
+ for (i < 0 ? (t = a, i = -i, s = l.length) : (t = l, r = o, s = a.length), o = Math.ceil(u / v), s = o > s ? o + 1 : s + 1, i > s && (i = s, t.length = 1), t.reverse(); i--; )
2911
+ t.push(0);
2912
+ t.reverse();
2913
+ }
2914
+ for (s = a.length, i = l.length, s - i < 0 && (i = s, t = l, l = a, a = t), n = 0; i; )
2915
+ n = (a[--i] = a[i] + l[i] + n) / Y | 0, a[i] %= Y;
2916
+ for (n && (a.unshift(n), ++r), s = a.length; a[--s] == 0; )
2917
+ a.pop();
2918
+ return e.d = a, e.e = Ve(a, r), b ? g(e, u, c) : e;
2919
+ };
2920
+ p.precision = p.sd = function(e) {
2921
+ var n, t = this;
2922
+ if (e !== void 0 && e !== !!e && e !== 1 && e !== 0)
2923
+ throw Error(te + e);
2924
+ return t.d ? (n = $t(t.d), e && t.e + 1 > n && (n = t.e + 1)) : n = NaN, n;
2925
+ };
2926
+ p.round = function() {
2927
+ var e = this, n = e.constructor;
2928
+ return g(new n(e), e.e + 1, n.rounding);
2929
+ };
2930
+ p.sine = p.sin = function() {
2931
+ var e, n, t = this, r = t.constructor;
2932
+ return t.isFinite() ? t.isZero() ? new r(t) : (e = r.precision, n = r.rounding, r.precision = e + Math.max(t.e, t.sd()) + v, r.rounding = 1, t = qu(r, Ot(r, t)), r.precision = e, r.rounding = n, g(X > 2 ? t.neg() : t, e, n, !0)) : new r(NaN);
2933
+ };
2934
+ p.squareRoot = p.sqrt = function() {
2935
+ var e, n, t, r, i, o, s = this, u = s.d, c = s.e, a = s.s, l = s.constructor;
2936
+ if (a !== 1 || !u || !u[0])
2937
+ return new l(!a || a < 0 && (!u || u[0]) ? NaN : u ? s : 1 / 0);
2938
+ for (b = !1, a = Math.sqrt(+s), a == 0 || a == 1 / 0 ? (n = y(u), (n.length + c) % 2 == 0 && (n += "0"), a = Math.sqrt(n), c = j((c + 1) / 2) - (c < 0 || c % 2), a == 1 / 0 ? n = "5e" + c : (n = a.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + c), r = new l(n)) : r = new l(a.toString()), t = (c = l.precision) + 3; ; )
2939
+ if (o = r, r = o.plus(z(s, o, t + 2, 1)).times(0.5), y(o.d).slice(0, t) === (n = y(r.d)).slice(0, t))
2940
+ if (n = n.slice(t - 3, t + 1), n == "9999" || !i && n == "4999") {
2941
+ if (!i && (g(o, c + 1, 0), o.times(o).eq(s))) {
2942
+ r = o;
2943
+ break;
2944
+ }
2945
+ t += 4, i = 1;
2946
+ } else {
2947
+ (!+n || !+n.slice(1) && n.charAt(0) == "5") && (g(r, c + 1, 1), e = !r.times(r).eq(s));
2948
+ break;
2949
+ }
2950
+ return b = !0, g(r, c, l.rounding, e);
2951
+ };
2952
+ p.tangent = p.tan = function() {
2953
+ var e, n, t = this, r = t.constructor;
2954
+ return t.isFinite() ? t.isZero() ? new r(t) : (e = r.precision, n = r.rounding, r.precision = e + 10, r.rounding = 1, t = t.sin(), t.s = 1, t = z(t, new r(1).minus(t.times(t)).sqrt(), e + 10, 0), r.precision = e, r.rounding = n, g(X == 2 || X == 4 ? t.neg() : t, e, n, !0)) : new r(NaN);
2955
+ };
2956
+ p.times = p.mul = function(e) {
2957
+ var n, t, r, i, o, s, u, c, a, l = this, f = l.constructor, h = l.d, m = (e = new f(e)).d;
2958
+ if (e.s *= l.s, !h || !h[0] || !m || !m[0])
2959
+ return new f(!e.s || h && !h[0] && !m || m && !m[0] && !h ? NaN : !h || !m ? e.s / 0 : e.s * 0);
2960
+ for (t = j(l.e / v) + j(e.e / v), c = h.length, a = m.length, c < a && (o = h, h = m, m = o, s = c, c = a, a = s), o = [], s = c + a, r = s; r--; )
2961
+ o.push(0);
2962
+ for (r = a; --r >= 0; ) {
2963
+ for (n = 0, i = c + r; i > r; )
2964
+ u = o[i] + m[r] * h[i - r - 1] + n, o[i--] = u % Y | 0, n = u / Y | 0;
2965
+ o[i] = (o[i] + n) % Y | 0;
2966
+ }
2967
+ for (; !o[--s]; )
2968
+ o.pop();
2969
+ return n ? ++t : o.shift(), e.d = o, e.e = Ve(o, t), b ? g(e, f.precision, f.rounding) : e;
2970
+ };
2971
+ p.toBinary = function(e, n) {
2972
+ return gn(this, 2, e, n);
2973
+ };
2974
+ p.toDecimalPlaces = p.toDP = function(e, n) {
2975
+ var t = this, r = t.constructor;
2976
+ return t = new r(t), e === void 0 ? t : (x(e, 0, se), n === void 0 ? n = r.rounding : x(n, 0, 8), g(t, e + t.e + 1, n));
2977
+ };
2978
+ p.toExponential = function(e, n) {
2979
+ var t, r = this, i = r.constructor;
2980
+ return e === void 0 ? t = K(r, !0) : (x(e, 0, se), n === void 0 ? n = i.rounding : x(n, 0, 8), r = g(new i(r), e + 1, n), t = K(r, !0, e + 1)), r.isNeg() && !r.isZero() ? "-" + t : t;
2981
+ };
2982
+ p.toFixed = function(e, n) {
2983
+ var t, r, i = this, o = i.constructor;
2984
+ return e === void 0 ? t = K(i) : (x(e, 0, se), n === void 0 ? n = o.rounding : x(n, 0, 8), r = g(new o(i), e + i.e + 1, n), t = K(r, !1, e + r.e + 1)), i.isNeg() && !i.isZero() ? "-" + t : t;
2985
+ };
2986
+ p.toFraction = function(e) {
2987
+ var n, t, r, i, o, s, u, c, a, l, f, h, m = this, k = m.d, w = m.constructor;
2988
+ if (!k)
2989
+ return new w(m);
2990
+ if (a = t = new w(1), r = c = new w(0), n = new w(r), o = n.e = $t(k) - m.e - 1, s = o % v, n.d[0] = R(10, s < 0 ? v + s : s), e == null)
2991
+ e = o > 0 ? n : a;
2992
+ else {
2993
+ if (u = new w(e), !u.isInt() || u.lt(a))
2994
+ throw Error(te + u);
2995
+ e = u.gt(n) ? o > 0 ? n : a : u;
2996
+ }
2997
+ for (b = !1, u = new w(y(k)), l = w.precision, w.precision = o = k.length * v * 2; f = z(u, n, 0, 1, 1), i = t.plus(f.times(r)), i.cmp(e) != 1; )
2998
+ t = r, r = i, i = a, a = c.plus(f.times(i)), c = i, i = n, n = u.minus(f.times(i)), u = i;
2999
+ return i = z(e.minus(t), r, 0, 1, 1), c = c.plus(i.times(a)), t = t.plus(i.times(r)), c.s = a.s = m.s, h = z(a, r, o, 1).minus(m).abs().cmp(z(c, t, o, 1).minus(m).abs()) < 1 ? [a, r] : [c, t], w.precision = l, b = !0, h;
3000
+ };
3001
+ p.toHexadecimal = p.toHex = function(e, n) {
3002
+ return gn(this, 16, e, n);
3003
+ };
3004
+ p.toNearest = function(e, n) {
3005
+ var t = this, r = t.constructor;
3006
+ if (t = new r(t), e == null) {
3007
+ if (!t.d)
3008
+ return t;
3009
+ e = new r(1), n = r.rounding;
3010
+ } else {
3011
+ if (e = new r(e), n === void 0 ? n = r.rounding : x(n, 0, 8), !t.d)
3012
+ return e.s ? t : e;
3013
+ if (!e.d)
3014
+ return e.s && (e.s = t.s), e;
3015
+ }
3016
+ return e.d[0] ? (b = !1, t = z(t, e, 0, n, 1).times(e), b = !0, g(t)) : (e.s = t.s, t = e), t;
3017
+ };
3018
+ p.toNumber = function() {
3019
+ return +this;
3020
+ };
3021
+ p.toOctal = function(e, n) {
3022
+ return gn(this, 8, e, n);
3023
+ };
3024
+ p.toPower = p.pow = function(e) {
3025
+ var n, t, r, i, o, s, u = this, c = u.constructor, a = +(e = new c(e));
3026
+ if (!u.d || !e.d || !u.d[0] || !e.d[0])
3027
+ return new c(R(+u, a));
3028
+ if (u = new c(u), u.eq(1))
3029
+ return u;
3030
+ if (r = c.precision, o = c.rounding, e.eq(1))
3031
+ return g(u, r, o);
3032
+ if (n = j(e.e / v), n >= e.d.length - 1 && (t = a < 0 ? -a : a) <= ju)
3033
+ return i = It(c, u, t, r), e.s < 0 ? new c(1).div(i) : g(i, r, o);
3034
+ if (s = u.s, s < 0) {
3035
+ if (n < e.d.length - 1)
3036
+ return new c(NaN);
3037
+ if (e.d[n] & 1 || (s = 1), u.e == 0 && u.d[0] == 1 && u.d.length == 1)
3038
+ return u.s = s, u;
3039
+ }
3040
+ return t = R(+u, a), n = t == 0 || !isFinite(t) ? j(a * (Math.log("0." + y(u.d)) / Math.LN10 + u.e + 1)) : new c(t + "").e, n > c.maxE + 1 || n < c.minE - 1 ? new c(n > 0 ? s / 0 : 0) : (b = !1, c.rounding = u.s = 1, t = Math.min(12, (n + "").length), i = sn(e.times(ne(u, r + t)), r), i.d && (i = g(i, r + 5, 1), ke(i.d, r, o) && (n = r + 10, i = g(sn(e.times(ne(u, n + t)), n), n + 5, 1), +y(i.d).slice(r + 1, r + 15) + 1 == 1e14 && (i = g(i, r + 1, 0)))), i.s = s, b = !0, c.rounding = o, g(i, r, o));
3041
+ };
3042
+ p.toPrecision = function(e, n) {
3043
+ var t, r = this, i = r.constructor;
3044
+ return e === void 0 ? t = K(r, r.e <= i.toExpNeg || r.e >= i.toExpPos) : (x(e, 1, se), n === void 0 ? n = i.rounding : x(n, 0, 8), r = g(new i(r), e, n), t = K(r, e <= r.e || r.e <= i.toExpNeg, e)), r.isNeg() && !r.isZero() ? "-" + t : t;
3045
+ };
3046
+ p.toSignificantDigits = p.toSD = function(e, n) {
3047
+ var t = this, r = t.constructor;
3048
+ return e === void 0 ? (e = r.precision, n = r.rounding) : (x(e, 1, se), n === void 0 ? n = r.rounding : x(n, 0, 8)), g(new r(t), e, n);
3049
+ };
3050
+ p.toString = function() {
3051
+ var e = this, n = e.constructor, t = K(e, e.e <= n.toExpNeg || e.e >= n.toExpPos);
3052
+ return e.isNeg() && !e.isZero() ? "-" + t : t;
3053
+ };
3054
+ p.truncated = p.trunc = function() {
3055
+ return g(new this.constructor(this), this.e + 1, 1);
3056
+ };
3057
+ p.valueOf = p.toJSON = function() {
3058
+ var e = this, n = e.constructor, t = K(e, e.e <= n.toExpNeg || e.e >= n.toExpPos);
3059
+ return e.isNeg() ? "-" + t : t;
3060
+ };
3061
+ function y(e) {
3062
+ var n, t, r, i = e.length - 1, o = "", s = e[0];
3063
+ if (i > 0) {
3064
+ for (o += s, n = 1; n < i; n++)
3065
+ r = e[n] + "", t = v - r.length, t && (o += ee(t)), o += r;
3066
+ s = e[n], r = s + "", t = v - r.length, t && (o += ee(t));
3067
+ } else if (s === 0)
3068
+ return "0";
3069
+ for (; s % 10 === 0; )
3070
+ s /= 10;
3071
+ return o + s;
3072
+ }
3073
+ function x(e, n, t) {
3074
+ if (e !== ~~e || e < n || e > t)
3075
+ throw Error(te + e);
3076
+ }
3077
+ function ke(e, n, t, r) {
3078
+ var i, o, s, u;
3079
+ for (o = e[0]; o >= 10; o /= 10)
3080
+ --n;
3081
+ return --n < 0 ? (n += v, i = 0) : (i = Math.ceil((n + 1) / v), n %= v), o = R(10, v - n), u = e[i] % o | 0, r == null ? n < 3 ? (n == 0 ? u = u / 100 | 0 : n == 1 && (u = u / 10 | 0), s = t < 4 && u == 99999 || t > 3 && u == 49999 || u == 5e4 || u == 0) : s = (t < 4 && u + 1 == o || t > 3 && u + 1 == o / 2) && (e[i + 1] / o / 100 | 0) == R(10, n - 2) - 1 || (u == o / 2 || u == 0) && (e[i + 1] / o / 100 | 0) == 0 : n < 4 ? (n == 0 ? u = u / 1e3 | 0 : n == 1 ? u = u / 100 | 0 : n == 2 && (u = u / 10 | 0), s = (r || t < 4) && u == 9999 || !r && t > 3 && u == 4999) : s = ((r || t < 4) && u + 1 == o || !r && t > 3 && u + 1 == o / 2) && (e[i + 1] / o / 1e3 | 0) == R(10, n - 3) - 1, s;
3082
+ }
3083
+ function Ee(e, n, t) {
3084
+ for (var r, i = [0], o, s = 0, u = e.length; s < u; ) {
3085
+ for (o = i.length; o--; )
3086
+ i[o] *= n;
3087
+ for (i[0] += tn.indexOf(e.charAt(s++)), r = 0; r < i.length; r++)
3088
+ i[r] > t - 1 && (i[r + 1] === void 0 && (i[r + 1] = 0), i[r + 1] += i[r] / t | 0, i[r] %= t);
3089
+ }
3090
+ return i.reverse();
3091
+ }
3092
+ function Su(e, n) {
3093
+ var t, r, i;
3094
+ if (n.isZero())
3095
+ return n;
3096
+ r = n.d.length, r < 32 ? (t = Math.ceil(r / 3), i = (1 / We(4, t)).toString()) : (t = 16, i = "2.3283064365386962890625e-10"), e.precision += t, n = de(e, 1, n.times(i), new e(1));
3097
+ for (var o = t; o--; ) {
3098
+ var s = n.times(n);
3099
+ n = s.times(s).minus(s).times(8).plus(1);
3100
+ }
3101
+ return e.precision -= t, n;
3102
+ }
3103
+ var z = function() {
3104
+ function e(r, i, o) {
3105
+ var s, u = 0, c = r.length;
3106
+ for (r = r.slice(); c--; )
3107
+ s = r[c] * i + u, r[c] = s % o | 0, u = s / o | 0;
3108
+ return u && r.unshift(u), r;
3109
+ }
3110
+ function n(r, i, o, s) {
3111
+ var u, c;
3112
+ if (o != s)
3113
+ c = o > s ? 1 : -1;
3114
+ else
3115
+ for (u = c = 0; u < o; u++)
3116
+ if (r[u] != i[u]) {
3117
+ c = r[u] > i[u] ? 1 : -1;
3118
+ break;
3119
+ }
3120
+ return c;
3121
+ }
3122
+ function t(r, i, o, s) {
3123
+ for (var u = 0; o--; )
3124
+ r[o] -= u, u = r[o] < i[o] ? 1 : 0, r[o] = u * s + r[o] - i[o];
3125
+ for (; !r[0] && r.length > 1; )
3126
+ r.shift();
3127
+ }
3128
+ return function(r, i, o, s, u, c) {
3129
+ var a, l, f, h, m, k, w, D, I, B, P, N, H, J, Ye, Ne, ge, He, M, ze, Ze = r.constructor, Qe = r.s == i.s ? 1 : -1, U = r.d, Z = i.d;
3130
+ if (!U || !U[0] || !Z || !Z[0])
3131
+ return new Ze(
3132
+ // Return NaN if either NaN, or both Infinity or 0.
3133
+ !r.s || !i.s || (U ? Z && U[0] == Z[0] : !Z) ? NaN : (
3134
+ // Return ±0 if x is 0 or y is ±Infinity, or return ±Infinity as y is 0.
3135
+ U && U[0] == 0 || !Z ? Qe * 0 : Qe / 0
3136
+ )
3137
+ );
3138
+ for (c ? (m = 1, l = r.e - i.e) : (c = Y, m = v, l = j(r.e / m) - j(i.e / m)), M = Z.length, ge = U.length, I = new Ze(Qe), B = I.d = [], f = 0; Z[f] == (U[f] || 0); f++)
3139
+ ;
3140
+ if (Z[f] > (U[f] || 0) && l--, o == null ? (J = o = Ze.precision, s = Ze.rounding) : u ? J = o + (r.e - i.e) + 1 : J = o, J < 0)
3141
+ B.push(1), k = !0;
3142
+ else {
3143
+ if (J = J / m + 2 | 0, f = 0, M == 1) {
3144
+ for (h = 0, Z = Z[0], J++; (f < ge || h) && J--; f++)
3145
+ Ye = h * c + (U[f] || 0), B[f] = Ye / Z | 0, h = Ye % Z | 0;
3146
+ k = h || f < ge;
3147
+ } else {
3148
+ for (h = c / (Z[0] + 1) | 0, h > 1 && (Z = e(Z, h, c), U = e(U, h, c), M = Z.length, ge = U.length), Ne = M, P = U.slice(0, M), N = P.length; N < M; )
3149
+ P[N++] = 0;
3150
+ ze = Z.slice(), ze.unshift(0), He = Z[0], Z[1] >= c / 2 && ++He;
3151
+ do
3152
+ h = 0, a = n(Z, P, M, N), a < 0 ? (H = P[0], M != N && (H = H * c + (P[1] || 0)), h = H / He | 0, h > 1 ? (h >= c && (h = c - 1), w = e(Z, h, c), D = w.length, N = P.length, a = n(w, P, D, N), a == 1 && (h--, t(w, M < D ? ze : Z, D, c))) : (h == 0 && (a = h = 1), w = Z.slice()), D = w.length, D < N && w.unshift(0), t(P, w, N, c), a == -1 && (N = P.length, a = n(Z, P, M, N), a < 1 && (h++, t(P, M < N ? ze : Z, N, c))), N = P.length) : a === 0 && (h++, P = [0]), B[f++] = h, a && P[0] ? P[N++] = U[Ne] || 0 : (P = [U[Ne]], N = 1);
3153
+ while ((Ne++ < ge || P[0] !== void 0) && J--);
3154
+ k = P[0] !== void 0;
3155
+ }
3156
+ B[0] || B.shift();
3157
+ }
3158
+ if (m == 1)
3159
+ I.e = l, bt = k;
3160
+ else {
3161
+ for (f = 1, h = B[0]; h >= 10; h /= 10)
3162
+ f++;
3163
+ I.e = f + l * m - 1, g(I, u ? o + I.e + 1 : o, s, k);
3164
+ }
3165
+ return I;
3166
+ };
3167
+ }();
3168
+ function g(e, n, t, r) {
3169
+ var i, o, s, u, c, a, l, f, h, m = e.constructor;
3170
+ e:
3171
+ if (n != null) {
3172
+ if (f = e.d, !f)
3173
+ return e;
3174
+ for (i = 1, u = f[0]; u >= 10; u /= 10)
3175
+ i++;
3176
+ if (o = n - i, o < 0)
3177
+ o += v, s = n, l = f[h = 0], c = l / R(10, i - s - 1) % 10 | 0;
3178
+ else if (h = Math.ceil((o + 1) / v), u = f.length, h >= u)
3179
+ if (r) {
3180
+ for (; u++ <= h; )
3181
+ f.push(0);
3182
+ l = c = 0, i = 1, o %= v, s = o - v + 1;
3183
+ } else
3184
+ break e;
3185
+ else {
3186
+ for (l = u = f[h], i = 1; u >= 10; u /= 10)
3187
+ i++;
3188
+ o %= v, s = o - v + i, c = s < 0 ? 0 : l / R(10, i - s - 1) % 10 | 0;
3189
+ }
3190
+ if (r = r || n < 0 || f[h + 1] !== void 0 || (s < 0 ? l : l % R(10, i - s - 1)), a = t < 4 ? (c || r) && (t == 0 || t == (e.s < 0 ? 3 : 2)) : c > 5 || c == 5 && (t == 4 || r || t == 6 && // Check whether the digit to the left of the rounding digit is odd.
3191
+ (o > 0 ? s > 0 ? l / R(10, i - s) : 0 : f[h - 1]) % 10 & 1 || t == (e.s < 0 ? 8 : 7)), n < 1 || !f[0])
3192
+ return f.length = 0, a ? (n -= e.e + 1, f[0] = R(10, (v - n % v) % v), e.e = -n || 0) : f[0] = e.e = 0, e;
3193
+ if (o == 0 ? (f.length = h, u = 1, h--) : (f.length = h + 1, u = R(10, v - o), f[h] = s > 0 ? (l / R(10, i - s) % R(10, s) | 0) * u : 0), a)
3194
+ for (; ; )
3195
+ if (h == 0) {
3196
+ for (o = 1, s = f[0]; s >= 10; s /= 10)
3197
+ o++;
3198
+ for (s = f[0] += u, u = 1; s >= 10; s /= 10)
3199
+ u++;
3200
+ o != u && (e.e++, f[0] == Y && (f[0] = 1));
3201
+ break;
3202
+ } else {
3203
+ if (f[h] += u, f[h] != Y)
3204
+ break;
3205
+ f[h--] = 0, u = 1;
3206
+ }
3207
+ for (o = f.length; f[--o] === 0; )
3208
+ f.pop();
3209
+ }
3210
+ return b && (e.e > m.maxE ? (e.d = null, e.e = NaN) : e.e < m.minE && (e.e = 0, e.d = [0])), e;
3211
+ }
3212
+ function K(e, n, t) {
3213
+ if (!e.isFinite())
3214
+ return Ct(e);
3215
+ var r, i = e.e, o = y(e.d), s = o.length;
3216
+ return n ? (t && (r = t - s) > 0 ? o = o.charAt(0) + "." + o.slice(1) + ee(r) : s > 1 && (o = o.charAt(0) + "." + o.slice(1)), o = o + (e.e < 0 ? "e" : "e+") + e.e) : i < 0 ? (o = "0." + ee(-i - 1) + o, t && (r = t - s) > 0 && (o += ee(r))) : i >= s ? (o += ee(i + 1 - s), t && (r = t - i - 1) > 0 && (o = o + "." + ee(r))) : ((r = i + 1) < s && (o = o.slice(0, r) + "." + o.slice(r)), t && (r = t - s) > 0 && (i + 1 === s && (o += "."), o += ee(r))), o;
3217
+ }
3218
+ function Ve(e, n) {
3219
+ var t = e[0];
3220
+ for (n *= v; t >= 10; t /= 10)
3221
+ n++;
3222
+ return n;
3223
+ }
3224
+ function je(e, n, t) {
3225
+ if (n > Lu)
3226
+ throw b = !0, t && (e.precision = t), Error(Pt);
3227
+ return g(new e(ye), n, 1, !0);
3228
+ }
3229
+ function W(e, n, t) {
3230
+ if (n > on)
3231
+ throw Error(Pt);
3232
+ return g(new e(Ue), n, t, !0);
3233
+ }
3234
+ function $t(e) {
3235
+ var n = e.length - 1, t = n * v + 1;
3236
+ if (n = e[n], n) {
3237
+ for (; n % 10 == 0; n /= 10)
3238
+ t--;
3239
+ for (n = e[0]; n >= 10; n /= 10)
3240
+ t++;
3241
+ }
3242
+ return t;
3243
+ }
3244
+ function ee(e) {
3245
+ for (var n = ""; e--; )
3246
+ n += "0";
3247
+ return n;
3248
+ }
3249
+ function It(e, n, t, r) {
3250
+ var i, o = new e(1), s = Math.ceil(r / v + 4);
3251
+ for (b = !1; ; ) {
3252
+ if (t % 2 && (o = o.times(n), Sn(o.d, s) && (i = !0)), t = j(t / 2), t === 0) {
3253
+ t = o.d.length - 1, i && o.d[t] === 0 && ++o.d[t];
3254
+ break;
3255
+ }
3256
+ n = n.times(n), Sn(n.d, s);
3257
+ }
3258
+ return b = !0, o;
3259
+ }
3260
+ function Ln(e) {
3261
+ return e.d[e.d.length - 1] & 1;
3262
+ }
3263
+ function At(e, n, t) {
3264
+ for (var r, i = new e(n[0]), o = 0; ++o < n.length; )
3265
+ if (r = new e(n[o]), r.s)
3266
+ i[t](r) && (i = r);
3267
+ else {
3268
+ i = r;
3269
+ break;
3270
+ }
3271
+ return i;
3272
+ }
3273
+ function sn(e, n) {
3274
+ var t, r, i, o, s, u, c, a = 0, l = 0, f = 0, h = e.constructor, m = h.rounding, k = h.precision;
3275
+ if (!e.d || !e.d[0] || e.e > 17)
3276
+ return new h(e.d ? e.d[0] ? e.s < 0 ? 0 : 1 / 0 : 1 : e.s ? e.s < 0 ? 0 : e : 0 / 0);
3277
+ for (n == null ? (b = !1, c = k) : c = n, u = new h(0.03125); e.e > -2; )
3278
+ e = e.times(u), f += 5;
3279
+ for (r = Math.log(R(2, f)) / Math.LN10 * 2 + 5 | 0, c += r, t = o = s = new h(1), h.precision = c; ; ) {
3280
+ if (o = g(o.times(e), c, 1), t = t.times(++l), u = s.plus(z(o, t, c, 1)), y(u.d).slice(0, c) === y(s.d).slice(0, c)) {
3281
+ for (i = f; i--; )
3282
+ s = g(s.times(s), c, 1);
3283
+ if (n == null)
3284
+ if (a < 3 && ke(s.d, c - r, m, a))
3285
+ h.precision = c += 10, t = o = u = new h(1), l = 0, a++;
3286
+ else
3287
+ return g(s, h.precision = k, m, b = !0);
3288
+ else
3289
+ return h.precision = k, s;
3290
+ }
3291
+ s = u;
3292
+ }
3293
+ }
3294
+ function ne(e, n) {
3295
+ var t, r, i, o, s, u, c, a, l, f, h, m = 1, k = 10, w = e, D = w.d, I = w.constructor, B = I.rounding, P = I.precision;
3296
+ if (w.s < 0 || !D || !D[0] || !w.e && D[0] == 1 && D.length == 1)
3297
+ return new I(D && !D[0] ? -1 / 0 : w.s != 1 ? NaN : D ? 0 : w);
3298
+ if (n == null ? (b = !1, l = P) : l = n, I.precision = l += k, t = y(D), r = t.charAt(0), Math.abs(o = w.e) < 15e14) {
3299
+ for (; r < 7 && r != 1 || r == 1 && t.charAt(1) > 3; )
3300
+ w = w.times(e), t = y(w.d), r = t.charAt(0), m++;
3301
+ o = w.e, r > 1 ? (w = new I("0." + t), o++) : w = new I(r + "." + t.slice(1));
3302
+ } else
3303
+ return a = je(I, l + 2, P).times(o + ""), w = ne(new I(r + "." + t.slice(1)), l - k).plus(a), I.precision = P, n == null ? g(w, P, B, b = !0) : w;
3304
+ for (f = w, c = s = w = z(w.minus(1), w.plus(1), l, 1), h = g(w.times(w), l, 1), i = 3; ; ) {
3305
+ if (s = g(s.times(h), l, 1), a = c.plus(z(s, new I(i), l, 1)), y(a.d).slice(0, l) === y(c.d).slice(0, l))
3306
+ if (c = c.times(2), o !== 0 && (c = c.plus(je(I, l + 2, P).times(o + ""))), c = z(c, new I(m), l, 1), n == null)
3307
+ if (ke(c.d, l - k, B, u))
3308
+ I.precision = l += k, a = s = w = z(f.minus(1), f.plus(1), l, 1), h = g(w.times(w), l, 1), i = u = 1;
3309
+ else
3310
+ return g(c, I.precision = P, B, b = !0);
3311
+ else
3312
+ return I.precision = P, c;
3313
+ c = a, i += 2;
3314
+ }
3315
+ }
3316
+ function Ct(e) {
3317
+ return String(e.s * e.s / 0);
3318
+ }
3319
+ function un(e, n) {
3320
+ var t, r, i;
3321
+ for ((t = n.indexOf(".")) > -1 && (n = n.replace(".", "")), (r = n.search(/e/i)) > 0 ? (t < 0 && (t = r), t += +n.slice(r + 1), n = n.substring(0, r)) : t < 0 && (t = n.length), r = 0; n.charCodeAt(r) === 48; r++)
3322
+ ;
3323
+ for (i = n.length; n.charCodeAt(i - 1) === 48; --i)
3324
+ ;
3325
+ if (n = n.slice(r, i), n) {
3326
+ if (i -= r, e.e = t = t - r - 1, e.d = [], r = (t + 1) % v, t < 0 && (r += v), r < i) {
3327
+ for (r && e.d.push(+n.slice(0, r)), i -= v; r < i; )
3328
+ e.d.push(+n.slice(r, r += v));
3329
+ n = n.slice(r), r = v - n.length;
3330
+ } else
3331
+ r -= i;
3332
+ for (; r--; )
3333
+ n += "0";
3334
+ e.d.push(+n), b && (e.e > e.constructor.maxE ? (e.d = null, e.e = NaN) : e.e < e.constructor.minE && (e.e = 0, e.d = [0]));
3335
+ } else
3336
+ e.e = 0, e.d = [0];
3337
+ return e;
3338
+ }
3339
+ function xu(e, n) {
3340
+ var t, r, i, o, s, u, c, a, l;
3341
+ if (n.indexOf("_") > -1) {
3342
+ if (n = n.replace(/(\d)_(?=\d)/g, "$1"), Zt.test(n))
3343
+ return un(e, n);
3344
+ } else if (n === "Infinity" || n === "NaN")
3345
+ return +n || (e.s = NaN), e.e = NaN, e.d = null, e;
3346
+ if (yu.test(n))
3347
+ t = 16, n = n.toLowerCase();
3348
+ else if (Fu.test(n))
3349
+ t = 2;
3350
+ else if (Uu.test(n))
3351
+ t = 8;
3352
+ else
3353
+ throw Error(te + n);
3354
+ for (o = n.search(/p/i), o > 0 ? (c = +n.slice(o + 1), n = n.substring(2, o)) : n = n.slice(2), o = n.indexOf("."), s = o >= 0, r = e.constructor, s && (n = n.replace(".", ""), u = n.length, o = u - o, i = It(r, new r(t), o, o * 2)), a = Ee(n, t, Y), l = a.length - 1, o = l; a[o] === 0; --o)
3355
+ a.pop();
3356
+ return o < 0 ? new r(e.s * 0) : (e.e = Ve(a, l), e.d = a, b = !1, s && (e = z(e, i, u * 4)), c && (e = e.times(Math.abs(c) < 54 ? R(2, c) : Pe.pow(2, c))), b = !0, e);
3357
+ }
3358
+ function qu(e, n) {
3359
+ var t, r = n.d.length;
3360
+ if (r < 3)
3361
+ return n.isZero() ? n : de(e, 2, n, n);
3362
+ t = 1.4 * Math.sqrt(r), t = t > 16 ? 16 : t | 0, n = n.times(1 / We(5, t)), n = de(e, 2, n, n);
3363
+ for (var i, o = new e(5), s = new e(16), u = new e(20); t--; )
3364
+ i = n.times(n), n = n.times(o.plus(i.times(s.times(i).minus(u))));
3365
+ return n;
3366
+ }
3367
+ function de(e, n, t, r, i) {
3368
+ var o, s, u, c, a = e.precision, l = Math.ceil(a / v);
3369
+ for (b = !1, c = t.times(t), u = new e(r); ; ) {
3370
+ if (s = z(u.times(c), new e(n++ * n++), a, 1), u = i ? r.plus(s) : r.minus(s), r = z(s.times(c), new e(n++ * n++), a, 1), s = u.plus(r), s.d[l] !== void 0) {
3371
+ for (o = l; s.d[o] === u.d[o] && o--; )
3372
+ ;
3373
+ if (o == -1)
3374
+ break;
3375
+ }
3376
+ o = u, u = r, r = s, s = o;
3377
+ }
3378
+ return b = !0, s.d.length = l + 1, s;
3379
+ }
3380
+ function We(e, n) {
3381
+ for (var t = e; --n; )
3382
+ t *= e;
3383
+ return t;
3384
+ }
3385
+ function Ot(e, n) {
3386
+ var t, r = n.s < 0, i = W(e, e.precision, 1), o = i.times(0.5);
3387
+ if (n = n.abs(), n.lte(o))
3388
+ return X = r ? 4 : 1, n;
3389
+ if (t = n.divToInt(i), t.isZero())
3390
+ X = r ? 3 : 2;
3391
+ else {
3392
+ if (n = n.minus(t.times(i)), n.lte(o))
3393
+ return X = Ln(t) ? r ? 2 : 3 : r ? 4 : 1, n;
3394
+ X = Ln(t) ? r ? 1 : 4 : r ? 3 : 2;
3395
+ }
3396
+ return n.minus(i).abs();
3397
+ }
3398
+ function gn(e, n, t, r) {
3399
+ var i, o, s, u, c, a, l, f, h, m = e.constructor, k = t !== void 0;
3400
+ if (k ? (x(t, 1, se), r === void 0 ? r = m.rounding : x(r, 0, 8)) : (t = m.precision, r = m.rounding), !e.isFinite())
3401
+ l = Ct(e);
3402
+ else {
3403
+ for (l = K(e), s = l.indexOf("."), k ? (i = 2, n == 16 ? t = t * 4 - 3 : n == 8 && (t = t * 3 - 2)) : i = n, s >= 0 && (l = l.replace(".", ""), h = new m(1), h.e = l.length - s, h.d = Ee(K(h), 10, i), h.e = h.d.length), f = Ee(l, 10, i), o = c = f.length; f[--c] == 0; )
3404
+ f.pop();
3405
+ if (!f[0])
3406
+ l = k ? "0p+0" : "0";
3407
+ else {
3408
+ if (s < 0 ? o-- : (e = new m(e), e.d = f, e.e = o, e = z(e, h, t, r, 0, i), f = e.d, o = e.e, a = bt), s = f[t], u = i / 2, a = a || f[t + 1] !== void 0, a = r < 4 ? (s !== void 0 || a) && (r === 0 || r === (e.s < 0 ? 3 : 2)) : s > u || s === u && (r === 4 || a || r === 6 && f[t - 1] & 1 || r === (e.s < 0 ? 8 : 7)), f.length = t, a)
3409
+ for (; ++f[--t] > i - 1; )
3410
+ f[t] = 0, t || (++o, f.unshift(1));
3411
+ for (c = f.length; !f[c - 1]; --c)
3412
+ ;
3413
+ for (s = 0, l = ""; s < c; s++)
3414
+ l += tn.charAt(f[s]);
3415
+ if (k) {
3416
+ if (c > 1)
3417
+ if (n == 16 || n == 8) {
3418
+ for (s = n == 16 ? 4 : 3, --c; c % s; c++)
3419
+ l += "0";
3420
+ for (f = Ee(l, i, n), c = f.length; !f[c - 1]; --c)
3421
+ ;
3422
+ for (s = 1, l = "1."; s < c; s++)
3423
+ l += tn.charAt(f[s]);
3424
+ } else
3425
+ l = l.charAt(0) + "." + l.slice(1);
3426
+ l = l + (o < 0 ? "p" : "p+") + o;
3427
+ } else if (o < 0) {
3428
+ for (; ++o; )
3429
+ l = "0" + l;
3430
+ l = "0." + l;
3431
+ } else if (++o > c)
3432
+ for (o -= c; o--; )
3433
+ l += "0";
3434
+ else
3435
+ o < c && (l = l.slice(0, o) + "." + l.slice(o));
3436
+ }
3437
+ l = (n == 16 ? "0x" : n == 2 ? "0b" : n == 8 ? "0o" : "") + l;
3438
+ }
3439
+ return e.s < 0 ? "-" + l : l;
3440
+ }
3441
+ function Sn(e, n) {
3442
+ if (e.length > n)
3443
+ return e.length = n, !0;
3444
+ }
3445
+ function Bu(e) {
3446
+ return new this(e).abs();
3447
+ }
3448
+ function Gu(e) {
3449
+ return new this(e).acos();
3450
+ }
3451
+ function Mu(e) {
3452
+ return new this(e).acosh();
3453
+ }
3454
+ function Vu(e, n) {
3455
+ return new this(e).plus(n);
3456
+ }
3457
+ function Wu(e) {
3458
+ return new this(e).asin();
3459
+ }
3460
+ function Yu(e) {
3461
+ return new this(e).asinh();
3462
+ }
3463
+ function Hu(e) {
3464
+ return new this(e).atan();
3465
+ }
3466
+ function Qu(e) {
3467
+ return new this(e).atanh();
3468
+ }
3469
+ function Ku(e, n) {
3470
+ e = new this(e), n = new this(n);
3471
+ var t, r = this.precision, i = this.rounding, o = r + 4;
3472
+ return !e.s || !n.s ? t = new this(NaN) : !e.d && !n.d ? (t = W(this, o, 1).times(n.s > 0 ? 0.25 : 0.75), t.s = e.s) : !n.d || e.isZero() ? (t = n.s < 0 ? W(this, r, i) : new this(0), t.s = e.s) : !e.d || n.isZero() ? (t = W(this, o, 1).times(0.5), t.s = e.s) : n.s < 0 ? (this.precision = o, this.rounding = 1, t = this.atan(z(e, n, o, 1)), n = W(this, o, 1), this.precision = r, this.rounding = i, t = e.s < 0 ? t.minus(n) : t.plus(n)) : t = this.atan(z(e, n, o, 1)), t;
3473
+ }
3474
+ function Ju(e) {
3475
+ return new this(e).cbrt();
3476
+ }
3477
+ function Xu(e) {
3478
+ return g(e = new this(e), e.e + 1, 2);
3479
+ }
3480
+ function ec(e, n, t) {
3481
+ return new this(e).clamp(n, t);
3482
+ }
3483
+ function nc(e) {
3484
+ if (!e || typeof e != "object")
3485
+ throw Error(Me + "Object expected");
3486
+ var n, t, r, i = e.defaults === !0, o = [
3487
+ "precision",
3488
+ 1,
3489
+ se,
3490
+ "rounding",
3491
+ 0,
3492
+ 8,
3493
+ "toExpNeg",
3494
+ -fe,
3495
+ 0,
3496
+ "toExpPos",
3497
+ 0,
3498
+ fe,
3499
+ "maxE",
3500
+ 0,
3501
+ fe,
3502
+ "minE",
3503
+ -fe,
3504
+ 0,
3505
+ "modulo",
3506
+ 0,
3507
+ 9
3508
+ ];
3509
+ for (n = 0; n < o.length; n += 3)
3510
+ if (t = o[n], i && (this[t] = rn[t]), (r = e[t]) !== void 0)
3511
+ if (j(r) === r && r >= o[n + 1] && r <= o[n + 2])
3512
+ this[t] = r;
3513
+ else
3514
+ throw Error(te + t + ": " + r);
3515
+ if (t = "crypto", i && (this[t] = rn[t]), (r = e[t]) !== void 0)
3516
+ if (r === !0 || r === !1 || r === 0 || r === 1)
3517
+ if (r)
3518
+ if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
3519
+ this[t] = !0;
3520
+ else
3521
+ throw Error(Nt);
3522
+ else
3523
+ this[t] = !1;
3524
+ else
3525
+ throw Error(te + t + ": " + r);
3526
+ return this;
3527
+ }
3528
+ function tc(e) {
3529
+ return new this(e).cos();
3530
+ }
3531
+ function rc(e) {
3532
+ return new this(e).cosh();
3533
+ }
3534
+ function Tt(e) {
3535
+ var n, t, r;
3536
+ function i(o) {
3537
+ var s, u, c, a = this;
3538
+ if (!(a instanceof i))
3539
+ return new i(o);
3540
+ if (a.constructor = i, xn(o)) {
3541
+ a.s = o.s, b ? !o.d || o.e > i.maxE ? (a.e = NaN, a.d = null) : o.e < i.minE ? (a.e = 0, a.d = [0]) : (a.e = o.e, a.d = o.d.slice()) : (a.e = o.e, a.d = o.d ? o.d.slice() : o.d);
3542
+ return;
3543
+ }
3544
+ if (c = typeof o, c === "number") {
3545
+ if (o === 0) {
3546
+ a.s = 1 / o < 0 ? -1 : 1, a.e = 0, a.d = [0];
3547
+ return;
3548
+ }
3549
+ if (o < 0 ? (o = -o, a.s = -1) : a.s = 1, o === ~~o && o < 1e7) {
3550
+ for (s = 0, u = o; u >= 10; u /= 10)
3551
+ s++;
3552
+ b ? s > i.maxE ? (a.e = NaN, a.d = null) : s < i.minE ? (a.e = 0, a.d = [0]) : (a.e = s, a.d = [o]) : (a.e = s, a.d = [o]);
3553
+ return;
3554
+ } else if (o * 0 !== 0) {
3555
+ o || (a.s = NaN), a.e = NaN, a.d = null;
3556
+ return;
3557
+ }
3558
+ return un(a, o.toString());
3559
+ } else if (c !== "string")
3560
+ throw Error(te + o);
3561
+ return (u = o.charCodeAt(0)) === 45 ? (o = o.slice(1), a.s = -1) : (u === 43 && (o = o.slice(1)), a.s = 1), Zt.test(o) ? un(a, o) : xu(a, o);
3562
+ }
3563
+ if (i.prototype = p, i.ROUND_UP = 0, i.ROUND_DOWN = 1, i.ROUND_CEIL = 2, i.ROUND_FLOOR = 3, i.ROUND_HALF_UP = 4, i.ROUND_HALF_DOWN = 5, i.ROUND_HALF_EVEN = 6, i.ROUND_HALF_CEIL = 7, i.ROUND_HALF_FLOOR = 8, i.EUCLID = 9, i.config = i.set = nc, i.clone = Tt, i.isDecimal = xn, i.abs = Bu, i.acos = Gu, i.acosh = Mu, i.add = Vu, i.asin = Wu, i.asinh = Yu, i.atan = Hu, i.atanh = Qu, i.atan2 = Ku, i.cbrt = Ju, i.ceil = Xu, i.clamp = ec, i.cos = tc, i.cosh = rc, i.div = ic, i.exp = oc, i.floor = sc, i.hypot = uc, i.ln = cc, i.log = ac, i.log10 = fc, i.log2 = lc, i.max = hc, i.min = dc, i.mod = pc, i.mul = mc, i.pow = gc, i.random = _c, i.round = vc, i.sign = wc, i.sin = kc, i.sinh = bc, i.sqrt = Pc, i.sub = Nc, i.sum = zc, i.tan = Zc, i.tanh = $c, i.trunc = Ic, e === void 0 && (e = {}), e && e.defaults !== !0)
3564
+ for (r = ["precision", "rounding", "toExpNeg", "toExpPos", "maxE", "minE", "modulo", "crypto"], n = 0; n < r.length; )
3565
+ e.hasOwnProperty(t = r[n++]) || (e[t] = this[t]);
3566
+ return i.config(e), i;
3567
+ }
3568
+ function ic(e, n) {
3569
+ return new this(e).div(n);
3570
+ }
3571
+ function oc(e) {
3572
+ return new this(e).exp();
3573
+ }
3574
+ function sc(e) {
3575
+ return g(e = new this(e), e.e + 1, 3);
3576
+ }
3577
+ function uc() {
3578
+ var e, n, t = new this(0);
3579
+ for (b = !1, e = 0; e < arguments.length; )
3580
+ if (n = new this(arguments[e++]), n.d)
3581
+ t.d && (t = t.plus(n.times(n)));
3582
+ else {
3583
+ if (n.s)
3584
+ return b = !0, new this(1 / 0);
3585
+ t = n;
3586
+ }
3587
+ return b = !0, t.sqrt();
3588
+ }
3589
+ function xn(e) {
3590
+ return e instanceof Pe || e && e.toStringTag === zt || !1;
3591
+ }
3592
+ function cc(e) {
3593
+ return new this(e).ln();
3594
+ }
3595
+ function ac(e, n) {
3596
+ return new this(e).log(n);
3597
+ }
3598
+ function lc(e) {
3599
+ return new this(e).log(2);
3600
+ }
3601
+ function fc(e) {
3602
+ return new this(e).log(10);
3603
+ }
3604
+ function hc() {
3605
+ return At(this, arguments, "lt");
3606
+ }
3607
+ function dc() {
3608
+ return At(this, arguments, "gt");
3609
+ }
3610
+ function pc(e, n) {
3611
+ return new this(e).mod(n);
3612
+ }
3613
+ function mc(e, n) {
3614
+ return new this(e).mul(n);
3615
+ }
3616
+ function gc(e, n) {
3617
+ return new this(e).pow(n);
3618
+ }
3619
+ function _c(e) {
3620
+ var n, t, r, i, o = 0, s = new this(1), u = [];
3621
+ if (e === void 0 ? e = this.precision : x(e, 1, se), r = Math.ceil(e / v), this.crypto)
3622
+ if (crypto.getRandomValues)
3623
+ for (n = crypto.getRandomValues(new Uint32Array(r)); o < r; )
3624
+ i = n[o], i >= 429e7 ? n[o] = crypto.getRandomValues(new Uint32Array(1))[0] : u[o++] = i % 1e7;
3625
+ else if (crypto.randomBytes) {
3626
+ for (n = crypto.randomBytes(r *= 4); o < r; )
3627
+ i = n[o] + (n[o + 1] << 8) + (n[o + 2] << 16) + ((n[o + 3] & 127) << 24), i >= 214e7 ? crypto.randomBytes(4).copy(n, o) : (u.push(i % 1e7), o += 4);
3628
+ o = r / 4;
3629
+ } else
3630
+ throw Error(Nt);
3631
+ else
3632
+ for (; o < r; )
3633
+ u[o++] = Math.random() * 1e7 | 0;
3634
+ for (r = u[--o], e %= v, r && e && (i = R(10, v - e), u[o] = (r / i | 0) * i); u[o] === 0; o--)
3635
+ u.pop();
3636
+ if (o < 0)
3637
+ t = 0, u = [0];
3638
+ else {
3639
+ for (t = -1; u[0] === 0; t -= v)
3640
+ u.shift();
3641
+ for (r = 1, i = u[0]; i >= 10; i /= 10)
3642
+ r++;
3643
+ r < v && (t -= v - r);
3644
+ }
3645
+ return s.e = t, s.d = u, s;
3646
+ }
3647
+ function vc(e) {
3648
+ return g(e = new this(e), e.e + 1, this.rounding);
3649
+ }
3650
+ function wc(e) {
3651
+ return e = new this(e), e.d ? e.d[0] ? e.s : 0 * e.s : e.s || NaN;
3652
+ }
3653
+ function kc(e) {
3654
+ return new this(e).sin();
3655
+ }
3656
+ function bc(e) {
3657
+ return new this(e).sinh();
3658
+ }
3659
+ function Pc(e) {
3660
+ return new this(e).sqrt();
3661
+ }
3662
+ function Nc(e, n) {
3663
+ return new this(e).sub(n);
3664
+ }
3665
+ function zc() {
3666
+ var e = 0, n = arguments, t = new this(n[e]);
3667
+ for (b = !1; t.s && ++e < n.length; )
3668
+ t = t.plus(n[e]);
3669
+ return b = !0, g(t, this.precision, this.rounding);
3670
+ }
3671
+ function Zc(e) {
3672
+ return new this(e).tan();
3673
+ }
3674
+ function $c(e) {
3675
+ return new this(e).tanh();
3676
+ }
3677
+ function Ic(e) {
3678
+ return g(e = new this(e), e.e + 1, 1);
3679
+ }
3680
+ p[Symbol.for("nodejs.util.inspect.custom")] = p.toString;
3681
+ p[Symbol.toStringTag] = "Decimal";
3682
+ var Pe = p.constructor = Tt(rn);
3683
+ ye = new Pe(ye);
3684
+ Ue = new Pe(Ue);
3685
+ const ae = (e) => new Pe(e).toDecimalPlaces(2).toNumber();
3686
+ function ea(e, n = {}) {
3687
+ const { baseAmount: t = 0, numberOfNights: r = 1, feeIncludedInBaseAmount: i = !1, extractedFromRates: o = !1, removedPercentages: s = [] } = n, u = ae(t);
3688
+ switch (e.feeType) {
3689
+ case L.PercentageOfBooking:
3690
+ if (i)
3691
+ return ae(u * e.amount / (100 + e.amount));
3692
+ if (o) {
3693
+ const c = s.reduce((l, f) => l + f / (100 + f), 0), a = u / (1 - c);
3694
+ return ae(a * e.amount / (100 + e.amount));
3695
+ } else
3696
+ return ae(u * (e.amount / 100));
3697
+ case L.FixedChargePerRoom:
3698
+ case L.FixedChargePerBooking:
3699
+ return e.amount;
3700
+ case L.NightlyChargePerRoom:
3701
+ return ae(e.amount * r);
3702
+ default:
3703
+ return 0;
3704
+ }
3705
+ }
3706
+ const Ac = [L.FixedChargePerBooking], Cc = [L.PercentageOfBooking, L.FixedChargePerRoom, L.NightlyChargePerRoom], Oc = [L.PercentageOfBooking];
3707
+ function _n(e, n) {
3708
+ return e.filter((t) => n.includes(t.feeType));
3709
+ }
3710
+ function na(e) {
3711
+ return _n(e, Ac);
3712
+ }
3713
+ function ta(e) {
3714
+ return _n(e, Cc);
3715
+ }
3716
+ function ra(e) {
3717
+ return _n(e, Oc);
3718
+ }
3719
+ function ia(e) {
3720
+ return {
3721
+ includeInRates: [L.PercentageOfBooking, L.NightlyChargePerRoom].includes(e),
3722
+ extractFeeFromRates: e === L.PercentageOfBooking,
3723
+ appliesToAddons: e === L.PercentageOfBooking,
3724
+ includePreviousFeesInCalculation: e === L.PercentageOfBooking
3725
+ };
3726
+ }
3727
+ const oa = (e) => e, sa = (e, n) => {
3728
+ const t = {};
3729
+ return n.forEach((r) => {
3730
+ r in e && (t[r] = e[r]);
3731
+ }), t;
3732
+ }, ua = (e, n) => e.includes("cdn.app.roomstay.io") ? e + "?w=" + n : e, re = class {
3733
+ };
3734
+ re.calculateBaseAddonTotal = (e, n) => {
3735
+ let t = 0, r = 0, i = 0;
3736
+ e.price && e.quantity && (t = e.quantity * Number(e.price)), e.pricingType === V.PER_ADULT_OCCUPANCY_PER_NIGHT && e.adultQuantity ? t *= e.adultQuantity : e.pricingType === V.PER_CHILD_OCCUPANCY_PER_NIGHT && e.childQuantity && (t *= e.childQuantity), e.adultPrice && e.adultQuantity && (r = e.adultQuantity * Number(e.adultPrice)), e.childPrice && e.childQuantity && (i = e.childQuantity * Number(e.childPrice));
3737
+ let o = t + r + i;
3738
+ return qn.includes(e.pricingType) && e.nights && !n && (o *= e.nights), {
3739
+ indPrice: t,
3740
+ indAdultPrice: r,
3741
+ indChildPrice: i,
3742
+ addonTotal: o
3743
+ };
3744
+ };
3745
+ re.calculateBasketAddonTotal = (e, n = !1) => (Array.isArray(e) || (e = [e]), e.reduce(
3746
+ (r, i) => {
3747
+ var u, c, a, l, f, h;
3748
+ const o = re.calculateBaseAddonTotal(i, n);
3749
+ let s = 0;
3750
+ return (i.fee || (u = i.fees) != null && u.length) && i.quantity ? (c = i.fees) != null && c.length ? i.fees.forEach((m) => {
3751
+ s += i.quantity * m.amount;
3752
+ }) : s = i.quantity * Number(i.fee) : ((i.adultFee || (a = i.adultFees) != null && a.length) && i.adultQuantity && ((l = i.adultFees) != null && l.length ? i.adultFees.forEach((m) => {
3753
+ s += i.adultQuantity * m.amount;
3754
+ }) : s += i.adultQuantity ?? 1 * Number(i.adultFee)), (i.childFee || (f = i.childFees) != null && f.length) && i.childQuantity && ((h = i.childFees) != null && h.length ? i.childFees.forEach((m) => {
3755
+ s += i.childQuantity ?? 1 * m.amount;
3756
+ }) : s += i.childQuantity * Number(i.childFee))), qn.includes(i.pricingType) && i.nights && !n && (s *= i.nights), {
3757
+ price: r.price + o.indPrice,
3758
+ adultPrice: r.adultPrice + o.indAdultPrice,
3759
+ childPrice: r.childPrice + o.indChildPrice,
3760
+ totalFees: r.totalFees + s,
3761
+ total: r.total + o.addonTotal + s
3762
+ };
3763
+ },
3764
+ { price: 0, adultPrice: 0, childPrice: 0, totalFees: 0, total: 0 }
3765
+ ));
3766
+ re.calculateReservationAddonTotal = (e, n = !1) => (Array.isArray(e) || (e = [e]), e.reduce(
3767
+ (r, i) => {
3768
+ var l, f;
3769
+ const o = re.calculateBaseAddonTotal(i, n);
3770
+ let s, u = i.discount || 0;
3771
+ i.total !== void 0 && i.total !== null ? s = i.total : s = o.addonTotal - u;
3772
+ let c = i.fees || 0;
3773
+ (l = i.itemisedFees) != null && l.length && (c = i.itemisedFees.reduce((h, m) => h + m.amount, 0));
3774
+ const a = (f = i.itemisedFees) != null && f.length ? s : s + c;
3775
+ return {
3776
+ price: r.price + o.indPrice,
3777
+ adultPrice: r.adultPrice + o.indAdultPrice,
3778
+ childPrice: r.childPrice + o.indChildPrice,
3779
+ totalFees: r.totalFees + c,
3780
+ total: r.total + s + c,
3781
+ displayPrice: r.displayPrice + a
3782
+ };
3783
+ },
3784
+ {
3785
+ price: 0,
3786
+ adultPrice: 0,
3787
+ childPrice: 0,
3788
+ totalFees: 0,
3789
+ total: 0,
3790
+ displayPrice: 0
3791
+ }
3792
+ ));
3793
+ re.calculateTotalForReservation = (e, n = !1) => {
3794
+ var r;
3795
+ let t = 0;
3796
+ return (r = e.itemisedFees) == null || r.forEach((i) => {
3797
+ t += i.amount;
3798
+ }), e.reservations.forEach((i) => {
3799
+ var s, u, c;
3800
+ t += i.total.afterTax;
3801
+ const o = ((s = Object.keys(i.nights)) == null ? void 0 : s.length) ?? 0;
3802
+ if (t += i.fees ?? 0, (u = i.addons) != null && u.length) {
3803
+ const a = (i.addons ?? []).map((l) => ({ ...l, nights: o }));
3804
+ t += (c = re.calculateReservationAddonTotal(a, n)) == null ? void 0 : c.total;
3805
+ }
3806
+ }), ae(t);
3807
+ };
3808
+ let aa = re;
3809
+ function la(e) {
3810
+ return e.toUpperCase();
3811
+ }
3812
+ export {
3813
+ qn as ADDON_PER_NIGHT_TYPES,
3814
+ Sc as AddGiftCardSchema,
3815
+ Cu as AdyenEventCode,
3816
+ Au as AdyenResultCode,
3817
+ kt as BaseGiftCardSchema,
3818
+ Wc as CancelGiftCardTransactionSchema,
3819
+ Vc as CompleteGiftCardTransactionSchema,
3820
+ qc as CreatePaymentSessionSchema,
3821
+ Fc as DATE_FORMAT,
3822
+ V as EAddonPricingType,
3823
+ Lt as EAdminCompanyUserRole,
3824
+ Rt as EBookingFlow,
3825
+ Dt as EBookingPaymentMethod,
3826
+ Et as EBookingStatus,
3827
+ jt as ECompanyProvider,
3828
+ Vt as EDistanceUnitType,
3829
+ L as EFeeType,
3830
+ $u as EGiftCardPaymentProvider,
3831
+ Iu as EGiftCardPaymentStatus,
3832
+ Pu as EGiftCardPaymentType,
3833
+ Ou as EGiftCardTransactionType,
3834
+ Xt as EGuaranteePolicyDepositMode,
3835
+ St as EHotelAddressRequirement,
3836
+ Ft as EHotelCardProcessor,
3837
+ xt as EHotelPriceModel,
3838
+ qt as EHotelStateFieldConfiguration,
3839
+ Bt as EHotelWeekdayStartsOn,
3840
+ Gt as EIntegration,
3841
+ Ru as ELogCategory,
3842
+ Eu as ELogSeverity,
3843
+ Du as ELogType,
3844
+ yt as EPlanpayBookingStatus,
3845
+ er as EPromoCodeDiscountType,
3846
+ tr as EPromoCodeStayDateRangeRepeatType,
3847
+ nr as EPromoCodeStayDateRangeType,
3848
+ Wt as ERMSAuthSyncHistoryStatus,
3849
+ Yt as ERMSDiscountType,
3850
+ Ht as ERMSSyncStrategy,
3851
+ Ce as ERoomstayEventName,
3852
+ rr as ERoomstayEventSource,
3853
+ Qt as ERoomstayImageSize,
3854
+ Tu as ETransactionStatus,
3855
+ xc as EditGiftCardSchema,
3856
+ Yc as GetCompanyConfigSchema,
3857
+ Ut as GuestProfile,
3858
+ ir as HttpMethod,
3859
+ Mt as IAuxiliaryFilterType,
3860
+ Kt as IMaintenanceStatusService,
3861
+ bu as InternationalAddressSchema,
3862
+ Ec as ItineraryResponse,
3863
+ Tc as PCIBookingCardProcessorTypes,
3864
+ Jt as Package,
3865
+ zu as PassthroughPaymentDataSchema,
3866
+ Nu as PaymentProcessorDataSchema,
3867
+ Bc as PurchaseGiftCardSchema,
3868
+ Mc as RedeemGiftCardSchema,
3869
+ Kc as RefreshGiftCardTokenSchema,
3870
+ Gc as RefundGiftCardSchema,
3871
+ Jc as RegisterGiftCardAdminSchema,
3872
+ Rc as Reservation,
3873
+ Dc as ReservedPackage,
3874
+ aa as TotalCalculator,
3875
+ Qc as UpdateAdyenConfigSchema,
3876
+ Hc as UpdateCompanyConfigSchema,
3877
+ Zu as ValidateGiftCardSchema,
3878
+ ea as calculateFeeAmount,
3879
+ Xc as calculateTotalForMemberBooking,
3880
+ ia as getFeeOptionValidity,
3881
+ ra as getFilteredBookingAddonFees,
3882
+ na as getFilteredBookingFees,
3883
+ ta as getFilteredBookingRateFees,
3884
+ F as maxString,
3885
+ oa as nameof,
3886
+ ku as preprocessDate,
3887
+ wu as preprocessNumber,
3888
+ vt as requireEmail,
3889
+ wt as requireFutureDate,
3890
+ Ge as requirePositiveAmount,
3891
+ A as requireString,
3892
+ ua as resizeRoomstayImageUrl,
3893
+ ae as roundMoney,
3894
+ sa as subset,
3895
+ yc as toMetaEventName,
3896
+ Uc as transformToMetaEventData,
3897
+ jc as transformToMetaUserData,
3898
+ la as uppercaseString,
3899
+ Lc as validateFormWithZod
3900
+ };
3901
+ //# sourceMappingURL=index.js.map